How can I determine the value of the "always-on screen" Display user setting programmatically?

Viewed 77

My app requires the always-on screen, so I'd like to send users to the Display settings only in case they have their "always-on screen" set to false. How can I achieve that?

1 Answers

Sorry this is not a full solution, but I suspect with some heuristics you should be able to get quite close.

Not sure about checking directly, but indirectly you can probably detect the absence of Ambient mode.

https://developer.android.com/training/wearables/overlays/always-on

Look at AmbientModeSupport and WearableActivity.

If you don't receive these callbacks before a pause event, it's like that the Ambient mode is not enabled. And on next launch you can prompt the user.

There are examples for Compose and Views https://github.com/android/wear-os-samples/tree/main/AlwaysOnKotlin for Ambient mode.

Related