Search in sources :

Example 6 with SystemUIApplication

use of com.android.systemui.SystemUIApplication in project platform_frameworks_base by android.

the class TunerService method get.

public static TunerService get(Context context) {
    TunerService service = null;
    if (context.getApplicationContext() instanceof SystemUIApplication) {
        SystemUIApplication sysUi = (SystemUIApplication) context.getApplicationContext();
        service = sysUi.getComponent(TunerService.class);
    }
    if (service == null) {
        // Can't get it as a component, must in the tuner, lets just create one for now.
        return getStaticService(context);
    }
    return service;
}
Also used : SystemUIApplication(com.android.systemui.SystemUIApplication)

Example 7 with SystemUIApplication

use of com.android.systemui.SystemUIApplication in project platform_frameworks_base by android.

the class RecentsSystemUserService method onBind.

@Override
public IBinder onBind(Intent intent) {
    SystemUIApplication app = (SystemUIApplication) getApplication();
    Recents recents = app.getComponent(Recents.class);
    if (DEBUG) {
        Log.d(TAG, "onBind: " + recents);
    }
    if (recents != null) {
        return recents.getSystemUserCallbacks();
    }
    return null;
}
Also used : SystemUIApplication(com.android.systemui.SystemUIApplication)

Example 8 with SystemUIApplication

use of com.android.systemui.SystemUIApplication in project platform_frameworks_base by android.

the class RecentsImpl method onStartScreenPinning.

/**
     * This is only called from the system user's Recents.  Secondary users will instead proxy their
     * visibility change events through to the system user via
     * {@link Recents#onBusEvent(ScreenPinningRequestEvent)}.
     */
public void onStartScreenPinning(Context context, int taskId) {
    SystemUIApplication app = (SystemUIApplication) context;
    PhoneStatusBar statusBar = app.getComponent(PhoneStatusBar.class);
    if (statusBar != null) {
        statusBar.showScreenPinningRequest(taskId, false);
    }
}
Also used : SystemUIApplication(com.android.systemui.SystemUIApplication) PhoneStatusBar(com.android.systemui.statusbar.phone.PhoneStatusBar)

Example 9 with SystemUIApplication

use of com.android.systemui.SystemUIApplication in project android_frameworks_base by crdroidandroid.

the class DozeService method onCreate.

@Override
public void onCreate() {
    if (DEBUG)
        Log.d(mTag, "onCreate");
    super.onCreate();
    if (getApplication() instanceof SystemUIApplication) {
        final SystemUIApplication app = (SystemUIApplication) getApplication();
        mHost = app.getComponent(DozeHost.class);
    }
    if (mHost == null)
        Log.w(TAG, "No doze service host found.");
    setWindowless(true);
    mSensorManager = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
    mConfig = new AmbientDisplayConfiguration(mContext);
    mSensors = new TriggerSensor[] { new TriggerSensor(mSensorManager.getDefaultSensor(Sensor.TYPE_SIGNIFICANT_MOTION), null, /* setting */
    mDozeParameters.getPulseOnSigMotion(), mDozeParameters.getVibrateOnSigMotion(), DozeLog.PULSE_REASON_SENSOR_SIGMOTION), mPickupSensor = new TriggerSensor(mSensorManager.getDefaultSensor(Sensor.TYPE_PICK_UP_GESTURE), Settings.Secure.DOZE_PULSE_ON_PICK_UP, mConfig.pulseOnPickupAvailable(), mDozeParameters.getVibrateOnPickup(), DozeLog.PULSE_REASON_SENSOR_PICKUP), new TriggerSensor(findSensorWithType(mConfig.doubleTapSensorType()), Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP, true, mDozeParameters.getVibrateOnPickup(), DozeLog.PULSE_REASON_SENSOR_DOUBLE_TAP) };
    mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
    mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
    mWakeLock.setReferenceCounted(true);
    mDisplayStateSupported = mDozeParameters.getDisplayStateSupported();
    mUiModeManager = (UiModeManager) mContext.getSystemService(Context.UI_MODE_SERVICE);
    turnDisplayOff();
}
Also used : SystemUIApplication(com.android.systemui.SystemUIApplication) AmbientDisplayConfiguration(com.android.internal.hardware.AmbientDisplayConfiguration)

Example 10 with SystemUIApplication

use of com.android.systemui.SystemUIApplication in project android_frameworks_base by crdroidandroid.

the class RecentsImpl method onStartScreenPinning.

/**
     * This is only called from the system user's Recents.  Secondary users will instead proxy their
     * visibility change events through to the system user via
     * {@link Recents#onBusEvent(ScreenPinningRequestEvent)}.
     */
public void onStartScreenPinning(Context context, int taskId) {
    SystemUIApplication app = (SystemUIApplication) context;
    PhoneStatusBar statusBar = app.getComponent(PhoneStatusBar.class);
    if (statusBar != null) {
        statusBar.showScreenPinningRequest(taskId, false);
    }
}
Also used : SystemUIApplication(com.android.systemui.SystemUIApplication) PhoneStatusBar(com.android.systemui.statusbar.phone.PhoneStatusBar)

Aggregations

SystemUIApplication (com.android.systemui.SystemUIApplication)20 PhoneStatusBar (com.android.systemui.statusbar.phone.PhoneStatusBar)5 AmbientDisplayConfiguration (com.android.internal.hardware.AmbientDisplayConfiguration)4