diff options
Diffstat (limited to 'policy/src/com')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindow.java | 16 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/PhoneWindowManager.java | 83 |
2 files changed, 62 insertions, 37 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index 79859fc..92171c1 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -124,6 +124,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { private static final int CUSTOM_TITLE_COMPATIBLE_FEATURES = DEFAULT_FEATURES | (1 << FEATURE_CUSTOM_TITLE) | (1 << FEATURE_CONTENT_TRANSITIONS) | + (1 << FEATURE_ACTIVITY_TRANSITIONS) | (1 << FEATURE_ACTION_MODE_OVERLAY); private static final Transition USE_DEFAULT_TRANSITION = new TransitionSet(); @@ -2762,12 +2763,14 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { SYSTEM_UI_FLAG_FULLSCREEN, FLAG_TRANSLUCENT_STATUS, mStatusBarColor, mLastTopInset, Gravity.TOP, STATUS_BAR_BACKGROUND_TRANSITION_NAME, - com.android.internal.R.id.statusBarBackground); + com.android.internal.R.id.statusBarBackground, + (getAttributes().flags & FLAG_FULLSCREEN) != 0); mNavigationColorView = updateColorViewInt(mNavigationColorView, SYSTEM_UI_FLAG_HIDE_NAVIGATION, FLAG_TRANSLUCENT_NAVIGATION, mNavigationBarColor, mLastBottomInset, Gravity.BOTTOM, NAVIGATION_BAR_BACKGROUND_TRANSITION_NAME, - com.android.internal.R.id.navigationBarBackground); + com.android.internal.R.id.navigationBarBackground, + false /* hiddenByWindowFlag */); } WindowManager.LayoutParams attrs = getAttributes(); @@ -2807,8 +2810,10 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } private View updateColorViewInt(View view, int systemUiHideFlag, int translucentFlag, - int color, int height, int verticalGravity, String transitionName, int id) { + int color, int height, int verticalGravity, String transitionName, int id, + boolean hiddenByWindowFlag) { boolean show = height > 0 && (mLastSystemUiVisibility & systemUiHideFlag) == 0 + && !hiddenByWindowFlag && (getAttributes().flags & translucentFlag) == 0 && (color & Color.BLACK) != 0 && (getAttributes().flags & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0; @@ -3241,6 +3246,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (a.getBoolean(R.styleable.Window_windowContentTransitions, false)) { requestFeature(FEATURE_CONTENT_TRANSITIONS); } + if (a.getBoolean(R.styleable.Window_windowActivityTransitions, false)) { + requestFeature(FEATURE_ACTIVITY_TRANSITIONS); + } final WindowManager windowService = (WindowManager) getContext().getSystemService( Context.WINDOW_SERVICE); @@ -3551,7 +3559,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { // Only inflate or create a new TransitionManager if the caller hasn't // already set a custom one. - if (hasFeature(FEATURE_CONTENT_TRANSITIONS)) { + if (hasFeature(FEATURE_ACTIVITY_TRANSITIONS)) { if (mTransitionManager == null) { final int transitionRes = getWindowStyle().getResourceId( R.styleable.Window_windowContentTransitionManager, diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index d776aeb..4713a98 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -439,6 +439,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { WindowState mTopFullscreenOpaqueWindowState; HashSet<IApplicationToken> mAppsToBeHidden = new HashSet<IApplicationToken>(); + HashSet<IApplicationToken> mAppsThatDismissKeyguard = new HashSet<IApplicationToken>(); boolean mTopIsFullscreen; boolean mForceStatusBar; boolean mForceStatusBarFromKeyguard; @@ -1757,6 +1758,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + @Override + public WindowState getWinShowWhenLockedLw() { + return mWinShowWhenLocked; + } + /** {@inheritDoc} */ @Override public View addStartingWindow(IBinder appToken, String packageName, int theme, @@ -1825,8 +1831,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { params.packageName = packageName; params.windowAnimations = win.getWindowStyle().getResourceId( com.android.internal.R.styleable.Window_windowAnimationStyle, 0); - params.privateFlags |= - WindowManager.LayoutParams.PRIVATE_FLAG_FAKE_HARDWARE_ACCELERATED; params.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS; if (!compatInfo.supportsScreen()) { @@ -3532,13 +3536,16 @@ public class PhoneWindowManager implements WindowManagerPolicy { pf.bottom = df.bottom = of.bottom = cf.bottom = mOverscanScreenTop + mOverscanScreenHeight; } else if (attrs.type == TYPE_WALLPAPER) { - // The wallpaper also has Real Ultimate Power. - pf.left = df.left = of.left = cf.left = mUnrestrictedScreenLeft; - pf.top = df.top = of.top = cf.top = mUnrestrictedScreenTop; - pf.right = df.right = of.right = cf.right - = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth; - pf.bottom = df.bottom = of.bottom = cf.bottom - = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; + // The wallpaper also has Real Ultimate Power, but we want to tell + // it about the overscan area. + pf.left = df.left = mOverscanScreenLeft; + pf.top = df.top = mOverscanScreenTop; + pf.right = df.right = mOverscanScreenLeft + mOverscanScreenWidth; + pf.bottom = df.bottom = mOverscanScreenTop + mOverscanScreenHeight; + of.left = cf.left = mUnrestrictedScreenLeft; + of.top = cf.top = mUnrestrictedScreenTop; + of.right = cf.right = mUnrestrictedScreenLeft + mUnrestrictedScreenWidth; + of.bottom = cf.bottom = mUnrestrictedScreenTop + mUnrestrictedScreenHeight; } else if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) { @@ -3652,9 +3659,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { // TYPE_SYSTEM_ERROR is above the NavigationBar so it can't be allowed to extend over it. if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && attrs.type != TYPE_SYSTEM_ERROR) { - df.left = df.top = of.left = of.top = cf.left = cf.top = vf.left = vf.top = -10000; - df.right = df.bottom = of.right = of.bottom = cf.right = cf.bottom - = vf.right = vf.bottom = 10000; + df.left = df.top = -10000; + df.right = df.bottom = 10000; + if (attrs.type != TYPE_WALLPAPER) { + of.left = of.top = cf.left = cf.top = vf.left = vf.top = -10000; + of.right = of.bottom = cf.right = cf.bottom = vf.right = vf.bottom = 10000; + } } if (DEBUG_LAYOUT) Slog.v(TAG, "Compute frame " + attrs.getTitle() @@ -3746,6 +3756,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) { mTopFullscreenOpaqueWindowState = null; mAppsToBeHidden.clear(); + mAppsThatDismissKeyguard.clear(); mForceStatusBar = false; mForceStatusBarFromKeyguard = false; mForcingShowNavBar = false; @@ -3786,7 +3797,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mShowingLockscreen = true; } boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW - && attrs.type <= LAST_APPLICATION_WINDOW; + && attrs.type < FIRST_SYSTEM_WINDOW; if (attrs.type == TYPE_DREAM) { // If the lockscreen was showing when the dream started then wait // for the dream to draw before hiding the lockscreen. @@ -3801,38 +3812,44 @@ public class PhoneWindowManager implements WindowManagerPolicy { final boolean dismissKeyguard = (fl & FLAG_DISMISS_KEYGUARD) != 0; final boolean secureKeyguard = isKeyguardSecure(); if (appWindow) { - if (showWhenLocked || (dismissKeyguard && !secureKeyguard)) { + final IApplicationToken appToken = win.getAppToken(); + if (showWhenLocked) { // Remove any previous windows with the same appToken. - mAppsToBeHidden.remove(win.getAppToken()); - if (mAppsToBeHidden.isEmpty() && showWhenLocked && - isKeyguardSecureIncludingHidden()) { + mAppsToBeHidden.remove(appToken); + mAppsThatDismissKeyguard.remove(appToken); + if (mAppsToBeHidden.isEmpty() && isKeyguardSecureIncludingHidden()) { mWinShowWhenLocked = win; mHideLockScreen = true; mForceStatusBarFromKeyguard = false; } + } else if (dismissKeyguard) { + if (secureKeyguard) { + mAppsToBeHidden.add(appToken); + } else { + mAppsToBeHidden.remove(appToken); + } + mAppsThatDismissKeyguard.add(appToken); } else { - mAppsToBeHidden.add(win.getAppToken()); + mAppsToBeHidden.add(appToken); } if (attrs.x == 0 && attrs.y == 0 && attrs.width == WindowManager.LayoutParams.MATCH_PARENT && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) { if (DEBUG_LAYOUT) Slog.v(TAG, "Fullscreen window: " + win); mTopFullscreenOpaqueWindowState = win; - if (mAppsToBeHidden.isEmpty()) { - if (showWhenLocked) { - if (DEBUG_LAYOUT) Slog.v(TAG, - "Setting mHideLockScreen to true by win " + win); - mHideLockScreen = true; - mForceStatusBarFromKeyguard = false; - } - if (dismissKeyguard && mDismissKeyguard == DISMISS_KEYGUARD_NONE) { - if (DEBUG_LAYOUT) Slog.v(TAG, - "Setting mDismissKeyguard true by win " + win); - mDismissKeyguard = mWinDismissingKeyguard == win ? - DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START; - mWinDismissingKeyguard = win; - mForceStatusBarFromKeyguard = mShowingLockscreen && secureKeyguard; - } + if (!mAppsThatDismissKeyguard.isEmpty() && + mDismissKeyguard == DISMISS_KEYGUARD_NONE) { + if (DEBUG_LAYOUT) Slog.v(TAG, + "Setting mDismissKeyguard true by win " + win); + mDismissKeyguard = mWinDismissingKeyguard == win ? + DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START; + mWinDismissingKeyguard = win; + mForceStatusBarFromKeyguard = mShowingLockscreen && secureKeyguard; + } else if (mAppsToBeHidden.isEmpty() && showWhenLocked) { + if (DEBUG_LAYOUT) Slog.v(TAG, + "Setting mHideLockScreen to true by win " + win); + mHideLockScreen = true; + mForceStatusBarFromKeyguard = false; } if ((fl & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) { mAllowLockscreenWhenOn = true; |