Loading core/java/android/os/IPowerManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -65,4 +65,7 @@ interface IPowerManager // sets the attention light (used by phone app only) void setAttentionLight(boolean on, int color); // controls whether PowerManager should doze after the screen turns off or not void setDozeAfterScreenOff(boolean on); } core/java/android/os/PowerManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -1279,6 +1279,19 @@ public final class PowerManager { com.android.internal.R.bool.config_sustainedPerformanceModeSupported); } /** * If true, the doze component is not started until after the screen has been * turned off and the screen off animation has been performed. * @hide */ public void setDozeAfterScreenOff(boolean dozeAfterScreenOf) { try { mService.setDozeAfterScreenOff(dozeAfterScreenOf); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns the reason the phone was last shutdown. Calling app must have the * {@link android.Manifest.permission#DEVICE_POWER} permission to request this information. Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −0 Original line number Diff line number Diff line Loading @@ -1726,6 +1726,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { callback.onPhoneStateChanged(mPhoneState); callback.onRefreshCarrierInfo(); callback.onClockVisibilityChanged(); callback.onKeyguardVisibilityChangedRaw(mKeyguardIsVisible); for (Entry<Integer, SimData> data : mSimDatas.entrySet()) { final SimData state = data.getValue(); callback.onSimStateChanged(state.subId, state.slotId, state.simState); Loading packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java +7 −4 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorManager; import android.os.Handler; import android.os.PowerManager; import com.android.internal.hardware.AmbientDisplayConfiguration; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; Loading @@ -46,7 +48,7 @@ public class DozeFactory { DozeHost host = getHost(dozeService); AmbientDisplayConfiguration config = new AmbientDisplayConfiguration(context); DozeParameters params = new DozeParameters(context); DozeParameters params = DozeParameters.getInstance(context); Handler handler = new Handler(); WakeLock wakeLock = new DelayedWakeLock(handler, WakeLock.createPartial(context, "Doze")); Loading @@ -64,9 +66,9 @@ public class DozeFactory { createDozeTriggers(context, sensorManager, host, alarmManager, config, params, handler, wakeLock, machine), createDozeUi(context, host, wakeLock, machine, handler, alarmManager, params), new DozeScreenState(wrappedService, handler, params), new DozeScreenState(wrappedService, handler, params, wakeLock), createDozeScreenBrightness(context, wrappedService, sensorManager, host, handler), new DozeWallpaperState(context) new DozeWallpaperState(context, params) }); return machine; Loading @@ -92,7 +94,8 @@ public class DozeFactory { private DozeMachine.Part createDozeUi(Context context, DozeHost host, WakeLock wakeLock, DozeMachine machine, Handler handler, AlarmManager alarmManager, DozeParameters params) { return new DozeUi(context, alarmManager, machine, wakeLock, host, handler, params); return new DozeUi(context, alarmManager, machine, wakeLock, host, handler, params, KeyguardUpdateMonitor.getInstance(context)); } public static DozeHost getHost(DozeService service) { Loading packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +4 −4 Original line number Diff line number Diff line Loading @@ -92,17 +92,17 @@ public class DozeMachine { switch (this) { case UNINITIALIZED: case INITIALIZED: case DOZE: case DOZE_REQUEST_PULSE: return parameters.shouldControlScreenOff() ? Display.STATE_ON : Display.STATE_OFF; case DOZE_AOD_PAUSED: case DOZE: return Display.STATE_OFF; case DOZE_PULSING: return Display.STATE_ON; case DOZE_AOD: case DOZE_AOD_PAUSING: return Display.STATE_DOZE_SUSPEND; case DOZE_REQUEST_PULSE: return parameters.getDisplayNeedsBlanking() ? Display.STATE_OFF : Display.STATE_ON; default: return Display.STATE_UNKNOWN; } Loading Loading
core/java/android/os/IPowerManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -65,4 +65,7 @@ interface IPowerManager // sets the attention light (used by phone app only) void setAttentionLight(boolean on, int color); // controls whether PowerManager should doze after the screen turns off or not void setDozeAfterScreenOff(boolean on); }
core/java/android/os/PowerManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -1279,6 +1279,19 @@ public final class PowerManager { com.android.internal.R.bool.config_sustainedPerformanceModeSupported); } /** * If true, the doze component is not started until after the screen has been * turned off and the screen off animation has been performed. * @hide */ public void setDozeAfterScreenOff(boolean dozeAfterScreenOf) { try { mService.setDozeAfterScreenOff(dozeAfterScreenOf); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Returns the reason the phone was last shutdown. Calling app must have the * {@link android.Manifest.permission#DEVICE_POWER} permission to request this information. Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +1 −0 Original line number Diff line number Diff line Loading @@ -1726,6 +1726,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { callback.onPhoneStateChanged(mPhoneState); callback.onRefreshCarrierInfo(); callback.onClockVisibilityChanged(); callback.onKeyguardVisibilityChangedRaw(mKeyguardIsVisible); for (Entry<Integer, SimData> data : mSimDatas.entrySet()) { final SimData state = data.getValue(); callback.onSimStateChanged(state.subId, state.slotId, state.simState); Loading
packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java +7 −4 Original line number Diff line number Diff line Loading @@ -22,8 +22,10 @@ import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorManager; import android.os.Handler; import android.os.PowerManager; import com.android.internal.hardware.AmbientDisplayConfiguration; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SystemUIApplication; Loading @@ -46,7 +48,7 @@ public class DozeFactory { DozeHost host = getHost(dozeService); AmbientDisplayConfiguration config = new AmbientDisplayConfiguration(context); DozeParameters params = new DozeParameters(context); DozeParameters params = DozeParameters.getInstance(context); Handler handler = new Handler(); WakeLock wakeLock = new DelayedWakeLock(handler, WakeLock.createPartial(context, "Doze")); Loading @@ -64,9 +66,9 @@ public class DozeFactory { createDozeTriggers(context, sensorManager, host, alarmManager, config, params, handler, wakeLock, machine), createDozeUi(context, host, wakeLock, machine, handler, alarmManager, params), new DozeScreenState(wrappedService, handler, params), new DozeScreenState(wrappedService, handler, params, wakeLock), createDozeScreenBrightness(context, wrappedService, sensorManager, host, handler), new DozeWallpaperState(context) new DozeWallpaperState(context, params) }); return machine; Loading @@ -92,7 +94,8 @@ public class DozeFactory { private DozeMachine.Part createDozeUi(Context context, DozeHost host, WakeLock wakeLock, DozeMachine machine, Handler handler, AlarmManager alarmManager, DozeParameters params) { return new DozeUi(context, alarmManager, machine, wakeLock, host, handler, params); return new DozeUi(context, alarmManager, machine, wakeLock, host, handler, params, KeyguardUpdateMonitor.getInstance(context)); } public static DozeHost getHost(DozeService service) { Loading
packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +4 −4 Original line number Diff line number Diff line Loading @@ -92,17 +92,17 @@ public class DozeMachine { switch (this) { case UNINITIALIZED: case INITIALIZED: case DOZE: case DOZE_REQUEST_PULSE: return parameters.shouldControlScreenOff() ? Display.STATE_ON : Display.STATE_OFF; case DOZE_AOD_PAUSED: case DOZE: return Display.STATE_OFF; case DOZE_PULSING: return Display.STATE_ON; case DOZE_AOD: case DOZE_AOD_PAUSING: return Display.STATE_DOZE_SUSPEND; case DOZE_REQUEST_PULSE: return parameters.getDisplayNeedsBlanking() ? Display.STATE_OFF : Display.STATE_ON; default: return Display.STATE_UNKNOWN; } Loading