Home
last modified time | relevance | path

Searched refs:batteryState (Results 1 – 12 of 12) 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/battery/unified/
DBatteryLayersDrawable.kt68 batteryState: BatteryDrawableState,
78 var batteryState = batteryState variable
91 updateColorProfile(batteryState.hasForegroundContent(), batteryState.color, value)
217 if (batteryState.showPercent && batteryState.attribution != null) { in draw()
232 } else if (batteryState.showPercent) { in draw()
235 } else if (batteryState.attribution != null) { in draw()
349 batteryState = initialState, in newBatteryDrawable()
/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/services/core/java/com/android/server/power/stats/
DPowerStatsAggregator.java98 int batteryState = in aggregatePowerStats() local
102 if (batteryState != mCurrentBatteryState) { in aggregatePowerStats()
103 mStats.setDeviceState(AggregatedPowerStatsConfig.STATE_POWER, batteryState, in aggregatePowerStats()
105 mCurrentBatteryState = batteryState; in aggregatePowerStats()
/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DMultiStateStatsTest.java237 states[i].batteryState ? 0 : 1, in getSerialStates()
246 private State state(boolean batteryState, boolean screenState, int procstate) { in state() argument
248 state.batteryState = batteryState; in state()
255 public boolean batteryState; field in MultiStateStatsTest.State
/frameworks/base/tests/Input/src/android/hardware/input/
DInputDeviceBatteryListenerTest.kt143 deviceId: Int, eventTime: Long, batteryState: BatteryState -> in <lambda>() method
146 assertEquals(true, batteryState.isPresent) in <lambda>()
147 assertEquals(BatteryState.STATUS_DISCHARGING, batteryState.status) in <lambda>()
148 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.java1328 int deviceId, long eventTimeMillis, @NonNull BatteryState batteryState); in onBatteryStateChanged() argument
/frameworks/base/tests/Input/src/com/android/server/input/
DBatteryControllerTests.kt448 val batteryState = batteryController.getBatteryState(DEVICE_ID) in testGetBatteryState() constant
449 assertThat("battery state matches", batteryState, in testGetBatteryState()
464 val batteryState = batteryController.getBatteryState(DEVICE_ID) in testGetBatteryStateWithListener() constant
465 assertThat("battery matches state", batteryState, in testGetBatteryStateWithListener()