I am using Linage 16 and there I have got enable navbar setting. I want to enable navbar using Tasker program. I have read some info here: Enable On-screen navigation in CM12 (Lollipop) using shell? . But I still don't understand how to make it.
1 Answers
This is interesting haven't tested this thoroughly but you can try this;
Tasker now has
WRITE_SECURE_SETTINGS
permission to the Manifest. Hence it is now easier to control device Secure/Global settings without needing an additional plug-in such as AutoTools or SecureTask.
You can enable this new permission by issuing the following command via ADB (important):
adb shell pm grant net.dinglisch.android.taskerm android.permission.WRITE_SECURE_SETTINGS
Now the business end you, since you want to use the Java function proceed as follows:
We need to call,
cr = CONTEXT.getContentResolver();
Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.DEV_FORCE_SHOW_NAVBAR, 1);)
As usual create a task to this this, name it accordingly.
The following actions are found under Code → Java function
A1: Java Function [ Return:cr
Class Or Object:CONTEXT
Function:getContentResolver {ContentResolver} ()
A2: Java Function [ Class Or Object:Secure
Function:putInt{boolean} (ContentResolver, String, int
) Param(ContentResolver): cr
Param(string):dev_force_show_navbar
Param:(int):1
Save and execute task to test
However I would have preferred a simpler route with run shell (Tasker) or adb:
A1: Code Run shell [Command: settings put secure dev_force_show_navbar 1
Tick Use root]
or
adb shell settings put secure dev_force_show_navbar 1

- 10,065
- 6
- 41
- 101
adb shell "settings put secure dev_force_show_navbar 1"
? – Izzy Oct 07 '18 at 18:37adb shell
it's unlikely the same command works from Tasker (if you referred to something other, please be more specific). What I could imagine (being with Android since v2.x) is that the Google devs again thought that's something a normal user should'nt be able to. Is your device rooted? Then you could try the same command after having executedsu
for super-user powers. – Izzy Oct 08 '18 at 04:30