Search in sources :

Example 6 with StatusBarManagerInternal

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

the class PhoneWindowManager method preloadRecentApps.

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

Example 7 with StatusBarManagerInternal

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

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

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

the class PhoneWindowManager method showRecentApps.

private void showRecentApps(boolean triggeredFromAltTab, boolean fromHome) {
    if (mOmniSwitchRecents == 1) {
        if (fromHome) {
            OmniSwitchConstants.restoreHomeStack(mContext, UserHandle.CURRENT);
        } else {
            OmniSwitchConstants.toggleOmniSwitchRecents(mContext, UserHandle.CURRENT);
        }
    } else {
        // 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 9 with StatusBarManagerInternal

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

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

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

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)

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