Search in sources :

Example 26 with SystemServicesProxy

use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by ResurrectionRemix.

the class RecentsActivity method onCreate.

/** Called with the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFinishedOnStartup = false;
    // In the case that the activity starts up before the Recents component has initialized
    // (usually when debugging/pushing the SysUI apk), just finish this activity.
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp == null) {
        mFinishedOnStartup = true;
        finish();
        return;
    }
    // Register this activity with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    // Initialize the package monitor
    mPackageMonitor = new RecentsPackageMonitor();
    mPackageMonitor.register(this);
    // Set the Recents layout
    setContentView(R.layout.recents);
    takeKeyEvents(true);
    mRecentsView = (RecentsView) findViewById(R.id.recents_view);
    mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
    mScrimViews = new SystemBarScrimViews(this);
    getWindow().getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY;
    Configuration appConfiguration = Utilities.getAppConfiguration(this);
    mLastDeviceOrientation = appConfiguration.orientation;
    mLastDisplayDensity = appConfiguration.densityDpi;
    mFocusTimerDuration = getResources().getInteger(R.integer.recents_auto_advance_duration);
    mIterateTrigger = new DozeTrigger(mFocusTimerDuration, new Runnable() {

        @Override
        public void run() {
            dismissRecentsToFocusedTask(MetricsEvent.OVERVIEW_SELECT_TIMEOUT);
        }
    });
    // Set the window background
    getWindow().setBackgroundDrawable(mRecentsView.getBackgroundScrim());
    // Create the home intent runnable
    mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
    mHomeIntent.addCategory(Intent.CATEGORY_HOME);
    mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
    // Register the broadcast receiver to handle messages when the screen is turned off
    IntentFilter filter = new IntentFilter();
    filter.addAction(Intent.ACTION_SCREEN_OFF);
    filter.addAction(Intent.ACTION_TIME_CHANGED);
    registerReceiver(mSystemBroadcastReceiver, filter);
    getWindow().addPrivateFlags(LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION);
    // Reload the stack view
    reloadStackView();
    try {
        RecentsView mRecentsView = (RecentsView) getObjectField(this, "mRecentsView");
        mRecentsActivityRootView = (FrameLayout) mRecentsView.getParent();
        Bitmap lastBlurredBitmap = BlurTask.getLastBlurredBitmap();
        if ((mBlurredRecentAppsEnabled) && (lastBlurredBitmap != null)) {
            BitmapDrawable blurredDrawable = new BitmapDrawable(lastBlurredBitmap);
            blurredDrawable.setColorFilter(mColorFilter);
            mRecentsActivityRootView.setBackground(blurredDrawable);
        }
    } catch (Exception e) {
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) IntentFilter(android.content.IntentFilter) SystemBarScrimViews(com.android.systemui.recents.views.SystemBarScrimViews) Configuration(android.content.res.Configuration) DozeTrigger(com.android.systemui.recents.misc.DozeTrigger) RecentsPackageMonitor(com.android.systemui.recents.model.RecentsPackageMonitor) RecentsView(com.android.systemui.recents.views.RecentsView) Intent(android.content.Intent) BitmapDrawable(android.graphics.drawable.BitmapDrawable)

Example 27 with SystemServicesProxy

use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by ResurrectionRemix.

the class RecentsActivity method onBusEvent.

public final void onBusEvent(AllTaskViewsDismissedEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (ssp.hasDockedTask()) {
        mRecentsView.showEmptyView(event.msgResId);
    } else {
        // Just go straight home (no animation necessary because there are no more task views)
        dismissRecentsToHome(false);
    }
    // Keep track of all-deletions
    MetricsLogger.count(this, "overview_task_all_dismissed", 1);
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy)

Example 28 with SystemServicesProxy

use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by ResurrectionRemix.

the class RecentsImpl method drawThumbnailTransitionBitmap.

/**
     * Draws the header of a task used for the window animation into a bitmap.
     */
