Write to Global Settings in Android 4.2

一个人想着一个人 提交于 2019-12-13 14:33:18

问题


Android 4.2 has introduced a new class, Settings.Global, which now holds some of the settings that used to be in Settings.Secure or Settings.System.

Writing to System Settings and Secure Settings was (and is) possible because or the WRITE_SETTINGS and WRITE_SECURE_SETTINGS permissions (see Manifest.permissions).

The thing is... is there any way to modify Global Settings? For example, Airplane mode could before be toggled from an app and now, since it's in Settings.Global, it does not seem possible :(

Thanks!


回答1:


AFAIK, you can modify Settings.Global the same way you modify Settings.Secure: by creating an app that is signed by the firmware's signing key or is installed on the system partition, so it can hold WRITE_SECURE_SETTINGS. The difference between Settings.Global and Settings.Secure, as I understand it, is that the latter is now on a per-user basis, while the global ones are device-wide.



来源:https://stackoverflow.com/questions/13416695/write-to-global-settings-in-android-4-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!