Merge "Rename usages of ZenRule.isAutomaticActive() to isActive() in Settings" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
46744e40f0
@@ -76,7 +76,7 @@ public class ZenModeBehaviorFooterPreferenceController extends AbstractZenModePr
|
||||
|
||||
// DND turned on by an automatic rule with deprecated zen mode
|
||||
for (ZenModeConfig.ZenRule automaticRule : config.automaticRules.values()) {
|
||||
if (automaticRule.isAutomaticActive() && isDeprecatedZenMode(
|
||||
if (automaticRule.isActive() && isDeprecatedZenMode(
|
||||
automaticRule.zenMode)) {
|
||||
ComponentName component = automaticRule.component;
|
||||
if (component != null) {
|
||||
|
@@ -153,7 +153,7 @@ public class ZenModeSettingsFooterPreferenceController extends AbstractZenModePr
|
||||
|
||||
// DND turned on by an automatic rule
|
||||
for (ZenModeConfig.ZenRule automaticRule : config.automaticRules.values()) {
|
||||
if (automaticRule.isAutomaticActive()) {
|
||||
if (automaticRule.isActive()) {
|
||||
// set footer if 3rd party rule
|
||||
if (!mZenModeConfigWrapper.isTimeRule(automaticRule.conditionId)) {
|
||||
return mContext.getString(R.string.zen_mode_settings_dnd_automatic_rule,
|
||||
@@ -180,7 +180,7 @@ public class ZenModeSettingsFooterPreferenceController extends AbstractZenModePr
|
||||
}
|
||||
|
||||
for (ZenModeConfig.ZenRule automaticRule : config.automaticRules.values()) {
|
||||
if (automaticRule.isAutomaticActive()) {
|
||||
if (automaticRule.isActive()) {
|
||||
zenRules.add(automaticRule);
|
||||
}
|
||||
}
|
||||
|
@@ -43,7 +43,6 @@ import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.notification.zen.AbstractZenModePreferenceController.ZenModeConfigWrapper;
|
||||
import com.android.settings.notification.zen.ZenModeBehaviorFooterPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -206,7 +205,7 @@ public class ZenModeBehaviorFooterPreferenceControllerTest {
|
||||
ZenRule injectedRule = spy(new ZenRule());
|
||||
injectedRule.zenMode = ZEN_MODE_ALARMS;
|
||||
injectedRule.component = mock(ComponentName.class);
|
||||
when(injectedRule.isAutomaticActive()).thenReturn(true);
|
||||
when(injectedRule.isActive()).thenReturn(true);
|
||||
when(injectedRule.component.getPackageName()).thenReturn(TEST_APP_NAME);
|
||||
injectedAutomaticRules.put("testid", injectedRule);
|
||||
|
||||
@@ -226,7 +225,7 @@ public class ZenModeBehaviorFooterPreferenceControllerTest {
|
||||
ZenRule injectedRule = spy(new ZenRule());
|
||||
injectedRule.zenMode = ZEN_MODE_NO_INTERRUPTIONS;
|
||||
injectedRule.component = mock(ComponentName.class);
|
||||
when(injectedRule.isAutomaticActive()).thenReturn(true);
|
||||
when(injectedRule.isActive()).thenReturn(true);
|
||||
when(injectedRule.component.getPackageName()).thenReturn(TEST_APP_NAME);
|
||||
injectedAutomaticRules.put("testid", injectedRule);
|
||||
|
||||
|
@@ -44,7 +44,6 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.notification.zen.AbstractZenModePreferenceController.ZenModeConfigWrapper;
|
||||
import com.android.settings.notification.zen.ZenModeSettingsFooterPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -289,7 +288,7 @@ public class ZenModeSettingsFooterPreferenceControllerTest {
|
||||
injectedRule.component = mock(ComponentName.class);
|
||||
injectedRule.name = nameAndId;
|
||||
injectedRule.conditionId = new Uri.Builder().authority(nameAndId).build(); // unique uri
|
||||
when(injectedRule.isAutomaticActive()).thenReturn(isActive);
|
||||
when(injectedRule.isActive()).thenReturn(isActive);
|
||||
when(mConfigWrapper.isTimeRule(injectedRule.conditionId)).thenReturn(!isApp);
|
||||
if (isApp) {
|
||||
when(injectedRule.component.getPackageName()).thenReturn(TEST_APP_NAME);
|
||||
|
Reference in New Issue
Block a user