Project

General

Profile

Issue #1227 ยป 0001-Show-the-keyguard-if-unsecure-window-on-top.patch

patch - Wolfgang Wiedmeyer, 09/30/2015 02:40 PM

View differences:

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
474 474
    static final Rect mTmpNavigationFrame = new Rect();
475 475
    
476 476
    WindowState mTopFullscreenOpaqueWindowState;
477
    boolean mHideWindowBehindKeyguard;
477 478
    boolean mTopIsFullscreen;
478 479
    boolean mForceStatusBar;
479 480
    boolean mForceStatusBarFromKeyguard;
......
3456 3457
    @Override
3457 3458
    public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) {
3458 3459
        mTopFullscreenOpaqueWindowState = null;
3460
        mHideWindowBehindKeyguard = false;
3459 3461
        mForceStatusBar = false;
3460 3462
        mForceStatusBarFromKeyguard = false;
3461 3463
        mForcingShowNavBar = false;
......
3493 3495
            if (attrs.type == TYPE_KEYGUARD) {
3494 3496
                mShowingLockscreen = true;
3495 3497
            }
3496
            boolean applyWindow = attrs.type >= FIRST_APPLICATION_WINDOW
3498
            boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW
3497 3499
                    && attrs.type <= LAST_APPLICATION_WINDOW;
3498 3500
            if (attrs.type == TYPE_DREAM) {
3499 3501
                // If the lockscreen was showing when the dream started then wait
......
3501 3503
                if (!mDreamingLockscreen
3502 3504
                        || (win.isVisibleLw() && win.hasDrawnLw())) {
3503 3505
                    mShowingDream = true;
3504
                    applyWindow = true;
3506
                    appWindow = true;
3505 3507
                }
3506 3508
            }
3507
            if (applyWindow
3508
                    && attrs.x == 0 && attrs.y == 0
3509
                    && attrs.width == WindowManager.LayoutParams.MATCH_PARENT
3510
                    && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
3511
                if (DEBUG_LAYOUT) Log.v(TAG, "Fullscreen window: " + win);
3512
                mTopFullscreenOpaqueWindowState = win;
3513
                if ((attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0) {
3514
                    if (DEBUG_LAYOUT) Log.v(TAG, "Setting mHideLockScreen to true by win " + win);
3515
                    mHideLockScreen = true;
3516
                    mForceStatusBarFromKeyguard = false;
3517
                }
3518
                if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0
3519
                        && mDismissKeyguard == DISMISS_KEYGUARD_NONE) {
3520
                    if (DEBUG_LAYOUT) Log.v(TAG, "Setting mDismissKeyguard to true by win " + win);
3521
                    mDismissKeyguard = mWinDismissingKeyguard == win ?
3522
                            DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START;
3523
                    mWinDismissingKeyguard = win;
3524
                    mForceStatusBarFromKeyguard = false;
3525
                }
3526
                if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
3527
                    mAllowLockscreenWhenOn = true;
3509

  
3510
            final boolean showWhenLocked = (attrs.flags & FLAG_SHOW_WHEN_LOCKED) != 0;
3511
            if (appWindow) {
3512
                if (attrs.x == 0 && attrs.y == 0
3513
                        && attrs.width == WindowManager.LayoutParams.MATCH_PARENT
3514
                        && attrs.height == WindowManager.LayoutParams.MATCH_PARENT) {
3515
                    if (DEBUG_LAYOUT) Slog.v(TAG, "Fullscreen window: " + win);
3516
                    mTopFullscreenOpaqueWindowState = win;
3517
                    if (!mHideWindowBehindKeyguard) {
3518
                        if (showWhenLocked) {
3519
                            if (DEBUG_LAYOUT) Slog.v(TAG, "Setting mHideLockScreen to true by win " + win);
3520
                            mHideLockScreen = true;
3521
                            mForceStatusBarFromKeyguard = false;
3522
                        }
3523
                        if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0
3524
                                && mDismissKeyguard == DISMISS_KEYGUARD_NONE) {
3525
                            if (DEBUG_LAYOUT) Slog.v(TAG, "Setting mDismissKeyguard true by win " + win);
3526
                            mDismissKeyguard = mWinDismissingKeyguard == win ?
3527
                                    DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START;
3528
                            mWinDismissingKeyguard = win;
3529
                            mForceStatusBarFromKeyguard = false;
3530
                        }
3531
                    }
3532
                    if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
3533
                        mAllowLockscreenWhenOn = true;
3534
                    }
3535
                } else if (!showWhenLocked) {
3536
                    mHideWindowBehindKeyguard = true;
3528 3537
                }
3529 3538
            }
3530 3539
        }
......
3606 3615
        if (mKeyguard != null) {
3607 3616
            if (localLOGV) Log.v(TAG, "finishPostLayoutPolicyLw: mHideKeyguard="
3608 3617
                    + mHideLockScreen);
3609
            if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !mKeyguardMediator.isSecure()) {
3618
            if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !isKeyguardSecure()) {
3610 3619
                if (mKeyguard.hideLw(true)) {
3611 3620
                    changes |= FINISH_LAYOUT_REDO_LAYOUT
3612 3621
                            | FINISH_LAYOUT_REDO_CONFIG
    (1-1/1)