Home
last modified time | relevance | path

Searched refs:PowerManager (Results 1 – 25 of 336) sorted by relevance

12345678910>>...14

/frameworks/base/core/java/android/view/
DWindowManagerPolicyConstants.java22 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/
DWakeLockLogTest.java23 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/
DPowerManagerTest.java44 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 …]
DPowerManagerVrTest.java35 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/
DBrightnessThrottlerTest.java34 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/
DWakefulnessLifecycleTest.java26 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/
DBatterySaverPolicyTest.java26 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/
DThermalStatusRestriction.java21 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/
DBrightnessThrottler.java27 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/
DSipWakeLock.java19 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/
DPowerTest.java26 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/
DBrightnessSynchronizer.java28 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/
DWakefulnessLifecycle.java25 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/
DFaceWakeUpTriggersConfigTest.kt19 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()
DActiveUnlockConfigTest.kt24 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/
DDeviceIdleModifier.java24 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()
DPowerSaveModeModifier.java24 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/
DBatterySaverPolicyConfig.java75 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/
DSystemLocationPowerSaveModeHelper.java20 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/
DPowerGroup.java36 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/
DThermalStatusRestrictionTest.java19 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/
DBatterySaverController.java31 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/
DPowerManagerWrapper.java20 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/
DSystemLocationPowerSaveModeHelperTest.java18 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/
DWakeSleepReason.kt19 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()

12345678910>>...14