OSDN Git Service

Optimize sysui ui queue during keyguard unlock.
authorJohn Spurlock <jspurlock@google.com>
Tue, 29 Oct 2013 18:23:51 +0000 (14:23 -0400)
committerJohn Spurlock <jspurlock@google.com>
Tue, 29 Oct 2013 18:27:41 +0000 (14:27 -0400)
Target the two biggest offenders:
 - Coalesce keyguard setHidden(false) calls during unlock.
 - Make sysui->WM call async.

Found during investigation into b/11221659.

Bug: 11221659
Change-Id: Icab48376bc356a933e0f9940bc2f924e2e77ab22

core/java/android/view/IWindowManager.aidl
packages/Keyguard/src/com/android/keyguard/KeyguardService.java

index 9d4af00..1b76cb1 100644 (file)
@@ -211,7 +211,7 @@ interface IWindowManager
     /**
      * Called by the status bar to notify Views of changes to System UI visiblity.
      */
-    void statusBarVisibilityChanged(int visibility);
+    oneway void statusBarVisibilityChanged(int visibility);
 
     /**
      * Block until the given window has been drawn to the screen.
index 36b2446..8ccd6fe 100644 (file)
@@ -68,6 +68,8 @@ public class KeyguardService extends Service {
     }
 
     private final IKeyguardService.Stub mBinder = new IKeyguardService.Stub() {
+        private boolean mSetHiddenCalled;
+        private boolean mIsHidden;
         public boolean isShowing() {
             return mKeyguardViewMediator.isShowing();
         }
@@ -89,7 +91,10 @@ public class KeyguardService extends Service {
         }
         public void setHidden(boolean isHidden) {
             checkPermission();
+            if (mSetHiddenCalled && mIsHidden == isHidden) return;
             mKeyguardViewMediator.setHidden(isHidden);
+            mSetHiddenCalled = true;
+            mIsHidden = isHidden;
         }
         public void dismiss() {
             mKeyguardViewMediator.dismiss();