Search in sources :

Example 21 with StatusBarManagerInternal

use of com.android.server.statusbar.StatusBarManagerInternal in project platform_frameworks_base by android.

the class PhoneWindowManager method showRecentApps.

private void showRecentApps(boolean triggeredFromAltTab, boolean fromHome) {
    // preloading no longer needs to be canceled
    mPreloadedRecentApps = false;
    StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
    if (statusbar != null) {
        statusbar.showRecentApps(triggeredFromAltTab, fromHome);
    }
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Example 22 with StatusBarManagerInternal

use of com.android.server.statusbar.StatusBarManagerInternal in project android_frameworks_base by DirtyUnicorns.

the class PhoneWindowManager method hideRecentApps.

private void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHome) {
    // preloading no longer needs to be canceled
    mPreloadedRecentApps = false;
    StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
    if (statusbar != null) {
        statusbar.hideRecentApps(triggeredFromAltTab, triggeredFromHome);
    }
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Example 23 with StatusBarManagerInternal

use of com.android.server.statusbar.StatusBarManagerInternal in project android_frameworks_base by DirtyUnicorns.

the class PhoneWindowManager method toggleRecentApps.

private void toggleRecentApps() {
    // preloading no longer needs to be canceled
    mPreloadedRecentApps = false;
    StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
    if (statusbar != null) {
        statusbar.toggleRecentApps();
    }
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Example 24 with StatusBarManagerInternal

use of com.android.server.statusbar.StatusBarManagerInternal in project android_frameworks_base by DirtyUnicorns.

the class PhoneWindowManager method updateSystemUiVisibilityLw.

private int updateSystemUiVisibilityLw() {
    // If there is no window focused, there will be nobody to handle the events
    // anyway, so just hang on in whatever state we're in until things settle down.
    WindowState winCandidate = mFocusedWindow != null ? mFocusedWindow : mTopFullscreenOpaqueWindowState;
    if (winCandidate == null) {
        return 0;
    }
    if (winCandidate.getAttrs().token == mImmersiveModeConfirmation.getWindowToken()) {
        // The immersive mode confirmation should never affect the system bar visibility,
        // otherwise it will unhide the navigation bar and hide itself.
        winCandidate = isStatusBarKeyguard() ? mStatusBar : mTopFullscreenOpaqueWindowState;
        if (winCandidate == null) {
            return 0;
        }
    }
    final WindowState win = winCandidate;
    if ((win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 && mHideLockScreen == true) {
        // will quickly lose focus once it correctly gets hidden.
        return 0;
    }
    int tmpVisibility = WindowManagerPolicyControl.getSystemUiVisibility(win, null) & ~mResettingSystemUiFlags & ~mForceClearedSystemUiFlags;
    boolean wasCleared = mClearedBecauseOfForceShow;
    if (mForcingShowNavBar && win.getSurfaceLayer() < mForcingShowNavBarLayer) {
        tmpVisibility &= ~WindowManagerPolicyControl.adjustClearableFlags(win, View.SYSTEM_UI_CLEARABLE_FLAGS);
        mClearedBecauseOfForceShow = true;
    } else {
        mClearedBecauseOfForceShow = false;
    }
    // transient state have more priority than translucent (why?) and cause bad UX
    if (wasCleared && !mClearedBecauseOfForceShow && (tmpVisibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0) {
        mNavigationBarController.showTransient();
        tmpVisibility |= View.NAVIGATION_BAR_TRANSIENT;
        mWindowManagerFuncs.addSystemUIVisibilityFlag(View.NAVIGATION_BAR_TRANSIENT);
    }
    final int fullscreenVisibility = updateLightStatusBarLw(0, /* vis */
    mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState);
    final int dockedVisibility = updateLightStatusBarLw(0, /* vis */
    mTopDockedOpaqueWindowState, mTopDockedOpaqueOrDimmingWindowState);
    mWindowManagerFuncs.getStackBounds(HOME_STACK_ID, mNonDockedStackBounds);
    mWindowManagerFuncs.getStackBounds(DOCKED_STACK_ID, mDockedStackBounds);
    boolean topWindowWasKeyguard = mTopWindowIsKeyguard;
    mTopWindowIsKeyguard = (win.getAttrs().privateFlags & PRIVATE_FLAG_KEYGUARD) != 0;
    if (topWindowWasKeyguard && !mTopWindowIsKeyguard && (tmpVisibility & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
        mStatusBarController.showTransient();
        tmpVisibility |= View.STATUS_BAR_TRANSIENT;
        mWindowManagerFuncs.addSystemUIVisibilityFlag(View.STATUS_BAR_TRANSIENT);
    }
    tmpVisibility = updateLightStatusBarLw(tmpVisibility, mTopFullscreenOpaqueWindowState, mTopFullscreenOpaqueOrDimmingWindowState);
    final int visibility = updateSystemBarsLw(win, mLastSystemUiFlags, tmpVisibility);
    final int diff = visibility ^ mLastSystemUiFlags;
    final int fullscreenDiff = fullscreenVisibility ^ mLastFullscreenStackSysUiFlags;
    final int dockedDiff = dockedVisibility ^ mLastDockedStackSysUiFlags;
    final boolean needsMenu = win.getNeedsMenuLw(mTopFullscreenOpaqueWindowState);
    if (diff == 0 && fullscreenDiff == 0 && dockedDiff == 0 && mLastFocusNeedsMenu == needsMenu && mFocusedApp == win.getAppToken() && mLastNonDockedStackBounds.equals(mNonDockedStackBounds) && mLastDockedStackBounds.equals(mDockedStackBounds)) {
        return 0;
    }
    mLastSystemUiFlags = visibility;
    mLastFullscreenStackSysUiFlags = fullscreenVisibility;
    mLastDockedStackSysUiFlags = dockedVisibility;
    mLastFocusNeedsMenu = needsMenu;
    mFocusedApp = win.getAppToken();
    final Rect fullscreenStackBounds = new Rect(mNonDockedStackBounds);
    final Rect dockedStackBounds = new Rect(mDockedStackBounds);
    mHandler.post(new Runnable() {

        @Override
        public void run() {
            StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
            if (statusbar != null) {
                statusbar.setSystemUiVisibility(visibility, fullscreenVisibility, dockedVisibility, 0xffffffff, fullscreenStackBounds, dockedStackBounds, win.toString());
                statusbar.topAppWindowChanged(needsMenu);
            }
        }
    });
    return diff;
}
Also used : Rect(android.graphics.Rect) StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Example 25 with StatusBarManagerInternal

use of com.android.server.statusbar.StatusBarManagerInternal in project android_frameworks_base by DirtyUnicorns.

the class PhoneWindowManager method cancelPreloadRecentApps.

private void cancelPreloadRecentApps() {
    if (mPreloadedRecentApps) {
        mPreloadedRecentApps = false;
        StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
        if (statusbar != null) {
            statusbar.cancelPreloadRecentApps();
        }
    }
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Aggregations

StatusBarManagerInternal (com.android.server.statusbar.StatusBarManagerInternal)31 SearchManager (android.app.SearchManager)3 Rect (android.graphics.Rect)3 Bundle (android.os.Bundle)3 Point (android.graphics.Point)2 Intent (android.content.Intent)1 RecognizerIntent (android.speech.RecognizerIntent)1