A battery-frugal monitor for Huawei watches and HMS phones.
Watches the watcher. Samples
batteryInfoon a Huawei smartwatch, ships it over HMS Wear Engine to a Huawei phone, and draws the drain curve. Designed so the monitor itself costs less than 0.5%/24h.
AccuBattery, BatteryGuru, BetterBatteryStats β none of them ship on HMS-only Huawei phones because there is no GMS, no Play Store, no Firebase. The market gap is real, and a battery monitor that itself drains the battery is a joke. LeakWatch is built on three principles:
- Frugal by default. Hard-mode sampling, batched flush, listener-driven (not polled).
- HMS-native. No GMS, no Firebase. HMS Wear Engine, HMS Analytics, HMS Crash.
- Open, on Huawei's terms. Apache-2.0, lives on the AppGallery when it's ready.
The name is a double meaning: leak (battery leak) + watch (the wrist thing).
| Component | Status | Notes |
|---|---|---|
| Huawei Watch 5 / GT 5 Pro (HarmonyOS NEXT) | β Target | ArkTS, @ohos.batteryInfo |
| Huawei Watch GT 4 / Watch 4 (HarmonyOS 4) | π‘ Planned | AOSP-compat layer; verify batteryInfo parity |
| Huawei phone with HMS (no GMS) | β Target | Kotlin + Compose + HMS Core |
| Huawei phone with GMS (e.g. P30 global) | β Out of scope | Use AccuBattery instead |
| Non-Huawei Android | β Out of scope | HMS is the whole point |
| iOS | β Out of scope | No HMS path |
ββββββββββββββββββββ Wear Engine P2P ββββββββββββββββββββ
β Huawei Watch β ββββββββββββββββββββββΆ β Huawei Phone β
β (ArkTS) β batched every 10min β (Kotlin) β
β β β β
β BatteryMonitor β β WearEngine β
β + RDB history β β Receiver β
β + Service Ext. β β + Room β
ββββββββββββββββββββ β + Compose chart β
ββββββββββββββββββββ
- Watch side samples
batterySOC,chargingStatus,batteryTemperature,voltageevery 120s (not 60s) and flushes batches every 10min over HMS Wear Engine P2P once the watch sender is verified on device. - Phone side persists, aggregates daily, and draws the drain curve with a Compose Canvas chart.
- No foreground service on the watch.
Service Extension+ work scheduling only. - Total target drain: < 0.5%/24h on the watch; measured device evidence is still pending in
docs/BATTERY_BUDGET.md.
Full architecture: docs/ARCHITECTURE.md.
Alpha (v0.4.0). Watch battery monitor, phone analytics, and the phone-side HMS receiver are in place; real watchβphone E2E remains pending device verification. Next milestones:
-
v0.1.0-alphaβ Watch-sideBatteryMonitorsampling loop (ArkTS) + RDB -
v0.2.0-alphaβ Phone-side Wear Engine receiver + Room persistence -
v0.3.0-alphaβ Compose chart, daily aggregation, drain rate -
v0.4.0-alphaβ HMS Wear Engine phone receiver implementation (v0.4.0-alpha.1 tagged; watch sender/device E2E pending) -
v0.5.0-alphaβ Privacy policy + AppGallery submission -
v1.0.0β First public release
See CHANGELOG.md for what landed when.
| Layer | Choice | Why |
|---|---|---|
| Watch (ArkTS) | @ohos.batteryInfo + RelationalStore |
First-party, no permissions, API 6+ |
| Watch β Phone | HMS Wear Engine 5.0.1.300 | P2P, idiomatic, exposes wearable battery |
| Phone (Kotlin) | 2.0 + Jetpack Compose Material 3 | Modern, Marian-familiar |
| Phone storage | Room 2.6.1 | Reliable, KSP-friendly |
| Phone charts | Compose Canvas | Buildable lightweight chart; Vico may return later on a pinned version |
| HMS analytics | HMS Analytics 6.13 + HMS Crash | Replaces Firebase |
| Build (watch) | Hvigor 5.1.0+ | DevEco Studio standard |
| Build (phone) | Gradle 8.7 + AGP 8.5 | Standard Android toolchain |
β οΈ Alpha code exists. Thewatch/andphone/modules build through CI structure/Android gates, but real device E2E still requires AGC Wear Engine setup and watch-side verification.
- DevEco Studio 5.1.0+ (HarmonyOS NEXT) β for the watch module
- Android Studio Koala+ with HMS Toolkit plugin β for the phone module
- JDK 17+, Node.js 20+ (for tooling)
- A Huawei Developer account β to apply for HMS Wear Engine Kit in AppGallery Connect
git clone https://github.com/halaprix/leakwatch
cd leakwatch
# Phone module: open phone/ in Android Studio or run Gradle with JDK 17.
# Watch module: open watch/ in DevEco Studio.
# Real P2P requires AGC Wear Engine approval and local, uncommitted config.We welcome issues, PRs, and watch reports. Read CONTRIBUTING.md first β Conventional Commits are mandatory and one-commit-per-fix is the rule.
This project follows the Contributor Covenant v2.1. Be excellent to each other.
See SECURITY.md for the security policy and docs/PRIVACY.md for the AppGallery privacy-policy skeleton. LeakWatch does not collect personal data, does not phone home beyond HMS Analytics, and does not store anything outside the device unless you opt in.
Apache License 2.0 β consistent with HMS-Wearable-Example and friendly to HMS ecosystem contributors.
- Issues: github.com/halaprix/leakwatch/issues
- Marian (maintainer): github.com/halaprix
- HMS reference patterns:
ferPrieto/HMS-Wearable-Example,Explore-In-HMOS-Wearable/smart-reminder