Loading services/core/java/com/android/server/notification/NotificationManagerService.java +5 −5 Original line number Diff line number Diff line Loading @@ -579,9 +579,6 @@ public class NotificationManagerService extends SystemService { private float mInCallNotificationVolume; private Binder mCallNotificationToken = null; @VisibleForTesting protected boolean mSystemExemptFromDismissal = false; private SystemUiSystemPropertiesFlags.FlagResolver mFlagResolver; // used as a mutex for access to all active notifications & listeners Loading Loading @@ -648,6 +645,7 @@ public class NotificationManagerService extends SystemService { private NotificationUsageStats mUsageStats; private boolean mLockScreenAllowSecureNotifications = true; boolean mAllowFgsDismissal = false; boolean mSystemExemptFromDismissal = false; private static final int MY_UID = Process.myUid(); private static final int MY_PID = Process.myPid(); Loading Loading @@ -2603,8 +2601,10 @@ public class NotificationManagerService extends SystemService { mAllowFgsDismissal = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED, true); mSystemExemptFromDismissal = mDpm.isApplicationExemptionsFlagEnabled(); mSystemExemptFromDismissal = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, /* name= */ "application_exemptions", /* defaultValue= */ true); DeviceConfig.addOnPropertiesChangedListener( DeviceConfig.NAMESPACE_SYSTEMUI, new HandlerExecutor(mHandler), Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +12 −4 Original line number Diff line number Diff line Loading @@ -10305,7 +10305,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10326,7 +10326,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(true); setSystemExemptFromDismissal(true); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10337,7 +10337,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Then: the notification's flag FLAG_NO_DISMISS should be set assertNotSame(0, n.flags & Notification.FLAG_NO_DISMISS); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); } @Test Loading @@ -10349,7 +10349,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10360,4 +10360,12 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Then: the notification's flag FLAG_NO_DISMISS should not be set assertEquals(0, n.flags & Notification.FLAG_NO_DISMISS); } private void setSystemExemptFromDismissal(boolean isOn) { DeviceConfig.setProperty( DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, /* name= */ "application_exemptions", String.valueOf(isOn), /* makeDefault= */ false); } } services/tests/uiservicestests/src/com/android/server/notification/TestableNotificationManagerService.java +0 −4 Original line number Diff line number Diff line Loading @@ -159,8 +159,4 @@ public class TestableNotificationManagerService extends NotificationManagerServi return mGetStrongAuthForUserReturnValue; } } protected void setSystemExemptFromDismissal(boolean isOn) { mSystemExemptFromDismissal = isOn; } } Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +5 −5 Original line number Diff line number Diff line Loading @@ -579,9 +579,6 @@ public class NotificationManagerService extends SystemService { private float mInCallNotificationVolume; private Binder mCallNotificationToken = null; @VisibleForTesting protected boolean mSystemExemptFromDismissal = false; private SystemUiSystemPropertiesFlags.FlagResolver mFlagResolver; // used as a mutex for access to all active notifications & listeners Loading Loading @@ -648,6 +645,7 @@ public class NotificationManagerService extends SystemService { private NotificationUsageStats mUsageStats; private boolean mLockScreenAllowSecureNotifications = true; boolean mAllowFgsDismissal = false; boolean mSystemExemptFromDismissal = false; private static final int MY_UID = Process.myUid(); private static final int MY_PID = Process.myPid(); Loading Loading @@ -2603,8 +2601,10 @@ public class NotificationManagerService extends SystemService { mAllowFgsDismissal = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED, true); mSystemExemptFromDismissal = mDpm.isApplicationExemptionsFlagEnabled(); mSystemExemptFromDismissal = DeviceConfig.getBoolean( DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, /* name= */ "application_exemptions", /* defaultValue= */ true); DeviceConfig.addOnPropertiesChangedListener( DeviceConfig.NAMESPACE_SYSTEMUI, new HandlerExecutor(mHandler), Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +12 −4 Original line number Diff line number Diff line Loading @@ -10305,7 +10305,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10326,7 +10326,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(true); setSystemExemptFromDismissal(true); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10337,7 +10337,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Then: the notification's flag FLAG_NO_DISMISS should be set assertNotSame(0, n.flags & Notification.FLAG_NO_DISMISS); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); } @Test Loading @@ -10349,7 +10349,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Given: a notification has the flag FLAG_ONGOING_EVENT set // feature flag: ALLOW_DISMISS_ONGOING is on mTestFlagResolver.setFlagOverride(ALLOW_DISMISS_ONGOING, true); mService.setSystemExemptFromDismissal(false); setSystemExemptFromDismissal(false); Notification n = new Notification.Builder(mContext, "test") .setOngoing(true) .build(); Loading @@ -10360,4 +10360,12 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { // Then: the notification's flag FLAG_NO_DISMISS should not be set assertEquals(0, n.flags & Notification.FLAG_NO_DISMISS); } private void setSystemExemptFromDismissal(boolean isOn) { DeviceConfig.setProperty( DeviceConfig.NAMESPACE_DEVICE_POLICY_MANAGER, /* name= */ "application_exemptions", String.valueOf(isOn), /* makeDefault= */ false); } }
services/tests/uiservicestests/src/com/android/server/notification/TestableNotificationManagerService.java +0 −4 Original line number Diff line number Diff line Loading @@ -159,8 +159,4 @@ public class TestableNotificationManagerService extends NotificationManagerServi return mGetStrongAuthForUserReturnValue; } } protected void setSystemExemptFromDismissal(boolean isOn) { mSystemExemptFromDismissal = isOn; } }