diff options
author | David Su <dysu@google.com> | 2020-10-06 18:34:17 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-10-06 18:34:17 +0000 |
commit | b6935733de5e0207a3899d5b5803b8037ecba0df (patch) | |
tree | bd75c1d6ac0773ea3aa8284c7f8a75d57f21f09b | |
parent | aac9c6e11070c12ce250b647bfc345c273ad9e66 (diff) | |
parent | ff831c8e8dff31c14b418cce9cfd238f46f5152f (diff) |
WifiConfigManager: protect CONFIGURED_NETWORKS_CHANGED_ACTION with permissions am: ff831c8e8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/net/wifi/+/12735996
Change-Id: Ic908b2cae0fe34dbf991e6263f6dd1d50bf0ce66
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigManager.java | 8 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java index 59785fd87..0e07e086f 100644 --- a/service/java/com/android/server/wifi/WifiConfigManager.java +++ b/service/java/com/android/server/wifi/WifiConfigManager.java @@ -811,7 +811,13 @@ public class WifiConfigManager { maskPasswordsInWifiConfiguration(broadcastNetwork); intent.putExtra(WifiManager.EXTRA_WIFI_CONFIGURATION, broadcastNetwork); intent.putExtra(WifiManager.EXTRA_CHANGE_REASON, reason); - mContext.sendBroadcastAsUser(intent, UserHandle.ALL); + mContext.sendBroadcastAsUserMultiplePermissions( + intent, + UserHandle.ALL, + new String[]{ + android.Manifest.permission.ACCESS_WIFI_STATE, + android.Manifest.permission.ACCESS_FINE_LOCATION, + }); } /** diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java index fdcd948f9..7f10214be 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java @@ -4848,8 +4848,8 @@ public class WifiConfigManagerTest { private int verifyNetworkInBroadcastAndReturnReason(WifiConfiguration configuration) { ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class); ArgumentCaptor<UserHandle> userHandleCaptor = ArgumentCaptor.forClass(UserHandle.class); - mContextConfigStoreMockOrder.verify(mContext) - .sendBroadcastAsUser(intentCaptor.capture(), userHandleCaptor.capture()); + mContextConfigStoreMockOrder.verify(mContext).sendBroadcastAsUserMultiplePermissions( + intentCaptor.capture(), userHandleCaptor.capture(), any()); assertEquals(userHandleCaptor.getValue(), UserHandle.ALL); Intent intent = intentCaptor.getValue(); |