OSDN Git Service

Put overlay system bar testing behind a setting.
authorJohn Spurlock <jspurlock@google.com>
Fri, 31 May 2013 14:31:04 +0000 (10:31 -0400)
committerJohn Spurlock <jspurlock@google.com>
Fri, 7 Jun 2013 15:02:53 +0000 (11:02 -0400)
And disable the system gesture by default.  Also remove observer
for obsolete "fancy_rotation_anim" setting.

Change-Id: I08012c164e10bfa5f10a1df8a3db4a3f0203f236

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

index 82db56d..0da3b56 100644 (file)
@@ -538,7 +538,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     Settings.Secure.DEFAULT_INPUT_METHOD), false, this,
                     UserHandle.USER_ALL);
             resolver.registerContentObserver(Settings.System.getUriFor(
-                    "fancy_rotation_anim"), false, this,
+                    OverlayTesting.ENABLED_SETTING), false, this,
                     UserHandle.USER_ALL);
             updateSettings();
         }
@@ -949,7 +949,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     }
                     @Override
                     public void onDebug() {
-                        if (OverlayTesting.ENABLED) {
+                        if (OverlayTesting.enabled) {
                             OverlayTesting.toggleForceOverlay(mFocusedWindow, mContext);
                         }
                     }
@@ -1179,6 +1179,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                 mHasSoftInput = hasSoftInput;
                 updateRotation = true;
             }
+            OverlayTesting.enabled = Settings.System.getIntForUser(resolver,
+                    OverlayTesting.ENABLED_SETTING, 0, UserHandle.USER_CURRENT) != 0;
         }
         if (updateRotation) {
             updateRotation(true);
@@ -5088,7 +5090,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
     }
 
     private int updateHideybarsLw(int tmpVisibility) {
-        if (OverlayTesting.ENABLED) {
+        if (OverlayTesting.enabled) {
             tmpVisibility = OverlayTesting.applyForced(mFocusedWindow, tmpVisibility);
         }
         boolean statusBarHasFocus =
@@ -5155,7 +5157,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
 
     // TODO temporary helper that allows testing overlay bars on existing apps
     private static final class OverlayTesting {
-        static final boolean ENABLED = true;
+        static String ENABLED_SETTING = "overlay_testing_enabled";
+        static boolean enabled = false;
         private static final HashSet<String> sForced = new HashSet<String>();
 
         private static String parseActivity(WindowState win) {