Search in sources :

Example 16 with StatusBarManagerInternal

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

the class GestureLauncherService method handleCameraLaunchGesture.

/**
     * @return true if camera was launched, false otherwise.
     */
private boolean handleCameraLaunchGesture(boolean useWakelock, int source) {
    boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
    if (!userSetupComplete) {
        if (DBG)
            Slog.d(TAG, String.format("userSetupComplete = %s, ignoring camera launch gesture.", userSetupComplete));
        return false;
    }
    if (DBG)
        Slog.d(TAG, String.format("userSetupComplete = %s, performing camera launch gesture.", userSetupComplete));
    if (useWakelock) {
        // Make sure we don't sleep too early
        mWakeLock.acquire(500L);
    }
    StatusBarManagerInternal service = LocalServices.getService(StatusBarManagerInternal.class);
    service.onCameraLaunchGestureDetected(source);
    return true;
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal)

Example 17 with StatusBarManagerInternal

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

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 18 with StatusBarManagerInternal

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

the class PhoneWindowManager method launchAssistAction.

private void launchAssistAction(String hint, int deviceId) {
    sendCloseSystemWindows(SYSTEM_DIALOG_REASON_ASSIST);
    if (!isUserSetupComplete()) {
        // Disable opening assist window during setup
        return;
    }
    Bundle args = null;
    if (deviceId > Integer.MIN_VALUE) {
        args = new Bundle();
        args.putInt(Intent.EXTRA_ASSIST_INPUT_DEVICE_ID, deviceId);
    }
    if ((mContext.getResources().getConfiguration().uiMode & Configuration.UI_MODE_TYPE_MASK) == Configuration.UI_MODE_TYPE_TELEVISION) {
        // On TV, use legacy handling until assistants are implemented in the proper way.
        ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)).launchLegacyAssist(hint, UserHandle.myUserId(), args);
    } else {
        if (hint != null) {
            if (args == null) {
                args = new Bundle();
            }
            args.putBoolean(hint, true);
        }
        StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
        if (statusbar != null) {
            statusbar.startAssist(args);
        }
    }
}
Also used : StatusBarManagerInternal(com.android.server.statusbar.StatusBarManagerInternal) SearchManager(android.app.SearchManager) Bundle(android.os.Bundle)

Example 19 with StatusBarManagerInternal

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

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)

Example 20 with StatusBarManagerInternal

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

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 = PolicyControl.getSystemUiVisibility(win, null) & ~mResettingSystemUiFlags & ~mForceClearedSystemUiFlags;
    if (mForcingShowNavBar && win.getSurfaceLayer() < mForcingShowNavBarLayer) {
        tmpVisibility &= ~PolicyControl.adjustClearableFlags(win, View.SYSTEM_UI_CLEARABLE_FLAGS);
    }
    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);
    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)

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