android.net.wifi.WifiStateTracker
Track the state of Wifi connectivity. All event handling is done here,
and all changes in connectivity state are initiated here.
Summary
Public Constructors
Public Methods
getNameServerList,
getNameServers,
getNetworkInfo,
interpretScanResultsAvailable,
isAvailable,
reconnect,
sendScanResultsAvailable,
setDetailedState,
setDetailedState,
setRadio,
startMonitoring,
startUsingNetworkFeature,
stopUsingNetworkFeature,
teardown
dispatchMessage,
dump,
getLooper,
handleMessage,
hasMessages,
hasMessages,
obtainMessage,
obtainMessage,
obtainMessage,
obtainMessage,
obtainMessage,
post,
postAtFrontOfQueue,
postAtTime,
postAtTime,
postDelayed,
removeCallbacks,
removeCallbacks,
removeCallbacksAndMessages,
removeMessages,
removeMessages,
sendEmptyMessage,
sendEmptyMessageAtTime,
sendEmptyMessageDelayed,
sendMessage,
sendMessageAtFrontOfQueue,
sendMessageAtTime,
sendMessageDelayed,
toString
|
|
|
|
|
void |
dispatchMessage(Message msg) |
|
|
final |
|
|
void |
dump(Printer pw, String prefix) |
|
|
final |
|
|
Looper |
getLooper() |
|
|
|
|
|
void |
handleMessage(Message msg) |
|
|
final |
|
|
boolean |
hasMessages(int what) |
|
|
final |
|
|
boolean |
hasMessages(int what, Object object) |
|
|
final |
|
|
Message |
obtainMessage(int what, Object obj) |
|
|
final |
|
|
Message |
obtainMessage(int what, int arg1, int arg2, Object obj) |
|
|
final |
|
|
Message |
obtainMessage(int what, int arg1, int arg2) |
|
|
final |
|
|
Message |
obtainMessage() |
|
|
final |
|
|
Message |
obtainMessage(int what) |
|
|
final |
|
|
boolean |
post(Runnable r) |
|
|
final |
|
|
boolean |
postAtFrontOfQueue(Runnable r) |
|
|
final |
|
|
boolean |
postAtTime(Runnable r, Object token, long uptimeMillis) |
|
|
final |
|
|
boolean |
postAtTime(Runnable r, long uptimeMillis) |
|
|
final |
|
|
boolean |
postDelayed(Runnable r, long delayMillis) |
|
|
final |
|
|
void |
removeCallbacks(Runnable r, Object token) |
|
|
final |
|
|
void |
removeCallbacks(Runnable r) |
|
|
final |
|
|
void |
removeCallbacksAndMessages(Object token) |
|
|
final |
|
|
void |
removeMessages(int what) |
|
|
final |
|
|
void |
removeMessages(int what, Object object) |
|
|
final |
|
|
boolean |
sendEmptyMessage(int what) |
|
|
final |
|
|
boolean |
sendEmptyMessageAtTime(int what, long uptimeMillis) |
|
|
final |
|
|
boolean |
sendEmptyMessageDelayed(int what, long delayMillis) |
|
|
final |
|
|
boolean |
sendMessage(Message msg) |
|
|
final |
|
|
boolean |
sendMessageAtFrontOfQueue(Message msg) |
|
|
|
|
|
boolean |
sendMessageAtTime(Message msg, long uptimeMillis) |
|
|
final |
|
|
boolean |
sendMessageDelayed(Message msg, long delayMillis) |
|
|
|
|
|
String |
toString() |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Public Methods
public
String[]
getNameServers()
Return the IP addresses of the DNS servers available for the WLAN
network interface.
Returns
- a list of DNS addresses, with no holes.
public
void
handleMessage(Message msg)
Subclasses must implement this to receive messages.
public
void
interpretScanResultsAvailable()
Interprets scan results. This will be called at a safe time for
processing, and from a safe thread.
public
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.
Returns
true
if Wi-Fi connections are possible
public
boolean
isConnectionCompleted()
Report whether the Wi-Fi connection is fully configured for data.
public
synchronized
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. 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.
public
WifiInfo
requestConnectionInfo()
Get status information for the current connection, if any.
Returns
- a WifiInfo object containing information about the current connection
public
boolean
setRadio(boolean turnOn)
Turn the wireless radio off for a network.
Parameters
turnOn
| true to turn the radio on, false
|
public
synchronized
void
setScanResultsList(List<ScanResult> scanList)
public
void
startEventLoop()
public
void
startMonitoring()
public
int
startUsingNetworkFeature(String feature)
Tells the underlying networking system that the caller wants to
begin using the named feature. The interpretation of
feature
is completely up to each networking implementation.
There are currently no Wi-Fi-specific features supported.
Parameters
feature
| the name of the feature |
Returns
-1
indicating failure, always
public
int
stopUsingNetworkFeature(String feature)
Tells the underlying networking system that the caller is finished
using the named feature. The interpretation of
feature
is completely up to each networking implementation.
There are currently no Wi-Fi-specific features supported.
Parameters
feature
| the name of the feature |
Returns
-1
indicating failure, always
public
synchronized
boolean
teardown()
Disable Wi-Fi connectivity. We do this by going through
all the configured Wi-Fi networks and disabling them, so
that the supplicant will not attempt to connect to any
network. We save the disabled/enabled state of the
original list, so that
reconnect() can
restore it.
Returns
true
if a teardown occurred, false
if the
teardown did not occur.
public
String
toString()
Returns a string containing a concise, human-readable description of the
receiver.