Search in sources :

Example 1 with RecentsTvImpl

use of com.android.systemui.recents.tv.RecentsTvImpl in project android_frameworks_base by AOSPA.

the class Recents method start.

@Override
public void start() {
    sDebugFlags = new RecentsDebugFlags(mContext);
    sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
    sTaskLoader = new RecentsTaskLoader(mContext);
    sConfiguration = new RecentsConfiguration(mContext);
    mHandler = new Handler();
    UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
        mImpl = new RecentsTvImpl(mContext);
    } else {
        mImpl = new RecentsImpl(mContext);
    }
    // Check if there is a recents override package
    if ("userdebug".equals(Build.TYPE) || "eng".equals(Build.TYPE)) {
        String cnStr = SystemProperties.get(RECENTS_OVERRIDE_SYSPROP_KEY);
        if (!cnStr.isEmpty()) {
            mOverrideRecentsPackageName = cnStr;
        }
    }
    // Register with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sSystemServicesProxy, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sTaskLoader, EVENT_BUS_PRIORITY);
    // Due to the fact that RecentsActivity is per-user, we need to establish and interface for
    // the system user's Recents component to pass events (like show/hide/toggleRecents) to the
    // secondary user, and vice versa (like visibility change, screen pinning).
    final int processUser = sSystemServicesProxy.getProcessUser();
    if (sSystemServicesProxy.isSystemUser(processUser)) {
        // For the system user, initialize an instance of the interface that we can pass to the
        // secondary user
        mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
    } else {
        // For the secondary user, bind to the primary user's service to get a persistent
        // interface to register its implementation and to later update its state
        registerWithSystemUser();
    }
    putComponent(Recents.class, this);
}
Also used : RecentsTvImpl(com.android.systemui.recents.tv.RecentsTvImpl) UiModeManager(android.app.UiModeManager) Handler(android.os.Handler) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) Point(android.graphics.Point)

Example 2 with RecentsTvImpl

use of com.android.systemui.recents.tv.RecentsTvImpl in project android_frameworks_base by ResurrectionRemix.

the class Recents method start.

@Override
public void start() {
    sDebugFlags = new RecentsDebugFlags(mContext);
    sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
    sTaskLoader = new RecentsTaskLoader(mContext);
    sConfiguration = new RecentsConfiguration(mContext);
    mHandler = new Handler();
    UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
        mImpl = new RecentsTvImpl(mContext);
    } else {
        mImpl = new RecentsImpl(mContext);
    }
    // Check if there is a recents override package
    if ("userdebug".equals(Build.TYPE) || "eng".equals(Build.TYPE)) {
        String cnStr = SystemProperties.get(RECENTS_OVERRIDE_SYSPROP_KEY);
        if (!cnStr.isEmpty()) {
            mOverrideRecentsPackageName = cnStr;
        }
    }
    // Register with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sSystemServicesProxy, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sTaskLoader, EVENT_BUS_PRIORITY);
    // Due to the fact that RecentsActivity is per-user, we need to establish and interface for
    // the system user's Recents component to pass events (like show/hide/toggleRecents) to the
    // secondary user, and vice versa (like visibility change, screen pinning).
    final int processUser = sSystemServicesProxy.getProcessUser();
    if (sSystemServicesProxy.isSystemUser(processUser)) {
        // For the system user, initialize an instance of the interface that we can pass to the
        // secondary user
        mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
    } else {
        // For the secondary user, bind to the primary user's service to get a persistent
        // interface to register its implementation and to later update its state
        registerWithSystemUser();
    }
    putComponent(Recents.class, this);
}
Also used : RecentsTvImpl(com.android.systemui.recents.tv.RecentsTvImpl) UiModeManager(android.app.UiModeManager) Handler(android.os.Handler) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) Point(android.graphics.Point)

Example 3 with RecentsTvImpl

use of com.android.systemui.recents.tv.RecentsTvImpl in project android_frameworks_base by crdroidandroid.

the class Recents method start.

@Override
public void start() {
    sDebugFlags = new RecentsDebugFlags(mContext);
    sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
    sTaskLoader = new RecentsTaskLoader(mContext);
    sConfiguration = new RecentsConfiguration(mContext);
    mHandler = new Handler();
    UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
        mImpl = new RecentsTvImpl(mContext);
    } else {
        mImpl = new RecentsImpl(mContext);
    }
    // Check if there is a recents override package
    if ("userdebug".equals(Build.TYPE) || "eng".equals(Build.TYPE)) {
        String cnStr = SystemProperties.get(RECENTS_OVERRIDE_SYSPROP_KEY);
        if (!cnStr.isEmpty()) {
            mOverrideRecentsPackageName = cnStr;
        }
    }
    // Register with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sSystemServicesProxy, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sTaskLoader, EVENT_BUS_PRIORITY);
    // Due to the fact that RecentsActivity is per-user, we need to establish and interface for
    // the system user's Recents component to pass events (like show/hide/toggleRecents) to the
    // secondary user, and vice versa (like visibility change, screen pinning).
    final int processUser = sSystemServicesProxy.getProcessUser();
    if (sSystemServicesProxy.isSystemUser(processUser)) {
        // For the system user, initialize an instance of the interface that we can pass to the
        // secondary user
        mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
    } else {
        // For the secondary user, bind to the primary user's service to get a persistent
        // interface to register its implementation and to later update its state
        registerWithSystemUser();
    }
    putComponent(Recents.class, this);
}
Also used : RecentsTvImpl(com.android.systemui.recents.tv.RecentsTvImpl) UiModeManager(android.app.UiModeManager) Handler(android.os.Handler) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) Point(android.graphics.Point)

