Search in sources :

Example 1 with SystemUIApplication

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

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 2 with SystemUIApplication

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

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 3 with SystemUIApplication

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

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 4 with SystemUIApplication

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

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 5 with SystemUIApplication

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

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);
    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, mDozeParameters.getPulseOnPickup(), mDozeParameters.getVibrateOnPickup(), DozeLog.PULSE_REASON_SENSOR_PICKUP), new TriggerSensor(findSensorWithType(mDozeParameters.getDoubleTapSensorType()), Settings.Secure.DOZE_PULSE_ON_DOUBLE_TAP, mDozeParameters.getPulseOnPickup(), 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)

Aggregations

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