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

Commit f14825b1 authored by Mayank Garg's avatar Mayank Garg
Browse files

Always allow System user to change device config in case of Multi-user-multi-display (MUMD)

When visible background user (aka MUMD) is enabled, background users are visible on other displays. In this config, some namespaces (right now game_overlay) are not allowed to be updated by any user other than current user. The CL allows SYSTEM user to change that namespace config.

Flag: EXEMPT bug fix

Bug: 375232833
Bug: 361502556
Bug: 328686115
Test: atest GameManagerStatsTests
Test: atest AndroidCarApiTest:android.car.apitest.DeviceConfigTest
Test: atest --user-type secondary_user_on_secondary_display AndroidCarApiTest:android.car.apitest.DeviceConfigTest
Change-Id: I73cd0fae216ab9aecefc2fdb49a719e919c6437a
parent 205cd9fd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2479,10 +2479,10 @@ public class SettingsProvider extends ContentProvider {
        final long identity = Binder.clearCallingIdentity();
        try {
            int currentUser = ActivityManager.getCurrentUser();
            if (callingUser == currentUser) {
                // enforce the deny list only if the caller is not current user. Currently only auto
                // uses background visible user, and auto doesn't support profiles so profiles of
                // current users is not checked here.
            if (callingUser == currentUser || callingUser == UserHandle.USER_SYSTEM) {
                // enforce the deny list only if the caller is not current user or not a system
                // user. Currently only auto uses background visible user, and auto doesn't
                // support profiles so profiles of current users is not checked here.
                return;
            }
        } finally {