Home
last modified time | relevance | path

Searched refs:batteryState (Results 1 – 3 of 3) sorted by relevance

/packages/apps/Settings/src/com/android/settings/connecteddevice/stylus/
DStylusUsiHeaderController.java86 BatteryState batteryState = mInputDevice.getBatteryState(); in refresh() local
90 if (isValidBatteryState(batteryState)) { in refresh()
93 NumberFormat.getPercentInstance().format(batteryState.getCapacity())); in refresh()
111 private boolean isValidBatteryState(BatteryState batteryState) { in isValidBatteryState() argument
112 return batteryState != null in isValidBatteryState()
113 && batteryState.isPresent() in isValidBatteryState()
114 && batteryState.getCapacity() > 0f; in isValidBatteryState()
129 @NonNull BatteryState batteryState) { in onBatteryStateChanged() argument
DStylusDeviceUpdater.java137 @NonNull BatteryState batteryState) { in onBatteryStateChanged() argument
138 mLastBatteryState = batteryState; in onBatteryStateChanged()
/packages/apps/Settings/tests/robotests/src/com/android/settings/connecteddevice/stylus/
DStylusDeviceUpdaterTest.java233 BatteryState batteryState = mock(BatteryState.class); in onBatteryStateChanged_detectsValidUsi() local
234 doReturn(true).when(batteryState).isPresent(); in onBatteryStateChanged_detectsValidUsi()
235 doReturn(0.5f).when(batteryState).getCapacity(); in onBatteryStateChanged_detectsValidUsi()
238 batteryState); in onBatteryStateChanged_detectsValidUsi()
246 BatteryState batteryState = mock(BatteryState.class); in onBatteryStateChanged_detectsInvalidUsi_batteryNotPresent() local
247 doReturn(false).when(batteryState).isPresent(); in onBatteryStateChanged_detectsInvalidUsi_batteryNotPresent()
250 batteryState); in onBatteryStateChanged_detectsInvalidUsi_batteryNotPresent()