Loading wifi/java/android/net/wifi/WifiConfiguration.java +27 −0 Original line number Diff line number Diff line Loading @@ -1637,6 +1637,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 Loading Loading @@ -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() { Loading Loading @@ -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()); } Loading @@ -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); } Loading @@ -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); } Loading Loading @@ -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"); Loading Loading
wifi/java/android/net/wifi/WifiConfiguration.java +27 −0 Original line number Diff line number Diff line Loading @@ -1637,6 +1637,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 Loading Loading @@ -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() { Loading Loading @@ -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()); } Loading @@ -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); } Loading @@ -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); } Loading Loading @@ -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"); Loading