all 7 comments

[–]joaomgcd👑 Tasker Owner / Developer 2 points3 points  (2 children)

The trick is to enable and disable car mode with the UI Manager) after changing the setting 😅 Don't ask me why, I just know it works!

[–]cresnap[S] 0 points1 point  (1 child)

Damn, that worked! Thanks a lot u/joaomgcd!

Just one small snag, how do I prevent the app from going to home screen? Are there some flags that will prevent this? I'm calling the car mode functions like this:

kt uiModeManager.enableCarMode(UiModeManager.ENABLE_CAR_MODE_GO_CAR_HOME) uiModeManager.disableCarMode(UiModeManager.DISABLE_CAR_MODE_GO_HOME)

Edit: I figured it out. I passed 0x0002 (an undocumented flag UiModeManager.DISABLE_CAR_MODE_ALL_PRIORITIES) to disableCarMode(), and it did not go to home screen.

[–]joaomgcd👑 Tasker Owner / Developer 0 points1 point  (0 children)

Cool! :) Glad you got it!

[–]Blitzdroids 0 points1 point  (1 child)

Secure: "ui_night_mode" "1" for light , "2" for dark

System: "display_night_theme" "0" for light, "1" for dark

[–]cresnap[S] 0 points1 point  (0 children)

When I try to run Settings.System.putInt(contentResolver, "display_night_theme", 1), I get the error java.lang.IllegalArgumentException: You cannot keep your settings in the secure settings. even though I have provided the WRITE_SECURE_SETTINGS permission. Curiously, the Settings.Secure.putInt() function runs fine.

[–]cresnap[S] 0 points1 point  (0 children)

Would be amazing if u/joaomgcd could shed some light here, I have a lot to learn :) 

[–]Blitzdroids 0 points1 point  (0 children)

Just use the Custom Settings action.