OSDN Git Service

Don't call back into AM to get current user.
authorJohn Spurlock <jspurlock@google.com>
Wed, 19 Feb 2014 14:49:25 +0000 (09:49 -0500)
committerJohn Spurlock <jspurlock@google.com>
Wed, 19 Feb 2014 14:49:25 +0000 (09:49 -0500)
Bug:13079471
Change-Id: I733d6e3c41c91008406261eac827e6b65bb400db

policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

index 3cc74fc..5602206 100644 (file)
@@ -84,9 +84,9 @@ public class ImmersiveModeConfirmation {
         return exit != null ? exit.getDuration() : 0;
     }
 
-    public void loadSetting() {
+    public void loadSetting(int currentUserId) {
         mConfirmed = false;
-        mCurrentUserId = getCurrentUser();
+        mCurrentUserId = currentUserId;
         if (DEBUG) Slog.d(TAG, String.format("loadSetting() mCurrentUserId=%d resetForPanic=%s",
                 mCurrentUserId, mUserPanicResets.get(mCurrentUserId, false)));
         String value = null;
@@ -159,14 +159,6 @@ public class ImmersiveModeConfirmation {
         saveSetting();
     }
 
-    private int getCurrentUser() {
-        try {
-            return ActivityManagerNative.getDefault().getCurrentUser().id;
-        } catch (RemoteException e) {
-            throw new IllegalStateException(e); // local call
-        }
-    }
-
     private void handleHide() {
         if (mClingWindow != null) {
             if (DEBUG) Slog.d(TAG, "Hiding immersive mode confirmation");
index ece4fe7..c0f8414 100644 (file)
@@ -1168,7 +1168,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 updateRotation = true;
             }
             if (mImmersiveModeConfirmation != null) {
-                mImmersiveModeConfirmation.loadSetting();
+                mImmersiveModeConfirmation.loadSetting(mCurrentUserId);
             }
             PolicyControl.reloadFromSetting(mContext);
         }