private Bitmap drawThumbnailTransitionBitmap(Task toTask, TaskViewTransform toTransform, Bitmap thumbnail) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    if (toTransform != null && toTask.key != null) {
        synchronized (mHeaderBarLock) {
            boolean disabledInSafeMode = !toTask.isSystemApp && ssp.isInSafeMode();
            mHeaderBar.onTaskViewSizeChanged((int) toTransform.rect.width(), (int) toTransform.rect.height());
            if (RecentsDebugFlags.Static.EnableTransitionThumbnailDebugMode) {
                thumbnail.eraseColor(0xFFff0000);
            } else {
                thumbnail.eraseColor(0);
                Canvas c = new Canvas(thumbnail);
                // Workaround for b/27815919, reset the callback so that we do not trigger an
                // invalidate on the header bar as a result of updating the icon
                Drawable icon = mHeaderBar.getIconView().getDrawable();
                if (icon != null) {
                    icon.setCallback(null);
                }
                mHeaderBar.bindToTask(toTask, false, /* touchExplorationEnabled */
                disabledInSafeMode);
                mHeaderBar.onTaskDataLoaded();
                mHeaderBar.setDimAlpha(toTransform.dimAlpha);
                mHeaderBar.draw(c);
                c.setBitmap(null);
            }
        }
        return thumbnail.createAshmemBitmap();
    }
    return null;
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) Canvas(android.graphics.Canvas) Drawable(android.graphics.drawable.Drawable)

Example 29 with SystemServicesProxy

use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by ResurrectionRemix.

the class RecentsActivity method onBusEvent.

public final void onBusEvent(DeleteTaskDataEvent event) {
    // Remove any stored data from the loader
    RecentsTaskLoader loader = Recents.getTaskLoader();
    loader.deleteTaskData(event.task, false);
    // Remove the task from activity manager
    SystemServicesProxy ssp = Recents.getSystemServices();
    ssp.removeTask(event.task.key.id);
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader)

Example 30 with SystemServicesProxy

use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by ResurrectionRemix.

the class RecentsImpl method dockTopTask.

public void dockTopTask(int topTaskId, int dragMode, int stackCreateMode, Rect initialBounds) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    // the resize mode already.
    if (ssp.moveTaskToDockedStack(topTaskId, stackCreateMode, initialBounds)) {
        EventBus.getDefault().send(new DockedTopTaskEvent(dragMode, initialBounds));
        showRecents(false, /* triggeredFromAltTab */
        dragMode == NavigationBarGestureHelper.DRAG_MODE_RECENTS, false, /* animate */
        true, /* launchedWhileDockingTask*/
        false, /* fromHome */
        DividerView.INVALID_RECENTS_GROW_TARGET);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) DockedTopTaskEvent(com.android.systemui.recents.events.activity.DockedTopTaskEvent)

Aggregations

SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)243 Rect (android.graphics.Rect)45 ActivityManager (android.app.ActivityManager)35 ActivityInfo (android.content.pm.ActivityInfo)34 RecentsTaskLoader (com.android.systemui.recents.model.RecentsTaskLoader)30 TaskStack (com.android.systemui.recents.model.TaskStack)30 Task (com.android.systemui.recents.model.Task)25 Drawable (android.graphics.drawable.Drawable)19 Point (android.graphics.Point)16 ActivityOptions (android.app.ActivityOptions)15 ComponentName (android.content.ComponentName)15 RemoteException (android.os.RemoteException)15 MutableBoolean (android.util.MutableBoolean)15 RecentsActivityLaunchState (com.android.systemui.recents.RecentsActivityLaunchState)15 RecentsConfiguration (com.android.systemui.recents.RecentsConfiguration)15 Bitmap (android.graphics.Bitmap)14 ArrayList (java.util.ArrayList)14 BitmapDrawable (android.graphics.drawable.BitmapDrawable)12 ActivityNotFoundException (android.content.ActivityNotFoundException)10 Intent (android.content.Intent)10