summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2018-07-26 15:16:47 -0700
committerMichael Plass <mplass@google.com>2018-07-30 11:11:56 -0700
commitfd36545e4ae8a47b46b0d4eef2298f58b6a35f51 (patch)
treea73fa0ac79cdeb2fe06d723a3e95db8be68a30cf /service
parent77021f9c7b1f80ccf288ca60fbf8296a36d25039 (diff)
Restrict wifi RSSI broadcasts
Broadcast receiver must have ACCESS_WIFI_STATE. The broadcast is no longer sticky. Bug: 111698366 Test: Unit tests Test: Manually check that an app without ACCESS_WIFI_STATE does not see WifiManager.RSSI_CHANGED_ACTION broadcasts. Change-Id: I8b4ff0492f1d5150b49f10032767cf66f0197b70
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java
index e7f71b331..a2d029156 100644
--- a/service/java/com/android/server/wifi/ClientModeImpl.java
+++ b/service/java/com/android/server/wifi/ClientModeImpl.java
@@ -2672,7 +2672,8 @@ public class ClientModeImpl extends StateMachine {
Intent intent = new Intent(WifiManager.RSSI_CHANGED_ACTION);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
intent.putExtra(WifiManager.EXTRA_NEW_RSSI, newRssi);
- mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
+ mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
+ android.Manifest.permission.ACCESS_WIFI_STATE);
}
private void sendNetworkStateChangeBroadcast(String bssid) {
@@ -3810,9 +3811,6 @@ public class ClientModeImpl extends StateMachine {
void registerConnected() {
if (mLastNetworkId != WifiConfiguration.INVALID_NETWORK_ID) {
mWifiConfigManager.updateNetworkAfterConnect(mLastNetworkId);
- // On connect, reset wifiScoreReport
- mWifiScoreReport.reset();
-
// Notify PasspointManager of Passpoint network connected event.
WifiConfiguration currentNetwork = getCurrentWifiConfiguration();
if (currentNetwork != null && currentNetwork.isPasspoint()) {
@@ -4956,6 +4954,7 @@ public class ClientModeImpl extends StateMachine {
mRssiPollToken++;
if (mEnableRssiPolling) {
// First poll
+ mLastSignalLevel = -1;
fetchRssiLinkSpeedAndFrequencyNative();
sendMessageDelayed(obtainMessage(CMD_RSSI_POLL, mRssiPollToken, 0),
mPollRssiIntervalMsecs);
@@ -5324,6 +5323,8 @@ public class ClientModeImpl extends StateMachine {
registerConnected();
mLastConnectAttemptTimestamp = 0;
mTargetWifiConfiguration = null;
+ mWifiScoreReport.reset();
+ mLastSignalLevel = -1;
// Not roaming anymore
mIsAutoRoaming = false;