|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.os.Handler
android.net.NetworkStateTracker
android.net.wifi.WifiStateTracker
public class WifiStateTracker
Track the state of Wifi connectivity. All event handling is done here, and all changes in connectivity state are initiated here.
| Field Summary | |
|---|---|
static int |
SUPPL_SCAN_HANDLING_LIST_ONLY
|
static int |
SUPPL_SCAN_HANDLING_NORMAL
|
| Fields inherited from class android.net.NetworkStateTracker |
|---|
EVENT_CONFIGURATION_CHANGED, EVENT_NOTIFICATION_CHANGED, EVENT_STATE_CHANGED, mNetworkInfo, mTarget |
| Constructor Summary | |
|---|---|
WifiStateTracker(Context context,
Handler target)
|
|
| Method Summary | |
|---|---|
boolean |
addToBlacklist(String bssid)
|
boolean |
clearBlacklist()
|
DhcpInfo |
getDhcpInfo()
|
String[] |
getNameServers()
Return the IP addresses of the DNS servers available for the WLAN network interface. |
List<ScanResult> |
getScanResultsList()
|
SupplicantState |
getSupplicantState()
|
String |
getTcpBufferSizesPropName()
Return the system properties name associated with the tcp buffer sizes for this network. |
void |
handleMessage(Message msg)
Subclasses must implement this to receive messages. |
void |
interpretScanResultsAvailable()
Interprets scan results. |
boolean |
isAvailable()
Wi-Fi is considered available as long as we have a connection to the supplicant daemon and there is at least one enabled network. |
boolean |
isConnectionCompleted()
Report whether the Wi-Fi connection is fully configured for data. |
(package private) void |
notifyDriverStarted()
Send the tracker a notification that the Wi-Fi driver has been restarted after having been stopped. |
(package private) void |
notifyDriverStopped()
Send the tracker a notification that the Wi-Fi driver has been stopped. |
(package private) void |
notifyPasswordKeyMayBeIncorrect()
Send the tracker a notification that a user-entered password key may be incorrect (i.e., caused authentication to fail). |
(package private) void |
notifyScanResultsAvailable()
Send the tracker a notification that a scan has completed, and results are available. |
(package private) void |
notifyStateChange(int networkId,
SupplicantState newState)
Send the tracker a notification that the state of the supplicant has changed. |
(package private) void |
notifyStateChange(NetworkInfo.DetailedState newState,
String BSSID,
int networkId)
Send the tracker a notification that the state of Wifi connectivity has changed. |
(package private) void |
notifySupplicantConnection()
Send the tracker a notification that a connection to the supplicant daemon has been established. |
(package private) void |
notifySupplicantLost()
Send the tracker a notification that we can no longer communicate with the supplicant daemon. |
boolean |
reconnect()
Reenable Wi-Fi connectivity, by iterating through the list of saved network statuses, and reenabling each network that had been enabled before teardown() was called. |
void |
releaseWakeLock()
Release the wakelock, if any, that may be held while handling a disconnect operation. |
WifiInfo |
requestConnectionInfo()
Get status information for the current connection, if any. |
void |
resetInterface()
Resets the Wi-Fi interface by clearing any state, resetting any sockets using the interface, stopping DHCP, and disabling the interface. |
void |
setNotificationVisible(boolean visible,
int numNetworks,
boolean force,
int delay)
|
boolean |
setRadio(boolean turnOn)
Turn the wireless radio off for a network. |
void |
setReleaseWakeLockCallback(Runnable callback)
|
void |
setScanMode(boolean isScanModeActive,
boolean setDueToAHiddenNetwork)
|
void |
setScanResultsList(List<ScanResult> scanList)
|
void |
startEventLoop()
|
void |
startMonitoring()
|
int |
startUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
Tells the underlying networking system that the caller wants to begin using the named feature. |
int |
stopUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
Tells the underlying networking system that the caller is finished using the named feature. |
boolean |
teardown()
Disable Wi-Fi connectivity. |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
| Methods inherited from class android.net.NetworkStateTracker |
|---|
getNameServerList, getNetworkInfo, requestRouteToHost, sendScanResultsAvailable, setDetailedState, setDetailedState, setDetailedStateInternal, updateNetworkSettings |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SUPPL_SCAN_HANDLING_NORMAL
public static final int SUPPL_SCAN_HANDLING_LIST_ONLY
| Constructor Detail |
|---|
public WifiStateTracker(Context context,
Handler target)
| Method Detail |
|---|
public SupplicantState getSupplicantState()
public String[] getNameServers()
getNameServers in class NetworkStateTrackerpublic String getTcpBufferSizesPropName()
getTcpBufferSizesPropName in class NetworkStateTrackerpublic void startMonitoring()
startMonitoring in class NetworkStateTrackerpublic void startEventLoop()
public boolean isAvailable()
isAvailable in class NetworkStateTrackertrue if Wi-Fi connections are possiblepublic boolean isConnectionCompleted()
true if the SupplicantState is
COMPLETED.void notifyPasswordKeyMayBeIncorrect()
void notifySupplicantConnection()
void notifyStateChange(int networkId,
SupplicantState newState)
newState - the new SupplicantState
void notifyStateChange(NetworkInfo.DetailedState newState,
String BSSID,
int networkId)
newState - the new network stateBSSID - when the new state is NetworkInfo.DetailedState.CONNECTED,
this is the MAC address of the access point. Otherwise, it
is null.void notifyScanResultsAvailable()
void notifySupplicantLost()
void notifyDriverStopped()
void notifyDriverStarted()
public void releaseWakeLock()
NetworkStateTracker
releaseWakeLock in class NetworkStateTrackerpublic void setReleaseWakeLockCallback(Runnable callback)
public void handleMessage(Message msg)
Handler
handleMessage in class Handler
public void setScanMode(boolean isScanModeActive,
boolean setDueToAHiddenNetwork)
public void resetInterface()
public DhcpInfo getDhcpInfo()
public List<ScanResult> getScanResultsList()
public void setScanResultsList(List<ScanResult> scanList)
public WifiInfo requestConnectionInfo()
WifiInfo object containing information about the current connectionpublic boolean teardown()
NetworkStateTracker.reconnect() can
restore it.
teardown in class NetworkStateTrackertrue if a teardown occurred, false if the
teardown did not occur.public boolean reconnect()
teardown() was called. The network that had been
active at the time of the teardown() might not be the one chosen
by the supplicant to connect to after being re-enabled.
reconnect in class NetworkStateTrackerpublic boolean setRadio(boolean turnOn)
NetworkStateTracker
setRadio in class NetworkStateTrackerturnOn - true to turn the radio on, false
public int startUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
feature
is completely up to each networking implementation.
There are currently no Wi-Fi-specific features supported.
startUsingNetworkFeature in class NetworkStateTrackerfeature - the name of the featurecallingPid - the process ID of the process that is issuing this requestcallingUid - the user ID of the process that is issuing this request
-1 indicating failure, always
public int stopUsingNetworkFeature(String feature,
int callingPid,
int callingUid)
feature
is completely up to each networking implementation.
There are currently no Wi-Fi-specific features supported.
stopUsingNetworkFeature in class NetworkStateTrackerfeature - the name of the featurecallingPid - the process ID of the process that is issuing this requestcallingUid - the user ID of the process that is issuing this request
-1 indicating failure, alwayspublic void interpretScanResultsAvailable()
NetworkStateTracker
interpretScanResultsAvailable in class NetworkStateTracker
public void setNotificationVisible(boolean visible,
int numNetworks,
boolean force,
int delay)
public boolean addToBlacklist(String bssid)
public boolean clearBlacklist()
public String toString()
Object
toString in class Handler
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||