diff options
author | Oscar Shu <xshu@google.com> | 2020-12-09 01:03:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-12-09 01:03:15 +0000 |
commit | aeca95853e53db467c795572ca1d09e206daa53d (patch) | |
tree | a8cea50f0382315ac6cb5829955714051342d372 /wifi/java | |
parent | 8e179885441142abfc814b59cb1d0c35be129a09 (diff) | |
parent | 1d00c72e07fb3f85fb07f81ae3207e1f9a913fb7 (diff) |
Merge "Associate RSSI with UCC"
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 85b3170d59bd..271a73943425 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -1638,6 +1638,11 @@ public class WifiConfiguration implements Parcelable { private String mConnectChoice; /** + * The RSSI when the user made the connectChoice. + */ + private int mConnectChoiceRssi; + + /** * Used to cache the temporary candidate during the network selection procedure. It will be * kept updating once a new scan result has a higher score than current one */ @@ -1748,6 +1753,23 @@ public class WifiConfiguration implements Parcelable { mConnectChoice = newConnectChoice; } + /** + * Associate a RSSI with the user connect choice network. + * @param rssi signal strength + * @hide + */ + public void setConnectChoiceRssi(int rssi) { + mConnectChoiceRssi = rssi; + } + + /** + * @return returns the RSSI of the last time the user made the connect choice. + * @hide + */ + public int getConnectChoiceRssi() { + return mConnectChoiceRssi; + } + /** Get the current Quality network selection status as a String (for debugging). */ @NonNull public String getNetworkStatusString() { @@ -2051,6 +2073,7 @@ public class WifiConfiguration implements Parcelable { setCandidate(source.getCandidate()); setCandidateScore(source.getCandidateScore()); setConnectChoice(source.getConnectChoice()); + setConnectChoiceRssi(source.getConnectChoiceRssi()); setHasEverConnected(source.hasEverConnected()); setHasNeverDetectedCaptivePortal(source.hasNeverDetectedCaptivePortal()); } @@ -2068,6 +2091,7 @@ public class WifiConfiguration implements Parcelable { if (getConnectChoice() != null) { dest.writeInt(CONNECT_CHOICE_EXISTS); dest.writeString(getConnectChoice()); + dest.writeInt(getConnectChoiceRssi()); } else { dest.writeInt(CONNECT_CHOICE_NOT_EXISTS); } @@ -2087,6 +2111,7 @@ public class WifiConfiguration implements Parcelable { setNetworkSelectionBSSID(in.readString()); if (in.readInt() == CONNECT_CHOICE_EXISTS) { setConnectChoice(in.readString()); + setConnectChoiceRssi(in.readInt()); } else { setConnectChoice(null); } @@ -2398,6 +2423,8 @@ public class WifiConfiguration implements Parcelable { } if (mNetworkSelectionStatus.getConnectChoice() != null) { sbuf.append(" connect choice: ").append(mNetworkSelectionStatus.getConnectChoice()); + sbuf.append(" connect choice rssi: ") + .append(mNetworkSelectionStatus.getConnectChoiceRssi()); } sbuf.append(" hasEverConnected: ") .append(mNetworkSelectionStatus.hasEverConnected()).append("\n"); |