This change allows the system to perform iterative reset of changes to settings in order to recover from bad a state such as a reboot loop. To enable this we add the notion of a default value. The default can be set by any package but if the package that set it is a part of the system, i.e. trusted, then other packages that are not a part of the system, i.e. untrusted, cannot change the default. The settings setter APIs that do not take a default effectively clear the default. Putting a setting from a system component always makes it the default and if the package in not trusted then value is not made the default. The rationale is that the system is tested and its values are safe but third-party components are not trusted and their values are not safe. The reset modes from the least intrusive are: untrusted defaults - reset only settings set by untrusted components to their defaults or clear them otherwise; untrusted clear - clear settings set by untrusted components (or snap to default if provided by the system); trusted defaults - reset all settings to defaults set by the system or clear them otherwise. Also a package can reset to defaults changes it made to the global and secure settings. It is also possible to associate a setting with an optional token which can then be used to reset settings set by this package and associated with the token allowing parallel experiments over disjoint settings subsets. The default values are also useful for experiment (or more precisely iterative tuning of devices' behavior in production) as the stable configuration can be set to the "graduated" safe defaults and set the values to the experimental ones to measure impact. Test: tests pass Change-Id: I838955ea3bb28337f416ee244dff2fb1199b6943
37 lines
1.5 KiB
XML
37 lines
1.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- Copyright (C) 2015 The Android Open Source Project
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
package="com.android.providers.setting.test">
|
|
|
|
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
|
|
|
|
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
|
|
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
|
|
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
|
|
<uses-permission android:name="android.permission.MANAGE_USERS"/>
|
|
|
|
<application>
|
|
<uses-library android:name="android.test.runner" />
|
|
</application>
|
|
|
|
<instrumentation
|
|
android:name="android.support.test.runner.AndroidJUnitRunner"
|
|
android:targetPackage="com.android.providers.setting.test"
|
|
android:label="Settings Provider Tests" />
|
|
|
|
</manifest>
|