Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a045557e authored by Matías Hernández's avatar Matías Hernández
Browse files

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
parent 5aa13a59
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment