ADB: "adb shell wm size" brings a "android.permission.WRITE_SECURE_SETTINGS " error on Oppo A94 5G

1.7k views Asked by At

I am desperate a little to change the resolution on a not-rooted Oppo A94 5G with Minimal ADB & Fastboot. Same with an old LG G3 Mini works without problems.

But the A94 5G with Android 11 after the command:

adb shell wm size 1080x1440

I am getting the following error message:

Exception occurred while executing 'size': java.lang.SecurityException: Must hold permission android.permission.WRITE_SECURE_SETTINGS 
at com.android.server.wm.WindowManagerService.setForcedDisplaySize(WindowManagerService.java:5719) 
at com.android.server.wm.WindowManagerShellCommand.runDisplaySize(WindowManagerShellCommand.java:165) 
at com.android.server.wm.WindowManagerShellCommand.onCommand(WindowManagerShellCommand.java:71) 
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98) 
at android.os.ShellCommand.exec(ShellCommand.java:44) 
at com.android.server.wm.WindowManagerService.onShellCommand(WindowManagerService.java:1274) 
at android.os.Binder.shellCommand(Binder.java:936) 
at android.os.Binder.onTransact(Binder.java:820) 
at android.view.IWindowManager$Stub.onTransact(IWindowManager.java:2872) 
at com.android.server.wm.WindowManagerService.onTransact(WindowManagerService.java:1525) 
at com.android.server.wm.OppoWindowManagerService.onTransact(OppoWindowManagerService.java:185) 
at android.os.Binder.execTransactInternal(Binder.java:1166) 
at android.os.Binder.execTransact(Binder.java:1130)

Is this a possible way to change the size (resolution) and the density on Android 11 devices?, or do I have to start further steps to get the right permissions to change the size? or is it another fundamental problem?

1

There are 1 answers

2
michelangelo99 On

In the meantime i found the reason for this permission problem.

To fix it, enable ""Disable Permission Monitoring" (English) / "Erlaubnisüberwachung deaktivieren" in the developer options of the phone.

After that the size command works fine.