summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2020-06-17 19:50:02 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-17 19:50:02 +0000
commit077100f5a1c9a99c040e4e4ac1c9695aa15b3100 (patch)
treed4fd2899c97e3766bb554cd331e696b6bb172fb8 /service
parent60fe6d3c138b185eef4c3eef8095827df07c03f4 (diff)
parentd696694b98f70b7d6ec2c66f0349e557e5c5b6b0 (diff)
RESTRICT AUTOMERGE WIFI_CREDENTIAL_CHANGED_ACTION: only broadcast SSID if location mode is enabled & receiver has location permissions am: d696694b98
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/net/wifi/+/11855990 Change-Id: I3db914bd1dd34bc665c723273e987910ddff9a73
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index f09218ab9..82851b238 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -5808,12 +5808,17 @@ public class ClientModeImpl extends StateMachine {
private void broadcastWifiCredentialChanged(int wifiCredentialEventType,
WifiConfiguration config) {
Intent intent = new Intent(WifiManager.WIFI_CREDENTIAL_CHANGED_ACTION);
- if (config != null && config.SSID != null) {
+ if (config != null && config.SSID != null && mWifiPermissionsUtil.isLocationModeEnabled()) {
intent.putExtra(WifiManager.EXTRA_WIFI_CREDENTIAL_SSID, config.SSID);
}
intent.putExtra(WifiManager.EXTRA_WIFI_CREDENTIAL_EVENT_TYPE, wifiCredentialEventType);
- mContext.sendBroadcastAsUser(intent, UserHandle.CURRENT,
- android.Manifest.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE);
+ mContext.createContextAsUser(UserHandle.CURRENT, 0)
+ .sendBroadcastWithMultiplePermissions(
+ intent,
+ new String[]{
+ android.Manifest.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE,
+ android.Manifest.permission.ACCESS_FINE_LOCATION,
+ });
}
void handleGsmAuthRequest(SimAuthRequestData requestData) {