Loading core/java/android/app/INotificationManager.aidl +8 −7 Original line number Diff line number Diff line Loading @@ -84,8 +84,9 @@ interface INotificationManager boolean isImportanceLocked(String pkg, int uid); List<String> getAllowedAssistantAdjustments(String pkg); void allowAssistantAdjustment(String adjustmentType); void disallowAssistantAdjustment(String adjustmentType); List<String> getAllowedAssistantAdjustmentsForUser(int userId); void allowAssistantAdjustment(int userId, String adjustmentType); void disallowAssistantAdjustment(int userId, String adjustmentType); boolean shouldHideSilentStatusIcons(String callingPkg); void setHideSilentStatusIcons(boolean hide); Loading Loading @@ -268,11 +269,11 @@ interface INotificationManager void setAdjustmentTypeSupportedState(in INotificationListener token, String key, boolean supported); List<String> getUnsupportedAdjustmentTypes(); int[] getAllowedAdjustmentKeyTypes(); void setAssistantAdjustmentKeyTypeState(int type, boolean enabled); String[] getAdjustmentDeniedPackages(String key); boolean isAdjustmentSupportedForPackage(String key, String pkg); void setAdjustmentSupportedForPackage(String key, String pkg, boolean enabled); int[] getAllowedClassificationTypes(); void setAssistantClassificationTypeState(int type, boolean enabled); String[] getAdjustmentDeniedPackages(int userId, String key); boolean isAdjustmentSupportedForPackage(int userId, String key, String pkg); void setAdjustmentSupportedForPackage(int userId, String key, String pkg, boolean enabled); // TODO: b/389918945 - Remove once nm_binder_perf flags are going to Nextfood. void incrementCounter(String metricId); Loading core/java/android/app/NotificationManager.java +11 −3 Original line number Diff line number Diff line Loading @@ -2236,7 +2236,7 @@ public class NotificationManager { public void allowAssistantAdjustment(@NonNull String capability) { INotificationManager service = service(); try { service.allowAssistantAdjustment(capability); service.allowAssistantAdjustment(mContext.getUserId(), capability); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2250,7 +2250,7 @@ public class NotificationManager { public void disallowAssistantAdjustment(@NonNull String capability) { INotificationManager service = service(); try { service.disallowAssistantAdjustment(capability); service.disallowAssistantAdjustment(mContext.getUserId(), capability); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2273,9 +2273,17 @@ public class NotificationManager { @TestApi @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION) public void setAssistantAdjustmentKeyTypeState(@Adjustment.Types int type, boolean enabled) { setAssistantClassificationTypeState(type, enabled); } /** * @hide */ @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION) public void setAssistantClassificationTypeState(@Adjustment.Types int type, boolean enabled) { INotificationManager service = service(); try { service.setAssistantAdjustmentKeyTypeState(type, enabled); service.setAssistantClassificationTypeState(type, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfoTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -195,13 +195,13 @@ class BundledNotificationInfoTest : SysuiTestCase() { underTest.handleCloseControls(true, false) testableLooper.processAllMessages() verify(mockINotificationManager, never()) .setAdjustmentSupportedForPackage(anyString(), anyString(), anyBoolean()) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), anyBoolean()) } @Test fun testToggleCallsUpdate() { whenever(mockINotificationManager.isAdjustmentSupportedForPackage( anyString(), anyString())).thenReturn(true) anyInt(), anyString(), anyString())).thenReturn(true) bindNotification() Loading @@ -211,7 +211,7 @@ class BundledNotificationInfoTest : SysuiTestCase() { testableLooper.processAllMessages() verify(mockINotificationManager) .setAdjustmentSupportedForPackage(anyString(), anyString(), eq(false)) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), eq(false)) } @Test Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfo.kt +2 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ class BundledNotificationInfo(context: Context?, attrs: AttributeSet?) : override fun bindInlineControls() { val enabled = mINotificationManager.isAdjustmentSupportedForPackage( mSbn.normalizedUserId, Adjustment.KEY_TYPE, mSbn.packageName, ) Loading Loading @@ -133,6 +134,7 @@ class BundledNotificationInfo(context: Context?, attrs: AttributeSet?) : mOnUserInteractionCallback.onImportanceChanged(mEntry) } mINotificationManager.setAdjustmentSupportedForPackage( mSbn.normalizedUserId, Adjustment.KEY_TYPE, mSbn.packageName, toggle.isChecked, Loading services/core/java/com/android/server/notification/NotificationManagerService.java +245 −104 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/app/INotificationManager.aidl +8 −7 Original line number Diff line number Diff line Loading @@ -84,8 +84,9 @@ interface INotificationManager boolean isImportanceLocked(String pkg, int uid); List<String> getAllowedAssistantAdjustments(String pkg); void allowAssistantAdjustment(String adjustmentType); void disallowAssistantAdjustment(String adjustmentType); List<String> getAllowedAssistantAdjustmentsForUser(int userId); void allowAssistantAdjustment(int userId, String adjustmentType); void disallowAssistantAdjustment(int userId, String adjustmentType); boolean shouldHideSilentStatusIcons(String callingPkg); void setHideSilentStatusIcons(boolean hide); Loading Loading @@ -268,11 +269,11 @@ interface INotificationManager void setAdjustmentTypeSupportedState(in INotificationListener token, String key, boolean supported); List<String> getUnsupportedAdjustmentTypes(); int[] getAllowedAdjustmentKeyTypes(); void setAssistantAdjustmentKeyTypeState(int type, boolean enabled); String[] getAdjustmentDeniedPackages(String key); boolean isAdjustmentSupportedForPackage(String key, String pkg); void setAdjustmentSupportedForPackage(String key, String pkg, boolean enabled); int[] getAllowedClassificationTypes(); void setAssistantClassificationTypeState(int type, boolean enabled); String[] getAdjustmentDeniedPackages(int userId, String key); boolean isAdjustmentSupportedForPackage(int userId, String key, String pkg); void setAdjustmentSupportedForPackage(int userId, String key, String pkg, boolean enabled); // TODO: b/389918945 - Remove once nm_binder_perf flags are going to Nextfood. void incrementCounter(String metricId); Loading
core/java/android/app/NotificationManager.java +11 −3 Original line number Diff line number Diff line Loading @@ -2236,7 +2236,7 @@ public class NotificationManager { public void allowAssistantAdjustment(@NonNull String capability) { INotificationManager service = service(); try { service.allowAssistantAdjustment(capability); service.allowAssistantAdjustment(mContext.getUserId(), capability); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2250,7 +2250,7 @@ public class NotificationManager { public void disallowAssistantAdjustment(@NonNull String capability) { INotificationManager service = service(); try { service.disallowAssistantAdjustment(capability); service.disallowAssistantAdjustment(mContext.getUserId(), capability); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading @@ -2273,9 +2273,17 @@ public class NotificationManager { @TestApi @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION) public void setAssistantAdjustmentKeyTypeState(@Adjustment.Types int type, boolean enabled) { setAssistantClassificationTypeState(type, enabled); } /** * @hide */ @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION) public void setAssistantClassificationTypeState(@Adjustment.Types int type, boolean enabled) { INotificationManager service = service(); try { service.setAssistantAdjustmentKeyTypeState(type, enabled); service.setAssistantClassificationTypeState(type, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfoTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -195,13 +195,13 @@ class BundledNotificationInfoTest : SysuiTestCase() { underTest.handleCloseControls(true, false) testableLooper.processAllMessages() verify(mockINotificationManager, never()) .setAdjustmentSupportedForPackage(anyString(), anyString(), anyBoolean()) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), anyBoolean()) } @Test fun testToggleCallsUpdate() { whenever(mockINotificationManager.isAdjustmentSupportedForPackage( anyString(), anyString())).thenReturn(true) anyInt(), anyString(), anyString())).thenReturn(true) bindNotification() Loading @@ -211,7 +211,7 @@ class BundledNotificationInfoTest : SysuiTestCase() { testableLooper.processAllMessages() verify(mockINotificationManager) .setAdjustmentSupportedForPackage(anyString(), anyString(), eq(false)) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), eq(false)) } @Test Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfo.kt +2 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ class BundledNotificationInfo(context: Context?, attrs: AttributeSet?) : override fun bindInlineControls() { val enabled = mINotificationManager.isAdjustmentSupportedForPackage( mSbn.normalizedUserId, Adjustment.KEY_TYPE, mSbn.packageName, ) Loading Loading @@ -133,6 +134,7 @@ class BundledNotificationInfo(context: Context?, attrs: AttributeSet?) : mOnUserInteractionCallback.onImportanceChanged(mEntry) } mINotificationManager.setAdjustmentSupportedForPackage( mSbn.normalizedUserId, Adjustment.KEY_TYPE, mSbn.packageName, toggle.isChecked, Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +245 −104 File changed.Preview size limit exceeded, changes collapsed. Show changes