Example 4 with RecentsTvImpl

use of com.android.systemui.recents.tv.RecentsTvImpl in project platform_frameworks_base by android.

the class Recents method start.

@Override
public void start() {
    sDebugFlags = new RecentsDebugFlags(mContext);
    sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
    sTaskLoader = new RecentsTaskLoader(mContext);
    sConfiguration = new RecentsConfiguration(mContext);
    mHandler = new Handler();
    UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
        mImpl = new RecentsTvImpl(mContext);
    } else {
        mImpl = new RecentsImpl(mContext);
    }
    // Check if there is a recents override package
    if ("userdebug".equals(Build.TYPE) || "eng".equals(Build.TYPE)) {
        String cnStr = SystemProperties.get(RECENTS_OVERRIDE_SYSPROP_KEY);
        if (!cnStr.isEmpty()) {
            mOverrideRecentsPackageName = cnStr;
        }
    }
    // Register with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sSystemServicesProxy, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sTaskLoader, EVENT_BUS_PRIORITY);
    // Due to the fact that RecentsActivity is per-user, we need to establish and interface for
    // the system user's Recents component to pass events (like show/hide/toggleRecents) to the
    // secondary user, and vice versa (like visibility change, screen pinning).
    final int processUser = sSystemServicesProxy.getProcessUser();
    if (sSystemServicesProxy.isSystemUser(processUser)) {
        // For the system user, initialize an instance of the interface that we can pass to the
        // secondary user
        mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
    } else {
        // For the secondary user, bind to the primary user's service to get a persistent
        // interface to register its implementation and to later update its state
        registerWithSystemUser();
    }
    putComponent(Recents.class, this);
}
Also used : RecentsTvImpl(com.android.systemui.recents.tv.RecentsTvImpl) UiModeManager(android.app.UiModeManager) Handler(android.os.Handler) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) Point(android.graphics.Point)

Example 5 with RecentsTvImpl

use of com.android.systemui.recents.tv.RecentsTvImpl in project android_frameworks_base by DirtyUnicorns.

the class Recents method start.

@Override
public void start() {
    sDebugFlags = new RecentsDebugFlags(mContext);
    sSystemServicesProxy = SystemServicesProxy.getInstance(mContext);
    sTaskLoader = new RecentsTaskLoader(mContext);
    sConfiguration = new RecentsConfiguration(mContext);
    mHandler = new Handler();
    UiModeManager uiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION) {
        mImpl = new RecentsTvImpl(mContext);
    } else {
        mImpl = new RecentsImpl(mContext);
    }
    // Check if there is a recents override package
    if ("userdebug".equals(Build.TYPE) || "eng".equals(Build.TYPE)) {
        String cnStr = SystemProperties.get(RECENTS_OVERRIDE_SYSPROP_KEY);
        if (!cnStr.isEmpty()) {
            mOverrideRecentsPackageName = cnStr;
        }
    }
    // Register with the event bus
    EventBus.getDefault().register(this, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sSystemServicesProxy, EVENT_BUS_PRIORITY);
    EventBus.getDefault().register(sTaskLoader, EVENT_BUS_PRIORITY);
    // Due to the fact that RecentsActivity is per-user, we need to establish and interface for
    // the system user's Recents component to pass events (like show/hide/toggleRecents) to the
    // secondary user, and vice versa (like visibility change, screen pinning).
    final int processUser = sSystemServicesProxy.getProcessUser();
    if (sSystemServicesProxy.isSystemUser(processUser)) {
        // For the system user, initialize an instance of the interface that we can pass to the
        // secondary user
        mSystemToUserCallbacks = new RecentsSystemUser(mContext, mImpl);
    } else {
        // For the secondary user, bind to the primary user's service to get a persistent
        // interface to register its implementation and to later update its state
        registerWithSystemUser();
    }
    putComponent(Recents.class, this);
}
Also used : RecentsTvImpl(com.android.systemui.recents.tv.RecentsTvImpl) UiModeManager(android.app.UiModeManager) Handler(android.os.Handler) RecentsTaskLoader(com.android.systemui.recents.model.RecentsTaskLoader) Point(android.graphics.Point)

Aggregations

UiModeManager (android.app.UiModeManager)5 Point (android.graphics.Point)5 Handler (android.os.Handler)5 RecentsTaskLoader (com.android.systemui.recents.model.RecentsTaskLoader)5 RecentsTvImpl (com.android.systemui.recents.tv.RecentsTvImpl)5