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

Commit ac5d57ef authored by Tim Murray's avatar Tim Murray
Browse files

ActivityManagerService: remove synchronization for get/setDeviceOwner

These two calls don't need explicit synchronization because the int is
synchronous.

Test: boots, less contention in AMS
bug 161866124

Change-Id: I0f625b36ad7b3da1c08ed395b6ed12f9e14e5c08
parent 50ddd585
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -16771,16 +16771,13 @@ public class ActivityManagerService extends IActivityManager.Stub
        @Override
        public void setDeviceOwnerUid(int uid) {
            synchronized (ActivityManagerService.this) {
            mDeviceOwnerUid = uid;
        }
        }
        @Override
        public boolean isDeviceOwner(int uid) {
            synchronized (ActivityManagerService.this) {
                return uid >= 0 && mDeviceOwnerUid == uid;
            }
            int cachedUid = mDeviceOwnerUid;
            return uid >= 0 && cachedUid == uid;
        }
        @Override