diff options
author | Philip P. Moltmann <moltmann@google.com> | 2020-03-13 14:26:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-13 14:26:30 +0000 |
commit | 5e1e7aa6a606e55570608ea0c089e3b55381eb27 (patch) | |
tree | 08ef170f273073d07d9592e1c2c95057373664bd | |
parent | d1e13d53beb6e596d47fb65188dd973bf888e5fa (diff) | |
parent | 13e30cac32b9579bf348b6db75f1e6c7d686961d (diff) |
Merge "Rename featureId -> attributionTag" into rvc-dev
4 files changed, 12 insertions, 12 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java index e009f7257..bb89d3a64 100644 --- a/service/java/com/android/server/wifi/WifiServiceImpl.java +++ b/service/java/com/android/server/wifi/WifiServiceImpl.java @@ -565,7 +565,7 @@ public class WifiServiceImpl extends BaseWifiService { // Someone requested a scan while we were idle; do a full scan now. // A security check of the caller's identity was made when the request arrived via // Binder. Now we'll pass the current process's identity to startScan(). - startScan(mContext.getOpPackageName(), mContext.getFeatureId()); + startScan(mContext.getOpPackageName(), mContext.getAttributionTag()); } } diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java index e43bcf4b5..00c58aa78 100644 --- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java +++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java @@ -4166,7 +4166,7 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { if (clientInfo != null) { return clientInfo.mFeatureId; } - if (uid == Process.SYSTEM_UID) return mContext.getFeatureId(); + if (uid == Process.SYSTEM_UID) return mContext.getAttributionTag(); return null; } diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java index 1e67dd584..b81c842e4 100644 --- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java +++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java @@ -118,11 +118,11 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { @Override public Bundle getAvailableChannels(@WifiBand int band, String packageName, - @Nullable String featureId) { + @Nullable String attributionTag) { int uid = Binder.getCallingUid(); long ident = Binder.clearCallingIdentity(); try { - enforcePermission(uid, packageName, featureId, false, false, false); + enforcePermission(uid, packageName, attributionTag, false, false, false); } finally { Binder.restoreCallingIdentity(ident); } @@ -171,9 +171,9 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { return bundle.getString(WifiScanner.REQUEST_PACKAGE_NAME_KEY); } - // For non-privileged requests, retrieve the bundled featureId name for app-op & permission + // For non-privileged requests, retrieve the bundled attributionTag name for app-op & permission // checks. - private String getFeatureId(Message msg) { + private String getAttributionTag(Message msg) { if (!(msg.obj instanceof Bundle)) { return null; } @@ -204,7 +204,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { * @see #enforcePermission(int, String, String, boolean, boolean, boolean) */ private void enforcePermission(int uid, Message msg) throws SecurityException { - enforcePermission(uid, getPackageName(msg), getFeatureId(msg), + enforcePermission(uid, getPackageName(msg), getAttributionTag(msg), isPrivilegedMessage(msg.what), shouldIgnoreLocationSettingsForSingleScan(msg), shouldHideFromAppsForSingleScan(msg)); } @@ -217,12 +217,12 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { * b) Can never make one of the privileged requests. * @param uid uid of the client * @param packageName package name of the client - * @param featureId The feature in the package of the client + * @param attributionTag The feature in the package of the client * @param isPrivilegedRequest whether we are checking for a privileged request * @param shouldIgnoreLocationSettings override to ignore location settings * @param shouldHideFromApps override to hide request from AppOps */ - private void enforcePermission(int uid, String packageName, @Nullable String featureId, + private void enforcePermission(int uid, String packageName, @Nullable String attributionTag, boolean isPrivilegedRequest, boolean shouldIgnoreLocationSettings, boolean shouldHideFromApps) { try { @@ -234,8 +234,8 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { // Privileged message, only requests from clients with NETWORK_STACK allowed! throw e; } - mWifiPermissionsUtil.enforceCanAccessScanResultsForWifiScanner(packageName, featureId, - uid, shouldIgnoreLocationSettings, shouldHideFromApps); + mWifiPermissionsUtil.enforceCanAccessScanResultsForWifiScanner(packageName, + attributionTag, uid, shouldIgnoreLocationSettings, shouldHideFromApps); } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index a3a19d233..be3924709 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -390,7 +390,7 @@ public class WifiServiceImplTest extends WifiBaseTest { // Create an OSU provider that can be provisioned via an open OSU AP mOsuProvider = PasspointProvisioningTestUtil.generateOsuProvider(true); when(mContext.getOpPackageName()).thenReturn(TEST_PACKAGE_NAME); - when(mContext.getFeatureId()).thenReturn(TEST_FEATURE_ID); + when(mContext.getAttributionTag()).thenReturn(TEST_FEATURE_ID); when(mContext.checkPermission(eq(android.Manifest.permission.NETWORK_SETTINGS), anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_DENIED); when(mContext.checkPermission(eq(android.Manifest.permission.NETWORK_SETUP_WIZARD), |