From 93e462b79d6896da10e15e74c5aec6beb098dddf Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 15 Sep 2009 22:50:40 -0700 Subject: Implement issue #1780928: Need support hiding nav keys. This implements support for devices whose hardware can hide their navigation keys. It works much like the existing keyboardHidden configuration, and for compatibility uses the same configuration change bit. Also add FLAG_TURN_ON_SCREEN for windows, which has the system cause the screen to be turned on when the window is displayed. Great fun when used with FLAG_SHOW_WHEN_LOCKED! Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a --- .../com/android/server/WindowManagerService.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'services') diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index bd2c3ed..60496d6 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -442,6 +442,8 @@ public class WindowManagerService extends IWindowManager.Stub // Who is holding the screen on. Session mHoldingScreenOn; + boolean mTurnOnScreen; + /** * Whether the UI is currently running in touch mode (not showing * navigational focus because the user is directly pressing the screen). @@ -2208,6 +2210,10 @@ public class WindowManagerService extends IWindowManager.Stub && !win.mCommitDrawPending && !mDisplayFrozen) { applyEnterAnimationLocked(win); } + if (displayed && (win.mAttrs.flags + & WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON) != 0) { + win.mTurnOnScreen = true; + } if ((attrChanges&WindowManager.LayoutParams.FORMAT_CHANGED) != 0) { // To change the format, we need to re-build the surface. win.destroySurfaceLocked(); @@ -6479,6 +6485,7 @@ public class WindowManagerService extends IWindowManager.Stub int mLastLayer; boolean mHaveFrame; boolean mObscured; + boolean mTurnOnScreen; WindowState mNextOutsideTouch; @@ -7710,10 +7717,11 @@ public class WindowManagerService extends IWindowManager.Stub pw.print(" mDestroying="); pw.print(mDestroying); pw.print(" mRemoved="); pw.println(mRemoved); } - if (mOrientationChanging || mAppFreezing) { + if (mOrientationChanging || mAppFreezing || mTurnOnScreen) { pw.print(prefix); pw.print("mOrientationChanging="); pw.print(mOrientationChanging); - pw.print(" mAppFreezing="); pw.println(mAppFreezing); + pw.print(" mAppFreezing="); pw.print(mAppFreezing); + pw.print(" mTurnOnScreen="); pw.println(mTurnOnScreen); } if (mHScale != 1 || mVScale != 1) { pw.print(prefix); pw.print("mHScale="); pw.print(mHScale); @@ -9782,6 +9790,12 @@ public class WindowManagerService extends IWindowManager.Stub Message m = mH.obtainMessage(H.HOLD_SCREEN_CHANGED, holdScreen); mH.sendMessage(m); } + + if (mTurnOnScreen) { + mPowerManager.userActivity(SystemClock.uptimeMillis(), false, + LocalPowerManager.BUTTON_EVENT, true); + mTurnOnScreen = false; + } } void requestAnimationLocked(long delay) { @@ -9803,6 +9817,10 @@ public class WindowManagerService extends IWindowManager.Stub try { if (win.mSurface != null) { win.mSurface.show(); + if (win.mTurnOnScreen) { + win.mTurnOnScreen = false; + mTurnOnScreen = true; + } } return true; } catch (RuntimeException e) { -- cgit v1.1