From f1a0272c0fb3f11bc338e97481d8cb73cfe74641 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 6 Jun 2017 09:19:25 -0700 Subject: WifiBackupRestore: Change to |NETWORK_SETTINGS| permission Use the new |NETWORK_SETTINGS| permission for all backup/restore changes. Bug: 62353755 Test: 'bmgr backup com.android.provider.settings' Test: 'bmgr restore com.android.provider.settings' Test: Unit tests Change-Id: I5c62ed1b4cb6a6445755aaf0fd1a3b67f0a25501 --- service/java/com/android/server/wifi/WifiServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index ec05f7cec..cded722e1 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -2495,8 +2495,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { */ @Override public byte[] retrieveBackupData() { - enforceReadCredentialPermission(); - enforceAccessPermission(); + enforceNetworkSettingsPermission(); mLog.trace("retrieveBackupData uid=%").c(Binder.getCallingUid()).flush(); if (mWifiStateMachineChannel == null) { Slog.e(TAG, "mWifiStateMachineChannel is not initialized"); @@ -2541,7 +2540,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { */ @Override public void restoreBackupData(byte[] data) { - enforceChangePermission(); + enforceNetworkSettingsPermission(); mLog.trace("restoreBackupData uid=%").c(Binder.getCallingUid()).flush(); if (mWifiStateMachineChannel == null) { Slog.e(TAG, "mWifiStateMachineChannel is not initialized"); @@ -2563,7 +2562,7 @@ public class WifiServiceImpl extends IWifiManager.Stub { * @param ipConfigData Raw byte stream of ipconfig.txt */ public void restoreSupplicantBackupData(byte[] supplicantData, byte[] ipConfigData) { - enforceChangePermission(); + enforceNetworkSettingsPermission(); mLog.trace("restoreSupplicantBackupData uid=%").c(Binder.getCallingUid()).flush(); if (mWifiStateMachineChannel == null) { Slog.e(TAG, "mWifiStateMachineChannel is not initialized"); -- cgit v1.2.3