summaryrefslogtreecommitdiffstats
path: root/policy/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'policy/src/com')
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java45
1 files changed, 35 insertions, 10 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 90f4312..1ac956a 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -527,6 +527,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private boolean mAllowTheaterModeWakeFromKey;
private boolean mAllowTheaterModeWakeFromPowerKey;
private boolean mAllowTheaterModeWakeFromMotion;
+ private boolean mAllowTheaterModeWakeFromMotionWhenNotDreaming;
private boolean mAllowTheaterModeWakeFromCameraLens;
private boolean mAllowTheaterModeWakeFromLidSwitch;
private boolean mAllowTheaterModeWakeFromWakeGesture;
@@ -999,6 +1000,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
break;
case MULTI_PRESS_POWER_BRIGHTNESS_BOOST:
+ Slog.i(TAG, "Starting brightness boost.");
+ if (!interactive) {
+ wakeUpFromPowerKey(eventTime);
+ }
mPowerManager.boostScreenBrightness(eventTime);
break;
}
@@ -1237,6 +1242,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.bool.config_allowTheaterModeWakeFromPowerKey);
mAllowTheaterModeWakeFromMotion = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_allowTheaterModeWakeFromMotion);
+ mAllowTheaterModeWakeFromMotionWhenNotDreaming = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_allowTheaterModeWakeFromMotionWhenNotDreaming);
mAllowTheaterModeWakeFromCameraLens = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_allowTheaterModeWakeFromCameraLens);
mAllowTheaterModeWakeFromLidSwitch = mContext.getResources().getBoolean(
@@ -3085,7 +3092,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
@Override
- public void getContentInsetHintLw(WindowManager.LayoutParams attrs, Rect contentInset) {
+ public void getInsetHintLw(WindowManager.LayoutParams attrs, Rect outContentInsets,
+ Rect outStableInsets) {
final int fl = PolicyControl.getWindowFlags(null, attrs);
final int sysuiVis = PolicyControl.getSystemUiVisibility(null, attrs);
final int systemUiVisibility = (sysuiVis | attrs.subtreeSystemUiVisibility);
@@ -3103,26 +3111,30 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
if ((systemUiVisibility & View.SYSTEM_UI_FLAG_LAYOUT_STABLE) != 0) {
if ((fl & FLAG_FULLSCREEN) != 0) {
- contentInset.set(mStableFullscreenLeft, mStableFullscreenTop,
+ outContentInsets.set(mStableFullscreenLeft, mStableFullscreenTop,
availRight - mStableFullscreenRight,
availBottom - mStableFullscreenBottom);
} else {
- contentInset.set(mStableLeft, mStableTop,
+ outContentInsets.set(mStableLeft, mStableTop,
availRight - mStableRight, availBottom - mStableBottom);
}
} else if ((fl & FLAG_FULLSCREEN) != 0 || (fl & FLAG_LAYOUT_IN_OVERSCAN) != 0) {
- contentInset.setEmpty();
+ outContentInsets.setEmpty();
} else if ((systemUiVisibility & (View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)) == 0) {
- contentInset.set(mCurLeft, mCurTop,
+ outContentInsets.set(mCurLeft, mCurTop,
availRight - mCurRight, availBottom - mCurBottom);
} else {
- contentInset.set(mCurLeft, mCurTop,
+ outContentInsets.set(mCurLeft, mCurTop,
availRight - mCurRight, availBottom - mCurBottom);
}
+
+ outStableInsets.set(mStableLeft, mStableTop,
+ availRight - mStableRight, availBottom - mStableBottom);
return;
}
- contentInset.setEmpty();
+ outContentInsets.setEmpty();
+ outStableInsets.setEmpty();
}
/** {@inheritDoc} */
@@ -3989,7 +4001,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
/** {@inheritDoc} */
@Override
- public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs) {
+ public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs,
+ WindowState attached) {
+
if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw="
+ win.isVisibleOrBehindKeyguardLw());
final int fl = PolicyControl.getWindowFlags(win, attrs);
@@ -4028,8 +4042,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final boolean showWhenLocked = (fl & FLAG_SHOW_WHEN_LOCKED) != 0;
final boolean dismissKeyguard = (fl & FLAG_DISMISS_KEYGUARD) != 0;
final boolean secureKeyguard = isKeyguardSecure();
- if (appWindow) {
- final IApplicationToken appToken = win.getAppToken();
+ final IApplicationToken appToken = win.getAppToken();
+
+ // For app windows that are not attached, we decide if all windows in the app they
+ // represent should be hidden or if we should hide the lockscreen. For attached app
+ // windows we defer the decision to the window it is attached to.
+ if (appWindow && attached == null) {
if (showWhenLocked) {
// Remove any previous windows with the same appToken.
mAppsToBeHidden.remove(appToken);
@@ -4789,6 +4807,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return ACTION_PASS_TO_USER;
}
+ // If we have not passed the action up and we are in theater mode without dreaming,
+ // there will be no dream to intercept the touch and wake into ambient. The device should
+ // wake up in this case.
+ if (isTheaterModeEnabled() && (policyFlags & FLAG_WAKE) != 0) {
+ wakeUp(whenNanos / 1000000, mAllowTheaterModeWakeFromMotionWhenNotDreaming);
+ }
+
return 0;
}