写全局设置在Android 4.2 [英] Write to Global Settings in Android 4.2

查看:253
本文介绍了写全局设置在Android 4.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android 4.2版推出了一个新的类, Settings.Global ,它现在拥有一些曾经是在 Settings.Secure的设置 Settings.System

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.

写入系统设置和安全设置是(现在也是)可能的,因为还是WRITE_SETTINGS和WRITE_SECURE_SETTINGS权限(见的 Manifest.permissions )。

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

问题是...有什么办法来修改全局设置?例如,飞行模式可以前从应用程序切换而现在,因为它是在Settings.Global,它似乎并不可能:(

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 :(

谢谢!

推荐答案

据我所知,您可以修改 Settings.Global 修改以同样的方式设置.Secure :通过创建通过固件的签名密钥签署或安装在系统分区上的应用程序,所以它可以容纳 WRITE_SECURE_SETTINGS 。之间的差异 Settings.Global Settings.Secure ,我的理解是,是,现在后者是上每个用户的基础,而全球的是设备级。

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.

这篇关于写全局设置在Android 4.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