0

Is there an Android shell command that can get the current status of Immersive Mode (i.e. immersive.full, immersive.status, immersive.navigation, or immersive.off)?

Immersive mode can be set via the shell command settings put global policy_control immersive.full=*, and other system statuses can be queried via shell (e.g. get current brightness level with settings get system screen_brightness). However, I can't figure out what command would return the current status of immersive mode. The goal is to programmatically detect if an app is currently in immersive mode (for use with automation apps like Tasker and Macrodroid).

I've tried various combinations of commands that sound likely, like: settings get system immersivemode, settings get system immersive_mode, settings get global policy_control, but most of these return syntax errors, as I don't really know what I'm looking for. Any suggestions?

ETL
  • 188
  • 10

1 Answers1

2

If you use settings put global policy_control immersive.full=* all apps will enter in this policy due to you are using a wildcard *

You have to indicate in which apps you want to apply the policy something like this settings put global policy_control immersive.full=com.package.app

Also if you want to apply the policy to all apps but no for some, something like this settings put global policy_control immersive.full=apps,-com.android.settings,-com.package.app

If you want to get the value from this you have to use verb get rather than put

For example, you can try settings get global policy_control and output will be the value you set using put, using last example, the output will be immersive.full=apps,-com.android.settings,-com.package.app

Hope this help you :)

PS. Check last command syntax, I'm using it without issue Command output

PS2. This policy is not working on Android 11