Merge "Inline MODES_API flag" into main

This commit is contained in:
Treehugger Robot
2025-02-13 09:43:04 -08:00
committed by Android (Google) Code Review
29 changed files with 53 additions and 135 deletions

View File

@@ -102,7 +102,7 @@ public class DndConditionalCardControllerTest {
private ZenModeConfig getMutedAllConfig() {
final ZenModeConfig config = new ZenModeConfig();
config.applyNotificationPolicy(new NotificationManager.Policy(0, 0, 0));
config.areChannelsBypassingDnd = false;
config.hasPriorityChannels = false;
return config;
}
}

View File

@@ -85,7 +85,7 @@ public class ZenModeSetCalendarPreferenceControllerTest {
}
@Test
@EnableFlags({Flags.FLAG_MODES_API, Flags.FLAG_MODES_UI})
@EnableFlags(Flags.FLAG_MODES_UI)
public void updateEventMode_updatesConditionAndTriggerDescription() {
ZenMode mode = new TestModeBuilder()
.setPackage(SystemZenRules.PACKAGE_ANDROID)

View File

@@ -80,7 +80,7 @@ public class ZenModeSetSchedulePreferenceControllerTest {
}
@Test
@EnableFlags({Flags.FLAG_MODES_API, Flags.FLAG_MODES_UI})
@EnableFlags(Flags.FLAG_MODES_UI)
public void updateScheduleRule_updatesConditionAndTriggerDescription() {
ZenMode mode = new TestModeBuilder()
.setPackage(SystemZenRules.PACKAGE_ANDROID)

View File

@@ -213,11 +213,7 @@ public class ZenModeBackendTest {
mBackend.saveConversationSenders(CONVERSATION_SENDERS_NONE);
ArgumentCaptor<Policy> captor = ArgumentCaptor.forClass(Policy.class);
if (android.app.Flags.modesApi()) {
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
} else {
verify(mNotificationManager).setNotificationPolicy(captor.capture());
}
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
Policy expected = new Policy(
PRIORITY_CATEGORY_CALLS | PRIORITY_CATEGORY_MESSAGES | PRIORITY_CATEGORY_ALARMS,
@@ -241,11 +237,7 @@ public class ZenModeBackendTest {
mBackend.saveConversationSenders(CONVERSATION_SENDERS_ANYONE);
ArgumentCaptor<Policy> captor = ArgumentCaptor.forClass(Policy.class);
if (android.app.Flags.modesApi()) {
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
} else {
verify(mNotificationManager).setNotificationPolicy(captor.capture());
}
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
Policy expected = new Policy(PRIORITY_CATEGORY_CONVERSATIONS
| PRIORITY_CATEGORY_CALLS | PRIORITY_CATEGORY_MESSAGES | PRIORITY_CATEGORY_ALARMS,
@@ -270,11 +262,7 @@ public class ZenModeBackendTest {
mBackend.saveSenders(PRIORITY_CATEGORY_CALLS, PRIORITY_SENDERS_ANY);
ArgumentCaptor<Policy> captor = ArgumentCaptor.forClass(Policy.class);
if (android.app.Flags.modesApi()) {
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
} else {
verify(mNotificationManager).setNotificationPolicy(captor.capture());
}
verify(mNotificationManager).setNotificationPolicy(captor.capture(), eq(true));
Policy expected = new Policy(PRIORITY_CATEGORY_CONVERSATIONS
| PRIORITY_CATEGORY_CALLS | PRIORITY_CATEGORY_MESSAGES | PRIORITY_CATEGORY_ALARMS,

View File

@@ -107,7 +107,7 @@ public class ZenModeEventRuleSettingsTest {
}
@Test
@EnableFlags({Flags.FLAG_MODES_API, Flags.FLAG_MODES_UI})
@EnableFlags(Flags.FLAG_MODES_UI)
public void updateEventRule_updatesConditionAndTriggerDescription() {
mFragment.setBackend(mBackend);
mFragment.mId = "id";

View File

@@ -107,7 +107,7 @@ public class ZenModeScheduleRuleSettingsTest {
}
@Test
@EnableFlags({Flags.FLAG_MODES_API, Flags.FLAG_MODES_UI})
@EnableFlags(Flags.FLAG_MODES_UI)
public void updateScheduleRule_updatesConditionAndTriggerDescription() {
mFragment.setBackend(mBackend);
mFragment.mId = "id";

View File

@@ -117,11 +117,7 @@ public class ZenModeSliceBuilderTest {
ZenModeSliceBuilder.handleUriChange(mContext, intent);
if (android.app.Flags.modesApi()) {
verify(mNm).setZenMode(eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS), any(), any(), eq(true));
} else {
verify(mNm).setZenMode(eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS), any(), any());
}
verify(mNm).setZenMode(eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS), any(), any(), eq(true));
}
@Test
@@ -131,10 +127,6 @@ public class ZenModeSliceBuilderTest {
ZenModeSliceBuilder.handleUriChange(mContext, intent);
if (android.app.Flags.modesApi()) {
verify(mNm).setZenMode(eq(ZEN_MODE_OFF), any(), any(), eq(true));
} else {
verify(mNm).setZenMode(eq(ZEN_MODE_OFF), any(), any());
}
verify(mNm).setZenMode(eq(ZEN_MODE_OFF), any(), any(), eq(true));
}
}