Repository navigation
Conversation
…re#7150) Add native Android AppWidget (OmiBatteryWidgetProvider) displaying live Omi device connection status, battery percentage, and microphone mute state, mirroring the iOS BatteryWidget capability. - Implement OmiBatteryWidgetProvider with RemoteViews layout, appwidget info metadata, and manifest receiver registration - Implement com.omi.battery_widget MethodChannel in MainActivity.kt - Update BatteryWidgetService platform guard to support Android - Add unit tests for BatteryWidgetService covering channel invocation, singleton identity, and error resilience Closes BasedHardware#7150 Failure-Class: none PayPal: rwilcox413@gmail.com
|
Thanks @TheRWX — this is a well-put-together parity piece for #7150, and the bridge design mirrors the iOS side cleanly. I reviewed all ten files; no blocking issues found. What I verified:
Minor polish, none blocking:
Leaving for human maintainer review before merge: this is a new user-facing home-screen surface, so the product/design calls (dark-only theme, post-reboot refresh behavior, picker preview) should get a maintainer's sign-off. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (Android home screen battery/status widget) — approve only per policy; needs-maintainer-review, BLOCKED.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (Android home screen battery/status widget) — approve-only per policy.
|
Reviewed this alongside the existing approvals — the implementation looks solid. Notes per file:
No blocking issues found. The tests are the only thing between this and being fully merge-ready in my view. Thanks for the careful, well-scoped parity work. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Feature (Android home screen battery/status widget) — approve-only per policy, not a bug fix. CI green.
kodjima33
left a comment
There was a problem hiding this comment.
Feature (Android home-screen battery widget) — approve-only per confidence gate (feature, not a bug fix; also needs-tests).
Summary
Fixes #7150
Adds a native Android Home Screen Widget (
OmiBatteryWidgetProvider) displaying live Omi device connection status, battery percentage, and microphone mute state, achieving feature parity with the iOSBatteryWidget.Key Changes
OmiBatteryWidgetProviderinapp/android/app/src/main/kotlin/com/friend/ios/widget/OmiBatteryWidgetProvider.kt.res/layout/omi_battery_widget.xml) featuring Omi logo, device name, battery percentage indicator, and mic/mute status icon.ic_widget_mic.xmlandic_widget_mic_off.xmlwith neutral dark theme backgroundwidget_background.xml(no purple, conforming strictly with brand invariants).res/xml/omi_battery_widget_info.xml.AndroidManifest.xml.com.omi.battery_widgetMethodChannelinMainActivity.ktforupdateBatteryInfoandupdateMuteState, safely parsing battery numbers and triggeringAppWidgetManagerredraws.BatteryWidgetServiceinapp/lib/services/battery_widget_service.dartto support both iOS and Android platforms (if (!Platform.isIOS && !Platform.isAndroid) return;).app/test/unit/battery_widget_service_test.dartverifying singleton guarantees, channel invocations, and graceful exception resilience.Verification & Testing
app/test/unit/battery_widget_service_test.dart):BatteryWidgetService singleton instance returns identical reference: PASSEDBatteryWidgetService updateBatteryInfo invokes method channel with correct arguments: PASSEDBatteryWidgetService updateMuteState executes safely: PASSEDBatteryWidgetService recovers safely from channel platform exceptions without throwing: PASSEDflutter analyzeon modified Dart files: 0 issues found.scripts/pr-preflightverified cleanly.Failure-Class: none
PayPal: rwilcox413@gmail.com