Home
last modified time | relevance | path

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

12345678

/frameworks/base/core/tests/coretests/src/android/os/
DPowerManagerTest.java25 private PowerManager mPm;
33 mPm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); in setUp()
53 PowerManager.WakeLock wl = mPm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "FULL_WAKE_LOCK"); in testNewWakeLock()
56 wl = mPm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "SCREEN_BRIGHT_WAKE_LOCK"); in testNewWakeLock()
59 wl = mPm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "SCREEN_DIM_WAKE_LOCK"); in testNewWakeLock()
62 wl = mPm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PARTIAL_WAKE_LOCK"); in testNewWakeLock()
76 final int badFlags = PowerManager.SCREEN_BRIGHT_WAKE_LOCK in testBadNewWakeLock()
77 | PowerManager.SCREEN_DIM_WAKE_LOCK; in testBadNewWakeLock()
80 PowerManager.WakeLock wl = mPm.newWakeLock(badFlags, "foo"); in testBadNewWakeLock()
92 private void doTestWakeLock(PowerManager.WakeLock wl) { in doTestWakeLock()
DPowerManagerVrTest.java22 import android.os.PowerManager;
37 private PowerManager mPm;
52 mPm = (PowerManager) getInstrumentation().getTargetContext().getSystemService( in setUp()
131 PowerManager.WakeLock wl = mPm.newWakeLock( in wakeUpDevice()
132 PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP in wakeUpDevice()
133 | PowerManager.ON_AFTER_RELEASE, "FULL_WAKE_LOCK"); in wakeUpDevice()
/frameworks/support/legacy/core-utils/src/main/java/androidx/legacy/content/
DWakefulBroadcastReceiver.java23 import android.os.PowerManager;
76 private static final SparseArray<PowerManager.WakeLock> sActiveWakeLocks = new SparseArray<>();
107 PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); in startWakefulService()
108 PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, in startWakefulService()
131 PowerManager.WakeLock wl = sActiveWakeLocks.get(id); in completeWakefulIntent()
/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/support/wear/src/androidTest/java/androidx/wear/widget/util/
DWakeLockRule.java20 import android.os.PowerManager;
21 import android.os.PowerManager.WakeLock;
34 PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP;
54 PowerManager power = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
/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/support/work/workmanager/src/main/java/androidx/work/impl/utils/
DWakeLocks.java19 import static android.os.PowerManager.PARTIAL_WAKE_LOCK;
22 import android.os.PowerManager;
41 public static PowerManager.WakeLock newWakeLock( in newWakeLock()
44 PowerManager powerManager = (PowerManager) context.getApplicationContext() in newWakeLock()
/frameworks/base/tests/utils/SleepUtils/AlarmService/src/com/android/testing/alarmservice/
DWakeUpController.java20 import android.os.PowerManager;
21 import android.os.PowerManager.WakeLock;
48 PowerManager pm = in getWakeLock()
49 (PowerManager) AlarmService.sContext.getSystemService(Context.POWER_SERVICE); in getWakeLock()
50 mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "testing-alarmservice"); in getWakeLock()
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/wakelock/
DWakeLock.java20 import android.os.PowerManager;
40 static PowerManager.WakeLock createPartialInner(Context context, String tag) { in createPartialInner()
41 return context.getSystemService(PowerManager.class) in createPartialInner()
42 .newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, tag); in createPartialInner()
56 static WakeLock wrap(final PowerManager.WakeLock inner) {
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/
DBatteryControllerTest.java22 import android.os.PowerManager;
44 private PowerManager mPowerManager;
58 Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); in testIndependentAODBatterySaver_true()
59 when(mPowerManager.getPowerSaveState(PowerManager.ServiceType.AOD)).thenReturn(state); in testIndependentAODBatterySaver_true()
73 Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); in testIndependentAODBatterySaver_false()
74 when(mPowerManager.getPowerSaveState(PowerManager.ServiceType.AOD)).thenReturn(state); in testIndependentAODBatterySaver_false()
/frameworks/base/services/core/java/com/android/server/power/batterysaver/
DBatterySaverController.java29 import android.os.PowerManager;
67 private PowerManager mPowerManager;
137 case PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED:
138 case PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED:
181 filter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED); in systemReady()
182 filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED); in systemReady()
190 private PowerManager getPowerManager() { in getPowerManager()
193 Preconditions.checkNotNull(mContext.getSystemService(PowerManager.class)); in getPowerManager()
349 Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING) in handleBatterySaverStateChanged()
350 .putExtra(PowerManager.EXTRA_POWER_SAVE_MODE, enabled) in handleBatterySaverStateChanged()
[all …]
/frameworks/base/services/robotests/src/com/android/server/backup/testing/
DBackupManagerServiceTestUtils.java28 import android.os.PowerManager;
47 PowerManager.WakeLock wakeLock, in setUpBackupManagerServiceBasics()
61 public static PowerManager.WakeLock createBackupWakeLock(Application application) { in createBackupWakeLock()
62 PowerManager powerManager = in createBackupWakeLock()
63 (PowerManager) application.getSystemService(Context.POWER_SERVICE); in createBackupWakeLock()
64 return powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*"); in createBackupWakeLock()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/
DBatteryControllerImpl.java26 import android.os.PowerManager;
49 private final PowerManager mPowerManager;
63 this(context, context.getSystemService(PowerManager.class)); in BatteryControllerImpl()
67 BatteryControllerImpl(Context context, PowerManager powerManager) { in BatteryControllerImpl()
79 filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); in registerReceiver()
80 filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING); in registerReceiver()
134 } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)) { in onReceive()
136 } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING)) { in onReceive()
137 setPowerSave(intent.getBooleanExtra(PowerManager.EXTRA_POWER_SAVE_MODE, false)); in onReceive()
192 PowerSaveState state = mPowerManager.getPowerSaveState(PowerManager.ServiceType.AOD); in setPowerSave()
/frameworks/base/services/core/java/com/android/server/
DConsumerIrService.java22 import android.os.PowerManager;
37 private final PowerManager.WakeLock mWakeLock;
43 PowerManager pm = (PowerManager)context.getSystemService( in ConsumerIrService()
45 mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG); in ConsumerIrService()
/frameworks/base/services/core/java/com/android/server/job/controllers/
DDeviceIdleJobsController.java27 import android.os.PowerManager;
68 private final PowerManager mPowerManager;
83 case PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED:
84 case PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED:
88 case PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED:
98 case PowerManager.ACTION_POWER_SAVE_TEMP_WHITELIST_CHANGED:
124 mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); in DeviceIdleJobsController()
134 filter.addAction(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED); in DeviceIdleJobsController()
135 filter.addAction(PowerManager.ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED); in DeviceIdleJobsController()
136 filter.addAction(PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED); in DeviceIdleJobsController()
[all …]
/frameworks/base/tests/utils/SleepUtils/WakeLoopService/src/android/test/wakeuploop/
DWakeUpCall.java27 import android.os.PowerManager;
28 import android.os.PowerManager.WakeLock;
106 PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE); in screenOn()
108 WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK | in screenOn()
109 PowerManager.ACQUIRE_CAUSES_WAKEUP, LOG_TAG); in screenOn()
/frameworks/base/services/core/java/com/android/server/power/
DPowerManagerService.java51 import android.os.PowerManager;
52 import android.os.PowerManager.ServiceType;
492 private int mDozeScreenBrightnessOverrideFromDreamManager = PowerManager.BRIGHTNESS_DEFAULT;
730 now, PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, Process.SYSTEM_UID); in onBootPhase()
753 PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); in systemReady()
1026 switch (wakeLock.mFlags & PowerManager.WAKE_LOCK_LEVEL_MASK) { in isScreenLock()
1027 case PowerManager.FULL_WAKE_LOCK: in isScreenLock()
1028 case PowerManager.SCREEN_BRIGHT_WAKE_LOCK: in isScreenLock()
1029 case PowerManager.SCREEN_DIM_WAKE_LOCK: in isScreenLock()
1036 if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0 in applyWakeLockFlagsOnAcquireLocked()
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/
DSmsStorageMonitor.java26 import android.os.PowerManager;
54 private PowerManager.WakeLock mWakeLock;
134 PowerManager pm = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE); in createWakelock()
135 mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SmsStorageMonitor"); in createWakelock()
DWakeLockStateMachine.java24 import android.os.PowerManager;
40 private final PowerManager.WakeLock mWakeLock;
70 PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); in WakeLockStateMachine()
71 mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, debugTag); in WakeLockStateMachine()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/
DDozeParametersTest.java20 import android.os.PowerManager;
205 PowerManager mockedPowerManager = dozeParameters.getPowerManager(); in test_setControlScreenOffAnimation_setsDozeAfterScreenOff_false()
215 PowerManager mockedPowerManager = dozeParameters.getPowerManager(); in test_setControlScreenOffAnimation_setsDozeAfterScreenOff_true()
232 private PowerManager mPowerManager;
236 mPowerManager = mock(PowerManager.class); in TestableDozeParameters()
240 protected PowerManager getPowerManager() { in getPowerManager()
/frameworks/base/cmds/uiautomator/instrumentation/testrunner-src/com/android/uiautomator/core/
DInstrumentationUiAutomatorBridge.java22 import android.os.PowerManager;
52 PowerManager pm = (PowerManager) in isScreenOn()
/frameworks/base/services/core/java/com/android/server/location/
DNtpTimeHelper.java8 import android.os.PowerManager;
9 import android.os.PowerManager.WakeLock;
83 PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); in NtpTimeHelper()
84 mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKELOCK_KEY); in NtpTimeHelper()
/frameworks/base/tests/DozeTest/src/com/android/dreams/dozetest/
DDozeTestDream.java26 import android.os.PowerManager;
56 private PowerManager mPowerManager;
57 private PowerManager.WakeLock mWakeLock;
75 mPowerManager = (PowerManager)getSystemService(Context.POWER_SERVICE); in onCreate()
76 mWakeLock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG); in onCreate()
/frameworks/base/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/
DMediaFrameworkTest.java27 import android.os.PowerManager;
69 private PowerManager.WakeLock mWakeLock = null;
96 PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE); in onCreate()
97 mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "MediaFrameworkTest"); in onCreate()
/frameworks/base/tests/BatteryWaster/src/com/android/batterywaster/
DBatteryWaster.java26 import android.os.PowerManager;
42 PowerManager.WakeLock mPartialWakeLock;
67 PowerManager pm = (PowerManager)getSystemService(POWER_SERVICE); in onCreate()
68 mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "BatteryWaster"); in onCreate()

12345678