Files
oxmc 8b9d4f6bc0 Port themed battery icon support from AxionOS
ThemedBatteryDrawable.kt (SystemUI-local copy, distinct from the
existing SettingsLib one) + ThemedBatteryBody.kt (its Compose-pipeline
counterpart) ported from AxionOS's frameworks_base fork, scoped down:
dropped the LineageSettings-backed circle/text/dotted icon-style
switcher entirely (lineageos.providers.LineageSettings doesn't exist
anywhere in this tree) and the ThemeIconController dependency
(unrelated signal/wifi icon theming, not needed here).

Instead config_batteryOverrideStyle is read once from resources
(BatteryRepository) and used directly: -1 (this tree's default, in
pawlet_battery_configs.xml) means the classic AOSP shape, any other
value means a battery_style overlay is active and the themed path
renders. No runtime switcher, no new settings storage -- an overlay
targeting com.android.systemui with category
android.theme.customization.battery_style is what flips it, matching
how android_vendor_addons/themes/battery/BatteryStyleOneUI7 is
already built.

AccessorizedBatteryDrawable.kt / BatterySpecs.kt: switched from the
stock SettingsLib ThemedBatteryDrawable to this SystemUI-local one
(WIDTH/HEIGHT renamed DEFAULT_WIDTH/DEFAULT_HEIGHT upstream since
they're now overlay-configurable, not fixed constants).

UnifiedBattery.kt: BatteryLayout branches on iconStyleProvider; themed
renders via ThemedBatteryBody under a new LayoutId.FrameThemed that
scales to the drawable's real intrinsic aspect ratio instead of
assuming the stock frame's fixed aspect. BatteryRepository /
BatteryInteractor / BatteryViewModel: plumb batteryIconStyle through
the existing hydrator pattern, same shape as
isShowBatteryPercentSettingEnabled right above each addition.

Confirmed live on pawlet_rpi4 hardware (2026-10-17): idmap resolves
BatteryStyleOneUI7Overlay against com.android.systemui with zero
missing resources, status bar battery icon renders the overlay's
actual capsule perimeter path when SystemUI boots with the overlay
already enabled (toggling after boot doesn't take effect --
BatteryRepositoryImpl reads the resource once at construction, no
ContentObserver, matching that there's no runtime switcher).
2026-10-17 22:49:09 -07:00
..
2025-09-05 10:30:33 -07:00