Home
last modified time | relevance | path

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

/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/stylus/
DStylusManagerTest.kt60 @Mock lateinit var batteryState: BatteryState in <lambda>() variable in com.android.systemui.stylus.StylusManagerTest
109 whenever(btStylusDevice.batteryState).thenReturn(batteryState) in <lambda>()
110 whenever(stylusDevice.batteryState).thenReturn(batteryState) in <lambda>()
111 whenever(batteryState.capacity).thenReturn(0.5f) in <lambda>()
511 whenever(batteryState.isPresent).thenReturn(true) in <lambda>()
513 stylusManager.onBatteryStateChanged(STYLUS_DEVICE_ID, 1, batteryState) in <lambda>()
520 whenever(batteryState.isPresent).thenReturn(true) in <lambda>()
522 stylusManager.onBatteryStateChanged(STYLUS_DEVICE_ID, 1, batteryState) in <lambda>()
529 whenever(batteryState.isPresent).thenReturn(true) in <lambda>()
531 stylusManager.onBatteryStateChanged(STYLUS_DEVICE_ID, 1, batteryState) in <lambda>()
[all …]
DStylusUsiPowerStartableTest.kt117 val batteryState = FixedCapacityBatteryState(0.1f) in onStylusUsiBatteryStateChanged_batteryPresentValidCapacity_refreshesNotification() constant
119 startable.onStylusUsiBatteryStateChanged(STYLUS_DEVICE_ID, 123, batteryState) in onStylusUsiBatteryStateChanged_batteryPresentValidCapacity_refreshesNotification()
121 verify(stylusUsiPowerUi, times(1)).updateBatteryState(STYLUS_DEVICE_ID, batteryState) in onStylusUsiBatteryStateChanged_batteryPresentValidCapacity_refreshesNotification()
126 val batteryState = FixedCapacityBatteryState(0f) in onStylusUsiBatteryStateChanged_batteryPresentInvalidCapacity_noop() constant
128 startable.onStylusUsiBatteryStateChanged(STYLUS_DEVICE_ID, 123, batteryState) in onStylusUsiBatteryStateChanged_batteryPresentInvalidCapacity_noop()
135 val batteryState = mock(BatteryState::class.java) in onStylusUsiBatteryStateChanged_batteryNotPresent_noop() constant
136 whenever(batteryState.isPresent).thenReturn(false) in onStylusUsiBatteryStateChanged_batteryNotPresent_noop()
138 startable.onStylusUsiBatteryStateChanged(STYLUS_DEVICE_ID, 123, batteryState) in onStylusUsiBatteryStateChanged_batteryNotPresent_noop()
/frameworks/base/packages/SystemUI/src/com/android/systemui/stylus/
DStylusUsiPowerStartable.kt56 batteryState: BatteryState in onStylusUsiBatteryStateChanged()
58 if (batteryState.isPresent && batteryState.capacity > 0f) { in onStylusUsiBatteryStateChanged()
59 stylusUsiPowerUi.updateBatteryState(deviceId, batteryState) in onStylusUsiBatteryStateChanged()
DStylusManager.kt89 it.isInternalStylusSource && isBatteryStateValid(it.batteryState) in <lambda>()
197 batteryState: BatteryState in <lambda>()
208 val batteryStateValid = isBatteryStateValid(batteryState) in <lambda>()
215 cb.onStylusUsiBatteryStateChanged(deviceId, eventTimeMillis, batteryState) in <lambda>()
318 private fun isBatteryStateValid(batteryState: BatteryState): Boolean { in <lambda>()
319 return batteryState.isPresent && batteryState.capacity > 0.0f in <lambda>()
381 batteryState: BatteryState, in <lambda>()
DStylusUsiPowerUI.kt111 fun updateBatteryState(deviceId: Int, batteryState: BatteryState) { in updateBatteryState()
114 if (batteryState.capacity == batteryCapacity || batteryState.capacity <= 0f) in updateBatteryState()
117 batteryCapacity = batteryState.capacity in updateBatteryState()
/frameworks/base/core/tests/coretests/src/android/hardware/input/
DInputDeviceBatteryListenerTest.kt140 deviceId: Int, eventTime: Long, batteryState: BatteryState -> in <lambda>() method
143 assertEquals(true, batteryState.isPresent) in <lambda>()
144 assertEquals(BatteryState.STATUS_DISCHARGING, batteryState.status) in <lambda>()
145 assertEquals(0.5f, batteryState.capacity) in <lambda>()
/frameworks/base/core/java/android/hardware/input/
DIInputDeviceBatteryListener.aidl28 void onBatteryStateChanged(in IInputDeviceBatteryState batteryState); in onBatteryStateChanged() argument
DInputManager.java1339 int deviceId, long eventTimeMillis, @NonNull BatteryState batteryState); in onBatteryStateChanged() argument
/frameworks/base/services/tests/servicestests/src/com/android/server/input/
DBatteryControllerTests.kt445 val batteryState = batteryController.getBatteryState(DEVICE_ID) in testGetBatteryState() constant
446 assertThat("battery state matches", batteryState, in testGetBatteryState()
461 val batteryState = batteryController.getBatteryState(DEVICE_ID) in testGetBatteryStateWithListener() constant
462 assertThat("battery matches state", batteryState, in testGetBatteryStateWithListener()