summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2015-11-24 11:31:13 -0800
committerThe Android Automerger <android-build@google.com>2016-02-16 12:28:39 -0800
commit1edd645dd50fdbacd287af489ba0a4ad912bbd1c (patch)
treea265d338334e1cc44df210e35787d292acf7adf1 /src
parentf4b8ad6c3105fa17fba85e852b710e48aaf0794d (diff)
downloadpackages_apps_Settings-1edd645dd50fdbacd287af489ba0a4ad912bbd1c.tar.gz
packages_apps_Settings-1edd645dd50fdbacd287af489ba0a4ad912bbd1c.tar.bz2
packages_apps_Settings-1edd645dd50fdbacd287af489ba0a4ad912bbd1c.zip
DO NOT MERGE Modify system settings: incorrect UI state
The privilege for an app to write to the system settings is protected by an app-op signature permission. App-op permissions are special: if the app-op is deny/allow we deny/allow write access; if the app-op is default holding the permission determies write access. The settings code assumes that CHANGE_NETWORK_STATE is an app op permission (system|appop) while it is a normal permission which any app gets by declaring it used in the manifest. The side effect is that the state of the toggle in the UI for write system settings will initially be in the wrong state if the app uses both WRITE_SETTINGS and CHANGE_NETWORK_STATE. However, the code in the public API an app uses to check write settings access would return the opposite since it checks the WRITE_SETTINGS permission and its app op. Hence, if an app requires write settings to start the user will see in the settings UI it has access but the app will not have access, so the app would prompt the user to allow write settings. The non-obvious fix is for the user to toggle the setting off and on to get the app op in the right state and be able to launch the app. bug:25843134 Change-Id: I3d726a66c7f9857bc7dbd5946fdbb8f340c6eb4d (cherry picked from commit 356fb2d10d9f4c236b0f10d0e2facb93028b9f3c) (cherry picked from commit 119d589ea5aa9c2ccc5164279d718a20d0865f20)
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/applications/AppStateWriteSettingsBridge.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/com/android/settings/applications/AppStateWriteSettingsBridge.java b/src/com/android/settings/applications/AppStateWriteSettingsBridge.java
index 7cdf7ea3f..ef743fa36 100644
--- a/src/com/android/settings/applications/AppStateWriteSettingsBridge.java
+++ b/src/com/android/settings/applications/AppStateWriteSettingsBridge.java
@@ -34,11 +34,9 @@ public class AppStateWriteSettingsBridge extends AppStateAppOpsBridge {
private static final String TAG = "AppStateWriteSettingsBridge";
private static final int APP_OPS_OP_CODE = AppOpsManager.OP_WRITE_SETTINGS;
private static final String PM_WRITE_SETTINGS = Manifest.permission.WRITE_SETTINGS;
- private static final String PM_CHANGE_NETWORK_STATE = Manifest.permission.CHANGE_NETWORK_STATE;
- // CHANGE_NETWORK_STATE is now merged with WRITE_SETTINGS
+
private static final String[] PM_PERMISSIONS = {
- PM_WRITE_SETTINGS,
- PM_CHANGE_NETWORK_STATE
+ PM_WRITE_SETTINGS
};
public AppStateWriteSettingsBridge(Context context, ApplicationsState appState, Callback