From b7f2c9cf291b1807a296f36e751d56c8c89df772 Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Mon, 7 May 2018 09:48:53 -0700 Subject: [PATCH] Revert Nav bar contrast under magnification I don't have an answer for b/74464336, which is caused by a race between the nav bar becoming opaque and the content behind the nav bar zooming past it. The ideal solution - to exclude the nav bar's background from magnification - is not feasible right now because magnification is performed on complete windows. I think rolling back to O is the least bad thing here. Bug: 74464336 Test: Verify that magnification works the way it did in O. Change-Id: I3b4028ddba6a3d8541948dd89813728c347ad30f --- .../server/policy/PhoneWindowManager.java | 17 +---------------- .../server/policy/WindowManagerPolicy.java | 7 ------- .../server/wm/AccessibilityController.java | 7 ------- .../server/wm/TestWindowManagerPolicy.java | 4 ---- 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 1d5b1a38bbee5..8b202c351a2b6 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -802,9 +802,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { private int mCurrentUserId; - /* Whether accessibility is magnifying the screen */ - private boolean mScreenMagnificationActive; - // Maps global key codes to the components that will handle them. private GlobalKeyManager mGlobalKeyManager; @@ -8398,11 +8395,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { */ private int configureNavBarOpacity(int visibility, boolean dockedStackVisible, boolean freeformStackVisible, boolean isDockedDividerResizing) { - if (mScreenMagnificationActive) { - // When the screen is magnified, the nav bar should be opaque since its background - // can vary as the user pans and zooms - visibility = setNavBarOpaqueFlag(visibility); - } else if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { + if (mNavBarOpacityMode == NAV_BAR_OPAQUE_WHEN_FREEFORM_OR_DOCKED) { if (dockedStackVisible || freeformStackVisible || isDockedDividerResizing) { visibility = setNavBarOpaqueFlag(visibility); } @@ -8556,14 +8549,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { return false; } - @Override - public void onScreenMagnificationStateChanged(boolean active) { - synchronized (mWindowManagerFuncs.getWindowManagerLock()) { - mScreenMagnificationActive = active; - updateSystemUiVisibilityLw(); - } - } - @Override public void writeToProto(ProtoOutputStream proto, long fieldId) { final long token = proto.start(fieldId); diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java index ccbf502bc2b51..771eeb3d5d065 100644 --- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java +++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java @@ -1731,13 +1731,6 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { */ boolean canDismissBootAnimation(); - /** - * Called when the magnification state changes. - * - * @param active Whether magnification is active (that is, we are zoomed in). - */ - void onScreenMagnificationStateChanged(boolean active); - /** * Convert the user rotation mode to a human readable format. */ diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index 68be50c2689a7..f5f994ae05fda 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -87,8 +87,6 @@ final class AccessibilityController { private WindowsForAccessibilityObserver mWindowsForAccessibilityObserver; - private boolean mScreenMagnificationActive; - public void setMagnificationCallbacksLocked(MagnificationCallbacks callbacks) { if (callbacks != null) { if (mDisplayMagnifier != null) { @@ -138,11 +136,6 @@ final class AccessibilityController { if (mWindowsForAccessibilityObserver != null) { mWindowsForAccessibilityObserver.scheduleComputeChangedWindowsLocked(); } - boolean nowActive = !spec.isNop(); - if (nowActive != mScreenMagnificationActive) { - mScreenMagnificationActive = nowActive; - mService.mPolicy.onScreenMagnificationStateChanged(nowActive); - } } public void getMagnificationRegionLocked(Region outMagnificationRegion) { diff --git a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java index 1c2d53899af42..a847d9f250554 100644 --- a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java +++ b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java @@ -589,10 +589,6 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { return true; } - @Override - public void onScreenMagnificationStateChanged(boolean active) { - } - @Override public void requestUserActivityNotification() { }