public class WifiConfigManager extends Object
Modifier and Type | Method and Description |
---|---|
int |
addPasspointManagementObject(String managementObject) |
Map<Constants.ANQPElementType,ANQPElement> |
getANQPData(NetworkDetail network) |
String |
getConfigFile() |
int |
getCurrentUserId() |
boolean |
getEnableAutoJoinWhenAssociated() |
Set<Integer> |
getHiddenConfiguredNetworkIds()
Fetch the list of networkId's which are hidden in current user's configuration.
|
HomeSP |
getHomeSPForConfig(WifiConfiguration config) |
String |
getLastSelectedConfiguration() |
long |
getLastSelectedTimeStamp() |
List<WifiConfiguration> |
getSavedNetworkFromScanDetail(ScanDetail scanDetail)
Get saved WifiConfiguration associated with a scan detail.
|
List<WifiConfiguration> |
getSavedNetworks()
Fetch the list of currently saved networks (i.e. all configured networks, excluding
ephemeral networks).
|
ScanDetailCache |
getScanDetailCache(WifiConfiguration config) |
SIMAccessor |
getSIMAccessor() |
WifiConfiguration |
getWifiConfigForHomeSP(HomeSP homeSP) |
WifiConfiguration |
getWifiConfiguration(int netId)
get the Wificonfiguration for this netId
|
WifiConfiguration |
getWifiConfiguration(String key)
Get the Wificonfiguration for this key
|
void |
handleUserSwitch(int userId)
Handles the switch to a different foreground user:
- Removes all ephemeral networks
- Disables private network configurations belonging to the previous foreground user
- Enables private network configurations belonging to the new foreground user
|
boolean |
isBssidBlacklisted(String bssid) |
boolean |
isCurrentUserProfile(int userId) |
boolean |
isLastSelectedConfiguration(WifiConfiguration config) |
boolean |
isOpenNetwork(ScanResult scan) |
boolean |
isOpenNetwork(String encryption) |
boolean |
isOpenNetwork(WifiConfiguration config) |
void |
linkConfiguration(WifiConfiguration config)
This function run thru the Saved WifiConfigurations and check if some should be linked.
|
protected void |
log(String s) |
protected void |
logd(String s) |
protected void |
loge(String s) |
protected void |
loge(String s,
boolean stack) |
HashSet<Integer> |
makeChannelList(WifiConfiguration config,
int age) |
int |
matchProviderWithCurrentNetwork(String fqdn) |
int |
modifyPasspointMo(String fqdn,
List<PasspointManagementObjectDefinition> mos) |
void |
notifyANQPDone(Long bssid,
boolean success) |
void |
notifyIconReceived(IconEvent iconEvent) |
boolean |
queryPasspointIcon(long bssid,
String fileName) |
void |
resetSimNetworks()
Resets all sim networks from the network list.
|
ArrayList<WifiScanner.PnoSettings.PnoNetwork> |
retrieveConnectedPnoNetworkList()
Retrieves an updated list of priorities for all the saved networks before
enabling connected PNO (HAL based ePno).
|
ArrayList<WifiScanner.PnoSettings.PnoNetwork> |
retrieveDisconnectedPnoNetworkList()
Retrieves an updated list of priorities for all the saved networks before
enabling disconnected PNO (wpa_supplicant based PNO).
|
void |
setActiveScanDetail(ScanDetail activeScanDetail) |
void |
setAndEnableLastSelectedConfiguration(int netId) |
void |
setEnableAutoJoinWhenAssociated(boolean enabled) |
void |
setLatestUserSelectedConfiguration(WifiConfiguration network) |
void |
trimANQPCache(boolean all) |
boolean |
tryEnableQualifiedNetwork(int networkId)
Check the config.
|
boolean |
updateLastConnectUid(WifiConfiguration config,
int uid) |
List<WifiConfiguration> |
updateSavedNetworkWithNewScanDetail(ScanDetail scanDetail,
boolean isConnectingOrConnected)
Create a mapping between the scandetail and the Wificonfiguration it associated with
because Passpoint, one BSSID can associated with multiple SSIDs
|
protected boolean |
wasEnterpriseConfigChange(WifiEnterpriseConfig originalEnterpriseConfig,
WifiEnterpriseConfig currentEnterpriseConfig) |
boolean |
wasEphemeralNetworkDeleted(String ssid)
Check if the provided ephemeral network was deleted by the user or not.
|
WifiConfiguration |
wifiConfigurationFromScanResult(ScanDetail scanDetail) |
WifiConfiguration |
wifiConfigurationFromScanResult(ScanResult result) |
void |
writeKnownNetworkHistory()
Read Network history from file, merge it into mConfiguredNetowrks and mScanDetailCaches
|
void |
writePasspointConfigs(String fqdn,
HomeSP homeSP) |
public static final String TAG
public static final int MAX_TX_PACKET_FOR_FULL_SCANS
public static final int MAX_RX_PACKET_FOR_FULL_SCANS
public static final int MAX_TX_PACKET_FOR_PARTIAL_SCANS
public static final int MAX_RX_PACKET_FOR_PARTIAL_SCANS
public static final boolean ROAM_ON_ANY
public static final int MAX_NUM_SCAN_CACHE_ENTRIES
public final AtomicBoolean mEnableAutoJoinWhenAssociated
public final AtomicBoolean mEnableChipWakeUpWhenAssociated
public final AtomicBoolean mEnableRssiPollWhenAssociated
public final AtomicInteger mThresholdSaturatedRssi5
public final AtomicInteger mThresholdQualifiedRssi24
public final AtomicInteger mEnableVerboseLogging
public final AtomicInteger mAlwaysEnableScansWhileAssociated
public final AtomicInteger mMaxNumActiveChannelsForPartialScans
public boolean mEnableLinkDebouncing
public boolean mEnableWifiCellularHandoverUserTriggeredAdjustment
public int mNetworkSwitchingBlackListPeriodMs
public int mBadLinkSpeed24
public int mBadLinkSpeed5
public int mGoodLinkSpeed24
public int mGoodLinkSpeed5
public AtomicInteger mThresholdQualifiedRssi5
public AtomicInteger mThresholdMinimumRssi5
public AtomicInteger mThresholdSaturatedRssi24
public AtomicInteger mThresholdMinimumRssi24
public AtomicInteger mCurrentNetworkBoost
public AtomicInteger mBandAward5Ghz
public Set<String> mDeletedEphemeralSSIDs
public void trimANQPCache(boolean all)
public List<WifiConfiguration> getSavedNetworks()
public Set<Integer> getHiddenConfiguredNetworkIds()
public WifiConfiguration getWifiConfiguration(int netId)
public WifiConfiguration getWifiConfiguration(String key)
public boolean updateLastConnectUid(WifiConfiguration config, int uid)
public int addPasspointManagementObject(String managementObject)
public int modifyPasspointMo(String fqdn, List<PasspointManagementObjectDefinition> mos)
public boolean queryPasspointIcon(long bssid, String fileName)
public int matchProviderWithCurrentNetwork(String fqdn)
public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveDisconnectedPnoNetworkList()
public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveConnectedPnoNetworkList()
public boolean tryEnableQualifiedNetwork(int networkId)
networkId
- the id of the network to be checked for possible unblock (due to timeout)public void writeKnownNetworkHistory()
public void setAndEnableLastSelectedConfiguration(int netId)
public void setLatestUserSelectedConfiguration(WifiConfiguration network)
public String getLastSelectedConfiguration()
public long getLastSelectedTimeStamp()
public boolean isLastSelectedConfiguration(WifiConfiguration config)
protected boolean wasEnterpriseConfigChange(WifiEnterpriseConfig originalEnterpriseConfig, WifiEnterpriseConfig currentEnterpriseConfig)
public WifiConfiguration getWifiConfigForHomeSP(HomeSP homeSP)
public HomeSP getHomeSPForConfig(WifiConfiguration config)
public ScanDetailCache getScanDetailCache(WifiConfiguration config)
public void linkConfiguration(WifiConfiguration config)
config
- public HashSet<Integer> makeChannelList(WifiConfiguration config, int age)
public Map<Constants.ANQPElementType,ANQPElement> getANQPData(NetworkDetail network)
public SIMAccessor getSIMAccessor()
public void notifyANQPDone(Long bssid, boolean success)
public void notifyIconReceived(IconEvent iconEvent)
public boolean isOpenNetwork(String encryption)
public boolean isOpenNetwork(ScanResult scan)
public boolean isOpenNetwork(WifiConfiguration config)
public List<WifiConfiguration> getSavedNetworkFromScanDetail(ScanDetail scanDetail)
scanDetail
- input a scanDetail from the scan resultpublic List<WifiConfiguration> updateSavedNetworkWithNewScanDetail(ScanDetail scanDetail, boolean isConnectingOrConnected)
scanDetail
- input a scanDetail from the scan resultisConnectingOrConnected
- input a boolean to indicate if WiFi is connecting or conncted
This is used for avoiding ANQP requestpublic void handleUserSwitch(int userId)
userId
- The identifier of the new foreground user, after the switch.
TODO(b/26785736): Terminate background users if the new foreground user has one or more
private network configurations.public int getCurrentUserId()
public boolean isCurrentUserProfile(int userId)
public WifiConfiguration wifiConfigurationFromScanResult(ScanResult result)
public WifiConfiguration wifiConfigurationFromScanResult(ScanDetail scanDetail)
public String getConfigFile()
protected void logd(String s)
protected void loge(String s)
protected void loge(String s, boolean stack)
protected void log(String s)
public void resetSimNetworks()
public boolean isBssidBlacklisted(String bssid)
public boolean getEnableAutoJoinWhenAssociated()
public void setEnableAutoJoinWhenAssociated(boolean enabled)
public void setActiveScanDetail(ScanDetail activeScanDetail)
public boolean wasEphemeralNetworkDeleted(String ssid)
ssid
- ssid of the network