summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Lau <billylau@google.com>2015-08-01 18:20:04 +0100
committerBilly Lau <billylau@google.com>2015-08-07 19:00:49 +0100
commit76502788598a85d24b9ae3e253016a9370c49a42 (patch)
tree06f10f8f1fba60cc82702c3704162b29c43772cf
parent0e47a8aae62e79d80db150bdde3298a100ab2d03 (diff)
downloadethernet-marshmallow-dev.tar.gz
Replaced the method where we used to enforce static permission CHANGE_NETWORK_STATE to method calls that also check for WRITE_SETTINGS. This is due to the merging of CHANGE_NETWORK_STATE permission with WRITE_SETTINGS in M. Change-Id: I104ac41733663b4f6b5cd30e7314574ec4acdc07
-rw-r--r--java/com/android/server/ethernet/EthernetServiceImpl.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/java/com/android/server/ethernet/EthernetServiceImpl.java b/java/com/android/server/ethernet/EthernetServiceImpl.java
index bb1cc51..0c84bef 100644
--- a/java/com/android/server/ethernet/EthernetServiceImpl.java
+++ b/java/com/android/server/ethernet/EthernetServiceImpl.java
@@ -28,6 +28,7 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.provider.Settings;
import android.util.Log;
import android.util.PrintWriterPrinter;
@@ -74,9 +75,9 @@ public class EthernetServiceImpl extends IEthernetManager.Stub {
}
private void enforceChangePermission() {
- mContext.enforceCallingOrSelfPermission(
- android.Manifest.permission.CHANGE_NETWORK_STATE,
- "EthernetService");
+ int uid = Binder.getCallingUid();
+ Settings.checkAndNoteChangeNetworkStateOperation(mContext, uid, Settings
+ .getPackageNameForUid(mContext, uid), true);
}
private void enforceConnectivityInternalPermission() {