summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/DeviceConfigFacade.java15
-rw-r--r--service/java/com/android/server/wifi/WifiScoreReport.java19
2 files changed, 30 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/DeviceConfigFacade.java b/service/java/com/android/server/wifi/DeviceConfigFacade.java
index 3856ff1fd..a7bcfc764 100644
--- a/service/java/com/android/server/wifi/DeviceConfigFacade.java
+++ b/service/java/com/android/server/wifi/DeviceConfigFacade.java
@@ -139,6 +139,9 @@ public class DeviceConfigFacade {
// depends on the score evaluation period normally controlled by
// 'com.android.wifi.resources.R' config_wifiPollRssiIntervalMilliseconds.
static final int DEFAULT_MIN_CONFIRMATION_DURATION_SEND_HIGH_SCORE_MS = 0;
+ // Default RSSI threshold in dBm above which low score is not sent to connectivity service
+ // when external scorer takes action.
+ static final int DEFAULT_RSSI_THRESHOLD_NOT_SEND_LOW_SCORE_TO_CS_DBM = -67;
// Cached values of fields updated via updateDeviceConfigFlags()
private boolean mIsAbnormalConnectionBugreportEnabled;
private int mAbnormalConnectionDurationMs;
@@ -189,6 +192,7 @@ public class DeviceConfigFacade {
private int mHealthMonitorFwAlertValidTimeMs;
private int mMinConfirmationDurationSendLowScoreMs;
private int mMinConfirmationDurationSendHighScoreMs;
+ private int mRssiThresholdNotSendLowScoreToCsDbm;
public DeviceConfigFacade(Context context, Handler handler, WifiMetrics wifiMetrics) {
mContext = context;
@@ -342,6 +346,9 @@ public class DeviceConfigFacade {
mMinConfirmationDurationSendHighScoreMs = DeviceConfig.getInt(NAMESPACE,
"min_confirmation_duration_send_high_score_ms",
DEFAULT_MIN_CONFIRMATION_DURATION_SEND_HIGH_SCORE_MS);
+ mRssiThresholdNotSendLowScoreToCsDbm = DeviceConfig.getInt(NAMESPACE,
+ "rssi_threshold_not_send_low_score_to_cs_dbm",
+ DEFAULT_RSSI_THRESHOLD_NOT_SEND_LOW_SCORE_TO_CS_DBM);
}
private Set<String> getUnmodifiableSetQuoted(String key) {
@@ -706,4 +713,12 @@ public class DeviceConfigFacade {
public int getMinConfirmationDurationSendHighScoreMs() {
return mMinConfirmationDurationSendHighScoreMs;
}
+
+ /**
+ * Gets the RSSI threshold above which low score is not sent to connectivity service when
+ * external scorer takes action.
+ */
+ public int getRssiThresholdNotSendLowScoreToCsDbm() {
+ return mRssiThresholdNotSendLowScoreToCsDbm;
+ }
}
diff --git a/service/java/com/android/server/wifi/WifiScoreReport.java b/service/java/com/android/server/wifi/WifiScoreReport.java
index 89f0445cb..e918b73d5 100644
--- a/service/java/com/android/server/wifi/WifiScoreReport.java
+++ b/service/java/com/android/server/wifi/WifiScoreReport.java
@@ -189,14 +189,25 @@ public class WifiScoreReport {
&& mContext.getResources().getBoolean(
R.bool.config_wifiMinConfirmationDurationSendNetworkScoreEnabled)) {
long millis = mClock.getWallClockMillis();
- if (mLastScoreBreachLowTimeMillis != INVALID_WALL_CLOCK_MILLIS
- && (millis - mLastScoreBreachLowTimeMillis)
- < mDeviceConfigFacade.getMinConfirmationDurationSendLowScoreMs()) {
- return;
+ if (mLastScoreBreachLowTimeMillis != INVALID_WALL_CLOCK_MILLIS) {
+ if (mWifiInfo.getRssi()
+ >= mDeviceConfigFacade.getRssiThresholdNotSendLowScoreToCsDbm()) {
+ Log.d(TAG, "Not reporting low score because RSSI is high "
+ + mWifiInfo.getRssi());
+ return;
+ }
+ if ((millis - mLastScoreBreachLowTimeMillis)
+ < mDeviceConfigFacade.getMinConfirmationDurationSendLowScoreMs()) {
+ Log.d(TAG, "Not reporting low score because elapsed time is shorter than "
+ + "the minimum confirmation duration");
+ return;
+ }
}
if (mLastScoreBreachHighTimeMillis != INVALID_WALL_CLOCK_MILLIS
&& (millis - mLastScoreBreachHighTimeMillis)
< mDeviceConfigFacade.getMinConfirmationDurationSendHighScoreMs()) {
+ Log.d(TAG, "Not reporting high score because elapsed time is shorter than "
+ + "the minimum confirmation duration");
return;
}
}