@Implements(value=android.net.wifi.WifiManager.class) public class ShadowWifiManager extends java.lang.Object
Shadow for WifiManager
.
Modifier and Type | Class and Description |
---|---|
static class |
ShadowWifiManager.ShadowMulticastLock |
static class |
ShadowWifiManager.ShadowWifiLock |
Constructor and Description |
---|
ShadowWifiManager() |
Modifier and Type | Method and Description |
---|---|
protected int |
addNetwork(android.net.wifi.WifiConfiguration config) |
protected static int |
calculateSignalLevel(int rssi,
int numLevels) |
protected void |
connect(int networkId,
android.net.wifi.WifiManager.ActionListener listener) |
protected void |
connect(android.net.wifi.WifiConfiguration wifiConfiguration,
android.net.wifi.WifiManager.ActionListener listener) |
protected android.net.wifi.WifiManager.MulticastLock |
createMulticastLock(java.lang.String tag) |
protected android.net.wifi.WifiManager.WifiLock |
createWifiLock(int lockType,
java.lang.String tag) |
protected android.net.wifi.WifiManager.WifiLock |
createWifiLock(java.lang.String tag) |
protected boolean |
enableNetwork(int netId,
boolean disableOthers) |
int |
getActiveLockCount()
Returns the number of WifiLocks and MulticastLocks that are currently acquired.
|
protected java.util.List<android.net.wifi.WifiConfiguration> |
getConfiguredNetworks() |
protected android.net.wifi.WifiInfo |
getConnectionInfo() |
protected android.net.DhcpInfo |
getDhcpInfo() |
android.util.Pair<java.lang.Integer,java.lang.Boolean> |
getLastEnabledNetwork() |
protected java.util.List<android.net.wifi.WifiConfiguration> |
getPrivilegedConfiguredNetworks() |
protected java.util.List<android.net.wifi.ScanResult> |
getScanResults() |
android.net.wifi.WifiConfiguration |
getWifiConfiguration(int netId) |
protected int |
getWifiState() |
protected boolean |
is5GHzBandSupported() |
protected boolean |
isScanAlwaysAvailable() |
protected boolean |
isWifiEnabled() |
protected boolean |
reconnect() |
protected boolean |
removeNetwork(int netId) |
protected boolean |
saveConfiguration() |
void |
setAccessWifiStatePermission(boolean accessWifiStatePermission) |
void |
setConnectionInfo(android.net.wifi.WifiInfo wifiInfo)
Sets the connection info as the provided
WifiInfo . |
void |
setDhcpInfo(android.net.DhcpInfo dhcpInfo) |
void |
setIs5GHzBandSupported(boolean is5GHzBandSupported)
Sets whether 5ghz band is supported.
|
void |
setIsScanAlwaysAvailable(boolean isScanAlwaysAvailable) |
void |
setScanResults(java.util.List<android.net.wifi.ScanResult> scanResults) |
static void |
setSignalLevelInPercent(float level) |
void |
setStartScanSucceeds(boolean succeeds)
Sets the return value of
startScan() . |
protected boolean |
setWifiEnabled(boolean wifiEnabled) |
protected boolean |
startScan()
Does nothing and returns the configured success status.
|
protected int |
updateNetwork(android.net.wifi.WifiConfiguration config) |
boolean |
wasConfigurationSaved() |
@Implementation protected boolean setWifiEnabled(boolean wifiEnabled)
@Implementation protected boolean isWifiEnabled()
@Implementation protected int getWifiState()
@Implementation protected android.net.wifi.WifiInfo getConnectionInfo()
@Implementation(minSdk=21) protected boolean is5GHzBandSupported()
public void setIs5GHzBandSupported(boolean is5GHzBandSupported)
Sets whether 5ghz band is supported.
public void setConnectionInfo(android.net.wifi.WifiInfo wifiInfo)
Sets the connection info as the provided WifiInfo
.
public void setStartScanSucceeds(boolean succeeds)
Sets the return value of startScan()
.
@Implementation protected java.util.List<android.net.wifi.ScanResult> getScanResults()
@Implementation protected java.util.List<android.net.wifi.WifiConfiguration> getConfiguredNetworks()
@Implementation(minSdk=21) protected java.util.List<android.net.wifi.WifiConfiguration> getPrivilegedConfiguredNetworks()
@Implementation protected int addNetwork(android.net.wifi.WifiConfiguration config)
@Implementation protected boolean removeNetwork(int netId)
@Implementation protected int updateNetwork(android.net.wifi.WifiConfiguration config)
@Implementation protected boolean saveConfiguration()
@Implementation protected boolean enableNetwork(int netId, boolean disableOthers)
@Implementation protected android.net.wifi.WifiManager.WifiLock createWifiLock(int lockType, java.lang.String tag)
@Implementation protected android.net.wifi.WifiManager.WifiLock createWifiLock(java.lang.String tag)
@Implementation protected android.net.wifi.WifiManager.MulticastLock createMulticastLock(java.lang.String tag)
@Implementation protected static int calculateSignalLevel(int rssi, int numLevels)
@Implementation protected boolean startScan()
Does nothing and returns the configured success status.
That is different from the Android implementation which always returns true
up to and including Android 8, and either true
or false
on Android 9+.
setStartScanSucceeds(boolean)
, or true
if that method was never called.@Implementation protected android.net.DhcpInfo getDhcpInfo()
@Implementation(minSdk=18) protected boolean isScanAlwaysAvailable()
@HiddenApi @Implementation(minSdk=19) protected void connect(android.net.wifi.WifiConfiguration wifiConfiguration, android.net.wifi.WifiManager.ActionListener listener)
@HiddenApi @Implementation(minSdk=19) protected void connect(int networkId, android.net.wifi.WifiManager.ActionListener listener)
@Implementation protected boolean reconnect()
public static void setSignalLevelInPercent(float level)
public void setAccessWifiStatePermission(boolean accessWifiStatePermission)
public void setScanResults(java.util.List<android.net.wifi.ScanResult> scanResults)
public void setDhcpInfo(android.net.DhcpInfo dhcpInfo)
public android.util.Pair<java.lang.Integer,java.lang.Boolean> getLastEnabledNetwork()
public int getActiveLockCount()
Returns the number of WifiLocks and MulticastLocks that are currently acquired.
public boolean wasConfigurationSaved()
public void setIsScanAlwaysAvailable(boolean isScanAlwaysAvailable)
public android.net.wifi.WifiConfiguration getWifiConfiguration(int netId)