Remove (erroneous) NLS check in isNotificationPolicyAccessGranted()
It's unnecessary, because all NLSes are already in mConditionProviders, and it was also wrong, because (in the non-managedServicesConcurrentMultiuser path) it was checking for USER_CURRENT instead of the calling user. This meant that a package installed in both main profile and work profile, and set as an NLS on the main profile, would see isNotificationPolicyAccessGranted=true on the work profile -- although this doesn't make sense (work profile apps cannot manage DND) and actually trying to manage zen rules on that profile would fail. Also slightly rewrote the method, to make it clearer that the correct userid / uid is checked every time. Bug: 390441924 Test: atest NotificationManagerServiceTest Flag: com.android.server.notification.skip_policy_access_nls_check Change-Id: Ia1fbc803cbe6961f4a661d31d853443556707096
Loading
Please register or sign in to comment