Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS

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
This commit is contained in:
Billy Lau
2015-08-01 18:20:04 +01:00
parent 9830ae6d92
commit 824a0a5050

View File

@@ -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() {