Merge "Disable NAS migration notification" into sc-dev am: 75f7a2894b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15156770

Change-Id: I8941d3302b60c4b4ece6049ad30f1514732825ac
This commit is contained in:
TreeHugger Robot
2021-07-01 15:02:28 +00:00
committed by Automerger Merge Worker
2 changed files with 25 additions and 16 deletions

View File

@@ -773,12 +773,13 @@ public class NotificationManagerService extends SystemService {
mAssistants.resetDefaultFromConfig();
continue;
}
// TODO(b/192450820): re-enable when "user set" isn't over triggering
//User selected different NAS, need onboarding
enqueueNotificationInternal(getContext().getPackageName(),
/*enqueueNotificationInternal(getContext().getPackageName(),
getContext().getOpPackageName(), Binder.getCallingUid(),
Binder.getCallingPid(), TAG,
SystemMessageProto.SystemMessage.NOTE_NAS_UPGRADE,
createNASUpgradeNotification(userId), userId);
createNASUpgradeNotification(userId), userId);*/
}
}
}

View File

@@ -4855,6 +4855,9 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
@Test
public void testAreBubblesEnabled() throws Exception {
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.NOTIFICATION_BUBBLES, 1);
mService.mPreferencesHelper.updateBubblesEnabled();
assertTrue(mBinderService.areBubblesEnabled(UserHandle.getUserHandleForUid(mUid)));
}
@@ -5907,7 +5910,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
service.migrateDefaultNASShowNotificationIfNecessary();
assertFalse(service.isNASMigrationDone(userId));
verify(service, times(1)).createNASUpgradeNotification(eq(userId));
//TODO(b/192450820)
//verify(service, times(1)).createNASUpgradeNotification(eq(userId));
verify(mAssistants, times(0)).resetDefaultFromConfig();
//Test user clear data before enable/disable from onboarding notification
@@ -5926,7 +5930,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
//The notification should be still there
assertFalse(service.isNASMigrationDone(userId));
verify(service, times(2)).createNASUpgradeNotification(eq(userId));
//TODO(b/192450820)
//verify(service, times(2)).createNASUpgradeNotification(eq(userId));
verify(mAssistants, times(0)).resetDefaultFromConfig();
assertEquals(oldDefaultComponent, service.getApprovedAssistant(userId));
}
@@ -5962,7 +5967,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertFalse(service.isNASMigrationDone(userId1));
assertTrue(service.isNASMigrationDone(userId2));
verify(service, times(1)).createNASUpgradeNotification(any(Integer.class));
//TODO(b/192450820)
//verify(service, times(1)).createNASUpgradeNotification(any(Integer.class));
// only user2's default get updated
verify(mAssistants, times(1)).resetDefaultFromConfig();
}
@@ -5997,9 +6003,9 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertFalse(service.isNASMigrationDone(userId1));
assertFalse(service.isNASMigrationDone(userId2));
// only user1 get notification
verify(service, times(1)).createNASUpgradeNotification(eq(userId1));
verify(service, times(0)).createNASUpgradeNotification(eq(userId2));
// TODO(b/192450820): only user1 get notification
//verify(service, times(1)).createNASUpgradeNotification(eq(userId1));
//verify(service, times(0)).createNASUpgradeNotification(eq(userId2));
}
@@ -6029,8 +6035,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
//Test migrate flow again
service.migrateDefaultNASShowNotificationIfNecessary();
//The notification should not appear again
verify(service, times(0)).createNASUpgradeNotification(eq(userId));
//TODO(b/192450820): The notification should not appear again
//verify(service, times(0)).createNASUpgradeNotification(eq(userId));
verify(mAssistants, times(0)).resetDefaultFromConfig();
}
@@ -6055,9 +6061,9 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
verify(mAssistants, times(1)).clearDefaults();
verify(mAssistants, times(0)).resetDefaultFromConfig();
//No more notification after disabled
service.migrateDefaultNASShowNotificationIfNecessary();
verify(service, times(0)).createNASUpgradeNotification(anyInt());
//TODO(b/192450820):No more notification after disabled
//service.migrateDefaultNASShowNotificationIfNecessary();
//verify(service, times(0)).createNASUpgradeNotification(anyInt());
}
@Test
@@ -6077,8 +6083,9 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertFalse(service.isNASMigrationDone(userId2));
verify(mAssistants, times(1)).resetDefaultFromConfig();
service.migrateDefaultNASShowNotificationIfNecessary();
verify(service, times(0)).createNASUpgradeNotification(eq(userId1));
//TODO(b/192450820)
//service.migrateDefaultNASShowNotificationIfNecessary();
//verify(service, times(0)).createNASUpgradeNotification(eq(userId1));
}
@Test
@@ -6093,7 +6100,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
verify(mContext, times(1)).startActivity(any(Intent.class));
assertFalse(service.isNASMigrationDone(userId));
verify(service, times(0)).createNASUpgradeNotification(eq(userId));
//TODO(b/192450820)
//verify(service, times(0)).createNASUpgradeNotification(eq(userId));
verify(mAssistants, times(0)).resetDefaultFromConfig();
}