Repository navigation
Open
Description
Depends on #2.
Goal
Change the config without touching the phone, using standards only.
- Android managed configurations (app restrictions): the standard way for an MDM / EMM to push app settings. Declare the config keys in
app_restrictions.xml; read them withRestrictionsManager; listen forACTION_APPLICATION_RESTRICTIONS_CHANGED. - OpAMP (spec) with the
opamp-clientmodule of opentelemetry-java-contrib (io.opentelemetry.contrib:opentelemetry-opamp-client), over WebSocket. The spike (Spike: OTel disk buffer for metrics, 24 h on HyperOS, OpAMP on Android, OTLP into VictoriaMetrics #1) showed it works on Android: it received a config, applied it and reported the hash. The server sends the config document of MVP: battery, power, boot, network, device and thermal collectors; local config; OTLP export with disk buffer #2; the app applies it, reports the effective config hash, and reports its health (version, last export time, buffer size).
Order, later wins: defaults → local file → managed configurations → OpAMP. A bad remote config (does not parse, or no endpoint) is refused, reported back, and the last good one stays.
From the spike (#1)
- The new interval starts with the next tick, not at once. That is fine.
- After an app restart, the opamp-go example server offered the empty config again, and the client reported it as APPLIED. The app must keep its last good config on the phone and not treat an empty remote config as "back to defaults".
- The OpAMP client pulls a newer OpenTelemetry API than opentelemetry-android is built on; mixed versions crashed at start. Keep the core artifacts pinned to one version (
enforcedPlatform), as MVP: battery, power, boot, network, device and thermal collectors; local config; OTLP export with disk buffer #2 does. wake_policy(MVP: battery, power, boot, network, device and thermal collectors; local config; OTLP export with disk buffer #2) is one of the keys: inapp_restrictions.xmland in the OpAMP config.
Done when
- Managed configurations: tested with Android's TestDPC (or
adbwith a test device owner); a changed interval takes effect without a restart. Steps in the README. - OpAMP: against opamp-go's example server, a new config is applied, and the server shows the reported hash and health. Steps in the README.
- A broken remote config is refused, reported, and the old one stays (test).
- The status screen shows each value's source (default / file / managed / OpAMP).
-
wake_policyset by managed configurations and by OpAMP takes effect (test). - An empty remote config after a reconnect or restart keeps the last good config (test).
- OpAMP can be turned off; when off, the app makes no OpAMP connection.
Metadata
Metadata
Assignees
Labels
No labels
Activity
groupsky commentedon Nov 10, 2026
Not queued yet: it waits for #2 (MVP). The spike (#1) is done (2026-11-12) and #2 is queued (2026-11-13). A work job is added when #2 is closed.