diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-10-15 16:29:00 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-10-22 08:33:45 +0900 |
commit | d54270506669e474b5b8d1703212c77780a04ae9 (patch) | |
tree | 404247ea86ef12fe66b445b18dab7c43cef96e0f /services | |
parent | 46d50b708de20e2a26a61ba516c524841b4e11dc (diff) | |
download | frameworks_base-d54270506669e474b5b8d1703212c77780a04ae9.zip frameworks_base-d54270506669e474b5b8d1703212c77780a04ae9.tar.gz frameworks_base-d54270506669e474b5b8d1703212c77780a04ae9.tar.bz2 |
Reinstate CHANGE_NETWORK_STATE as a normal permission.
This is a partial revert of http://ag/738523 , but not a full
revert because M apps that have gone through the WRITE_SETTINGS
route to obtain permission to change network state should
continue to have permission to do so.
Specifically:
1. Change the protection level of CHANGE_NETWORK_STATE back from
"signature|preinstalled|appop|pre23" to "normal". This allows
apps that declare CHANGE_NETWORK_STATE in their manifest to
acquire it, even if they target the M SDK or above.
2. Change the ConnectivityManager permission checks so that they
first check CHANGE_NETWORK_STATE, and then ask Settings
if the app has the WRITE_SETTINGS runtime permission.
3. Slightly simplify the code in the Settings provider code that
deals specifically with the ability to change network state.
4. Make the ConnectivityService permissions checks use the
ConnectivityManager code to avoid code duplication.
5. Update the ConnectivityManager public Javadoc to list both
CHANGE_NETWORK_STATE and WRITE_SETTINGS.
Bug: 21588539
Bug: 23597341
Change-Id: Ic06a26517c95f9ad94183f6d126fd0de45de346e
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 3860005..327fb8a 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1447,10 +1447,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } private void enforceChangePermission() { - int uid = Binder.getCallingUid(); - Settings.checkAndNoteChangeNetworkStateOperation(mContext, uid, Settings - .getPackageNameForUid(mContext, uid), true); - + ConnectivityManager.enforceChangePermission(mContext); } private void enforceTetherAccessPermission() { |