/frameworks/base/core/java/android/view/ |
D | WindowManagerPolicyConstants.java | 22 import android.os.PowerManager; 126 @PowerManager.GoToSleepReason int reason) { in translateSleepReasonToOffReason() 128 case PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN: in translateSleepReasonToOffReason() 130 case PowerManager.GO_TO_SLEEP_REASON_TIMEOUT: in translateSleepReasonToOffReason() 131 case PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE: in translateSleepReasonToOffReason() 167 static @OnReason int translateWakeReasonToOnReason(@PowerManager.WakeReason int reason) { in translateWakeReasonToOnReason() 169 case PowerManager.WAKE_REASON_POWER_BUTTON: in translateWakeReasonToOnReason() 170 case PowerManager.WAKE_REASON_PLUGGED_IN: in translateWakeReasonToOnReason() 171 case PowerManager.WAKE_REASON_GESTURE: in translateWakeReasonToOnReason() 172 case PowerManager.WAKE_REASON_TAP: in translateWakeReasonToOnReason() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/power/ |
D | WakeLockLogTest.java | 23 import android.os.PowerManager; 46 PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE); in testAddTwoItems() 50 PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP); in testAddTwoItems() 69 log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK); in testAddTwoItemsWithTimeReset() 72 log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK); in testAddTwoItemsWithTimeReset() 91 log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK); in testAddTwoItemsWithTagOverwrite() 94 log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK); in testAddTwoItemsWithTagOverwrite() 114 log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK); in testAddFourItemsWithRingBufferOverflow() 117 log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK); in testAddFourItemsWithRingBufferOverflow() 119 log.onWakeLockAcquired("TagThree", 101, PowerManager.PARTIAL_WAKE_LOCK); in testAddFourItemsWithRingBufferOverflow() [all …]
|
/frameworks/base/core/tests/coretests/src/android/os/ |
D | PowerManagerTest.java | 44 private PowerManager mPm; 48 private PowerManager.OnThermalStatusChangedListener mListener1; 50 private PowerManager.OnThermalStatusChangedListener mListener2; 78 mPm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); in setUp() 107 PowerManager.WakeLock wl = mPm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "FULL_WAKE_LOCK"); in testNewWakeLock() 110 wl = mPm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "SCREEN_BRIGHT_WAKE_LOCK"); in testNewWakeLock() 113 wl = mPm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "SCREEN_DIM_WAKE_LOCK"); in testNewWakeLock() 116 wl = mPm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PARTIAL_WAKE_LOCK"); in testNewWakeLock() 130 final int badFlags = PowerManager.SCREEN_BRIGHT_WAKE_LOCK in testBadNewWakeLock() 131 | PowerManager.SCREEN_DIM_WAKE_LOCK; in testBadNewWakeLock() [all …]
|
D | PowerManagerVrTest.java | 35 private PowerManager mPm; 50 mPm = (PowerManager) getInstrumentation().getTargetContext().getSystemService( in setUp() 129 PowerManager.WakeLock wl = mPm.newWakeLock( in wakeUpDevice() 130 PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP in wakeUpDevice() 131 | PowerManager.ON_AFTER_RELEASE, "FULL_WAKE_LOCK"); in wakeUpDevice()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/display/ |
D | BrightnessThrottlerTest.java | 34 import android.os.PowerManager; 98 singleLevel.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.25f)); in testBrightnessThrottlingData() 101 validLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.62f)); in testBrightnessThrottlingData() 102 validLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.25f)); in testBrightnessThrottlingData() 105 unsortedThermalLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.62f)); in testBrightnessThrottlingData() 106 unsortedThermalLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.25f)); in testBrightnessThrottlingData() 110 new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.25f)); in testBrightnessThrottlingData() 112 new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.62f)); in testBrightnessThrottlingData() 115 unsortedLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_CRITICAL, 0.25f)); in testBrightnessThrottlingData() 116 unsortedLevels.add(new ThrottlingLevel(PowerManager.THERMAL_STATUS_MODERATE, 0.62f)); in testBrightnessThrottlingData() [all …]
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/keyguard/ |
D | WakefulnessLifecycleTest.java | 26 import android.os.PowerManager; 74 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in dispatchStartedWakingUp() 83 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in dispatchFinishedWakingUp() 94 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in dispatchStartedGoingToSleep() 96 mWakefulness.dispatchStartedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_MIN); in dispatchStartedGoingToSleep() 106 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in dispatchFinishedGoingToSleep() 108 mWakefulness.dispatchStartedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_MIN); in dispatchFinishedGoingToSleep() 119 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in doesNotDispatchTwice() 120 mWakefulness.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN); in doesNotDispatchTwice() 123 mWakefulness.dispatchStartedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_MIN); in doesNotDispatchTwice() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/ |
D | BatterySaverPolicyTest.java | 26 import android.os.PowerManager; 27 import android.os.PowerManager.ServiceType; 51 PowerManager.LOCATION_MODE_FOREGROUND_ONLY; 54 PowerManager.SOUND_TRIGGER_MODE_CRITICAL_ONLY; 319 "location_mode=" + PowerManager.LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF in testAutomotiveProjectionChanges_Full() 323 .isEqualTo(PowerManager.LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF); in testAutomotiveProjectionChanges_Full() 330 .isAnyOf(PowerManager.LOCATION_MODE_NO_CHANGE, in testAutomotiveProjectionChanges_Full() 331 PowerManager.LOCATION_MODE_FOREGROUND_ONLY); in testAutomotiveProjectionChanges_Full() 338 .isEqualTo(PowerManager.LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF); in testAutomotiveProjectionChanges_Full() 346 "location_mode=" + PowerManager.LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF in testAutomotiveProjectionChanges_Adaptive() [all …]
|
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/restrictions/ |
D | ThermalStatusRestriction.java | 21 import android.os.PowerManager; 22 import android.os.PowerManager.OnThermalStatusChangedListener; 33 private static final int LOW_PRIORITY_THRESHOLD = PowerManager.THERMAL_STATUS_LIGHT; 35 private static final int HIGHER_PRIORITY_THRESHOLD = PowerManager.THERMAL_STATUS_MODERATE; 39 private static final int UPPER_THRESHOLD = PowerManager.THERMAL_STATUS_SEVERE; 41 private volatile int mThermalStatus = PowerManager.THERMAL_STATUS_NONE; 50 final PowerManager powerManager = in onSystemServicesReady() 51 mService.getTestableContext().getSystemService(PowerManager.class); in onSystemServicesReady()
|
/frameworks/base/services/core/java/com/android/server/display/ |
D | BrightnessThrottler.java | 27 import android.os.PowerManager; 68 private float mBrightnessCap = PowerManager.BRIGHTNESS_MAX; 127 mBrightnessCap = PowerManager.BRIGHTNESS_MAX; in stop() 156 if (brightness < PowerManager.BRIGHTNESS_MIN) { in verifyAndConstrainBrightnessCap() 158 + "brightness " + PowerManager.BRIGHTNESS_MIN); in verifyAndConstrainBrightnessCap() 159 brightness = PowerManager.BRIGHTNESS_MIN; in verifyAndConstrainBrightnessCap() 162 if (brightness > PowerManager.BRIGHTNESS_MAX) { in verifyAndConstrainBrightnessCap() 164 + "brightness " + PowerManager.BRIGHTNESS_MAX); in verifyAndConstrainBrightnessCap() 165 brightness = PowerManager.BRIGHTNESS_MAX; in verifyAndConstrainBrightnessCap() 183 float brightnessCap = PowerManager.BRIGHTNESS_MAX; in updateThrottling() [all …]
|
/frameworks/opt/net/voip/src/java/com/android/server/sip/ |
D | SipWakeLock.java | 19 import android.os.PowerManager; 27 private PowerManager mPowerManager; 28 private PowerManager.WakeLock mWakeLock; 29 private PowerManager.WakeLock mTimerWakeLock; 32 SipWakeLock(PowerManager powerManager) { in SipWakeLock() 45 PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock.timer"); in acquire() 55 PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock"); in acquire()
|
/frameworks/base/tests/StatusBar/src/com/android/statusbartest/ |
D | PowerTest.java | 26 import android.os.PowerManager; 35 PowerManager mPm; 36 PowerManager.WakeLock mProx; 46 mPm = (PowerManager)getSystemService("power"); in tests() 47 mProx = mPm.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "PowerTest-prox"); in tests() 82 mProx.release(PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY); 103 mProx.release(PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY);
|
/frameworks/base/core/java/com/android/internal/display/ |
D | BrightnessSynchronizer.java | 28 import android.os.PowerManager; 108 } else if (mLatestIntBrightness != PowerManager.BRIGHTNESS_INVALID) { in startSynchronizing() 137 if (brightnessInt == PowerManager.BRIGHTNESS_OFF) { in brightnessIntToFloat() 138 return PowerManager.BRIGHTNESS_OFF_FLOAT; in brightnessIntToFloat() 139 } else if (brightnessInt == PowerManager.BRIGHTNESS_INVALID) { in brightnessIntToFloat() 140 return PowerManager.BRIGHTNESS_INVALID_FLOAT; in brightnessIntToFloat() 142 final float minFloat = PowerManager.BRIGHTNESS_MIN; in brightnessIntToFloat() 143 final float maxFloat = PowerManager.BRIGHTNESS_MAX; in brightnessIntToFloat() 144 final float minInt = PowerManager.BRIGHTNESS_OFF + 1; in brightnessIntToFloat() 145 final float maxInt = PowerManager.BRIGHTNESS_ON; in brightnessIntToFloat() [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/ |
D | WakefulnessLifecycle.java | 25 import android.os.PowerManager; 74 private @PowerManager.WakeReason int mLastWakeReason = PowerManager.WAKE_REASON_UNKNOWN; 82 private @PowerManager.GoToSleepReason int mLastSleepReason = 83 PowerManager.GO_TO_SLEEP_REASON_MIN; 109 public @PowerManager.WakeReason int getLastWakeReason() { in getLastWakeReason() 125 public @PowerManager.GoToSleepReason int getLastSleepReason() { in getLastSleepReason() 129 public void dispatchStartedWakingUp(@PowerManager.WakeReason int pmWakeReason) { in dispatchStartedWakingUp() 159 public void dispatchStartedGoingToSleep(@PowerManager.GoToSleepReason int pmSleepReason) { in dispatchStartedGoingToSleep() 202 case PowerManager.WAKE_REASON_POWER_BUTTON: in updateLastWakeOriginLocation() 215 case PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON: in updateLastSleepOriginLocation()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/ |
D | FaceWakeUpTriggersConfigTest.kt | 19 import android.os.PowerManager 48 intArrayOf(PowerManager.WAKE_REASON_POWER_BUTTON, PowerManager.WAKE_REASON_GESTURE) in testShouldTriggerFaceAuthOnWakeUpFrom_inConfig_returnsTrue() 53 PowerManager.WAKE_REASON_POWER_BUTTON in testShouldTriggerFaceAuthOnWakeUpFrom_inConfig_returnsTrue() 58 PowerManager.WAKE_REASON_GESTURE in testShouldTriggerFaceAuthOnWakeUpFrom_inConfig_returnsTrue() 63 PowerManager.WAKE_REASON_APPLICATION in testShouldTriggerFaceAuthOnWakeUpFrom_inConfig_returnsTrue()
|
D | ActiveUnlockConfigTest.kt | 24 import android.os.PowerManager 25 import android.os.PowerManager.WAKE_REASON_BIOMETRIC 282 PowerManager.WAKE_REASON_LIFT, in isWakeupConsideredUnlockIntent_singleValue() 288 if (wakeReason == PowerManager.WAKE_REASON_LIFT) { in isWakeupConsideredUnlockIntent_singleValue() 301 PowerManager.WAKE_REASON_LIFT.toString() + in isWakeupConsideredUnlockIntent_multiValue() 303 PowerManager.WAKE_REASON_TAP.toString(), in isWakeupConsideredUnlockIntent_multiValue() 310 if (wakeReason == PowerManager.WAKE_REASON_LIFT || in isWakeupConsideredUnlockIntent_multiValue() 311 wakeReason == PowerManager.WAKE_REASON_TAP) { in isWakeupConsideredUnlockIntent_multiValue() 338 PowerManager.WAKE_REASON_LIFT.toString(), currentUser) in isWakeupForceDismissKeyguard_singleValue() 345 if (wakeReason == PowerManager.WAKE_REASON_LIFT) { in isWakeupForceDismissKeyguard_singleValue() [all …]
|
/frameworks/base/apex/jobscheduler/service/java/com/android/server/tare/ |
D | DeviceIdleModifier.java | 24 import android.os.PowerManager; 35 private final PowerManager mPowerManager; 41 mPowerManager = irs.getContext().getSystemService(PowerManager.class); in DeviceIdleModifier() 89 filter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED); in startTracking() 90 filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED); in startTracking() 112 if (PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED.equals(action)) { in onReceive() 117 } else if (PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED.equals(action)) { in onReceive()
|
D | PowerSaveModeModifier.java | 24 import android.os.PowerManager; 77 private final PowerManager mPowerManager; 81 mPowerManager = mIrs.getContext().getSystemService(PowerManager.class); in PowerSaveModeTracker() 90 filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); in startTracking() 111 if (PowerManager.ACTION_POWER_SAVE_MODE_CHANGED.equals(action)) { in onReceive()
|
/frameworks/base/core/java/android/os/ |
D | BatterySaverPolicyConfig.java | 75 mLocationMode = Math.max(PowerManager.MIN_LOCATION_MODE, in BatterySaverPolicyConfig() 76 Math.min(in.mLocationMode, PowerManager.MAX_LOCATION_MODE)); in BatterySaverPolicyConfig() 77 mSoundTriggerMode = Math.max(PowerManager.MIN_SOUND_TRIGGER_MODE, in BatterySaverPolicyConfig() 78 Math.min(in.mSoundTriggerMode, PowerManager.MAX_SOUND_TRIGGER_MODE)); in BatterySaverPolicyConfig() 111 mLocationMode = Math.max(PowerManager.MIN_LOCATION_MODE, in BatterySaverPolicyConfig() 112 Math.min(in.readInt(), PowerManager.MAX_LOCATION_MODE)); in BatterySaverPolicyConfig() 113 mSoundTriggerMode = Math.max(PowerManager.MIN_SOUND_TRIGGER_MODE, in BatterySaverPolicyConfig() 114 Math.min(in.readInt(), PowerManager.MAX_SOUND_TRIGGER_MODE)); in BatterySaverPolicyConfig() 250 @PowerManager.SoundTriggerPowerSaveMode 262 return mSoundTriggerMode == PowerManager.SOUND_TRIGGER_MODE_ALL_DISABLED; in getDisableSoundTrigger() [all …]
|
/frameworks/base/services/core/java/com/android/server/location/injector/ |
D | SystemLocationPowerSaveModeHelper.java | 20 import android.os.PowerManager; 21 import android.os.PowerManager.LocationPowerSaveMode; 55 PowerManager.ServiceType.LOCATION, this); in onSystemReady() 57 mContext.getSystemService(PowerManager.class)).getLocationPowerSaveMode(); in onSystemReady() 66 locationPowerSaveMode = PowerManager.LOCATION_MODE_NO_CHANGE; in accept()
|
/frameworks/base/services/core/java/com/android/server/power/ |
D | PowerGroup.java | 36 import android.os.PowerManager; 79 @PowerManager.UserActivityEvent 208 void wakeUpLocked(long eventTime, @PowerManager.WakeReason int reason, String details, int uid, in wakeUpLocked() 220 + ", reason=" + PowerManager.wakeReasonToString(reason) in wakeUpLocked() 251 boolean dozeLocked(long eventTime, int uid, @PowerManager.GoToSleepReason int reason) { in dozeLocked() 258 reason = Math.min(PowerManager.GO_TO_SLEEP_REASON_MAX, in dozeLocked() 259 Math.max(reason, PowerManager.GO_TO_SLEEP_REASON_MIN)); in dozeLocked() 263 + PowerManager.sleepReasonToString(reason) in dozeLocked() 266 + ", lastUserActivityEvent=" + PowerManager.userActivityEventToString( in dozeLocked() 278 boolean sleepLocked(long eventTime, int uid, @PowerManager.GoToSleepReason int reason) { in sleepLocked() [all …]
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/job/restrictions/ |
D | ThermalStatusRestrictionTest.java | 19 import static android.os.PowerManager.THERMAL_STATUS_CRITICAL; 20 import static android.os.PowerManager.THERMAL_STATUS_EMERGENCY; 21 import static android.os.PowerManager.THERMAL_STATUS_LIGHT; 22 import static android.os.PowerManager.THERMAL_STATUS_MODERATE; 23 import static android.os.PowerManager.THERMAL_STATUS_NONE; 24 import static android.os.PowerManager.THERMAL_STATUS_SEVERE; 25 import static android.os.PowerManager.THERMAL_STATUS_SHUTDOWN; 43 import android.os.PowerManager; 69 private PowerManager.OnThermalStatusChangedListener mStatusChangedListener; 89 PowerManager powerManager = mock(PowerManager.class); in setUp() [all …]
|
/frameworks/base/services/core/java/com/android/server/power/batterysaver/ |
D | BatterySaverController.java | 31 import android.os.PowerManager; 71 private PowerManager mPowerManager; 193 case PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED: 194 case PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED: 213 PowerManager.invalidatePowerSaveModeCaches(); in BatterySaverController() 232 filter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED); in systemReady() 233 filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED); in systemReady() 239 private PowerManager getPowerManager() { in getPowerManager() 242 Objects.requireNonNull(mContext.getSystemService(PowerManager.class)); in getPowerManager() 468 Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); in handleBatterySaverStateChanged() [all …]
|
/frameworks/base/services/core/java/com/android/server/hdmi/ |
D | PowerManagerWrapper.java | 20 import android.os.PowerManager; 21 import android.os.PowerManager.WakeLock; 29 private final PowerManager mPowerManager; 32 mPowerManager = context.getSystemService(PowerManager.class); in PowerManagerWrapper()
|
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/location/injector/ |
D | SystemLocationPowerSaveModeHelperTest.java | 18 import static android.os.PowerManager.LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF; 19 import static android.os.PowerManager.LOCATION_MODE_FOREGROUND_ONLY; 20 import static android.os.PowerManager.LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF; 21 import static android.os.PowerManager.LOCATION_MODE_NO_CHANGE; 22 import static android.os.PowerManager.LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF; 37 import android.os.PowerManager; 82 PowerManager powerManager = mock(PowerManager.class); in setUp() 85 doReturn(powerManager).when(context).getSystemService(PowerManager.class); in setUp()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/keyguard/shared/model/ |
D | WakeSleepReason.kt | 19 import android.os.PowerManager 32 PowerManager.WAKE_REASON_POWER_BUTTON -> POWER_BUTTON in fromPowerManagerWakeReason() 39 PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON -> POWER_BUTTON in fromPowerManagerSleepReason()
|