Use separate lock in UserController

Introduced a new lock for synchronizing internal state - mLock.

This change improves locking by reducing the amount of contention on
ActivityManager lock. E.g. in user switching test executed 4 times, the
total time reported in dvm_lock_sample for locks owned by UserController
was reduced from 9200 to 2400 ms.

Test: UserControllerTest
Test: android.multiuser.UserLifecycleTests
Test: CtsMultiUserHostTestCases

Bug: 64165549
Change-Id: I907b22dcda806b4159c8afa4a7299e8e538ba721
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index bf0c3a4..f423ce8 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -3660,7 +3660,7 @@
     /** Checks whether the userid is a profile of the current user. */
     boolean isCurrentProfileLocked(int userId) {
         if (userId == mCurrentUser) return true;
-        return mService.mUserController.isCurrentProfileLocked(userId);
+        return mService.mUserController.isCurrentProfile(userId);
     }
 
     /**