执行android settings命令报错原因Exception occurred while executing 'put': java.lang.SecurityException: Pe...

在adb shell执行settings put secure num_rotation_suggestions_accepted 0命令禁用屏幕旋转提示报错如下:

Exception occurred while executing 'put':
  java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
  at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2374)
  at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1777)
  at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1728)
  at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:511)

在开发者选项中开启 禁止权限监控(OPPO、Realme手机),再次执行就没问题。

你可能感兴趣的:(执行android settings命令报错原因Exception occurred while executing 'put': java.lang.SecurityException: Pe...)