public class ConnectStateManage
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ConnectStateManage.ALERT |
static interface |
ConnectStateManage.Listener |
static class |
ConnectStateManage.STATE |
static interface |
ConnectStateManage.StateListener |
Modifier and Type | Field and Description |
---|---|
private android.bluetooth.BluetoothDevice |
mBeforeConnectBTDevice |
private android.bluetooth.BluetoothDevice |
mConnectBTDevice |
private boolean |
mIsChangedBTDevice |
private ConnectStateManage.Listener |
mListener |
private ConnectStateManage.STATE |
mState |
private ConnectStateManage.StateListener |
mStateListener |
Constructor and Description |
---|
ConnectStateManage(ConnectStateManage.Listener listener) |
Modifier and Type | Method and Description |
---|---|
void |
alert(ConnectStateManage.ALERT type)
wifi p2p should work with location service so location service is disable then need to show some alert message.
|
android.bluetooth.BluetoothDevice |
getConnectBTDevice() |
ConnectStateManage.STATE |
getCurrentState() |
boolean |
isChangedBTDevice() |
boolean |
isConnected() |
boolean |
isDisconnected() |
boolean |
isTryToConnecting()
if state is STATE_NONE or STATE_DONE, return false;
|
(package private) void |
setConnectBTDevice(android.bluetooth.BluetoothDevice device) |
void |
setState(ConnectStateManage.STATE state)
if you set the connect state, StateListener.onConnectState() will call immediately so you can control what you want about connect state.
|
void |
setStateListener(ConnectStateManage.StateListener listener)
current connect state listener. this function will return current state immediately when you set the listener.
|
private ConnectStateManage.Listener mListener
private ConnectStateManage.StateListener mStateListener
private android.bluetooth.BluetoothDevice mConnectBTDevice
private android.bluetooth.BluetoothDevice mBeforeConnectBTDevice
private boolean mIsChangedBTDevice
private ConnectStateManage.STATE mState
ConnectStateManage(ConnectStateManage.Listener listener)
public void setStateListener(ConnectStateManage.StateListener listener)
listener
- ConnectStateManage.StateListenerpublic void setState(ConnectStateManage.STATE state)
state
- STATE_NONE, STATE_START, STATE_BT, STATE_BT_FINDING, STATE_BT_NOT_FOUND, STATE_P2P, STATE_P2P_NOT_FOUND, STATE_DONEpublic void alert(ConnectStateManage.ALERT type)
type
- ALERT_GPS_DISABLED, ALERT_GPS_ENABLED, ALERT_DISABLE
ALERT_DISABLE means that alert message close. because if you make disconnect when showed alert message, alert message doesn't need to show
so just close alert message.void setConnectBTDevice(android.bluetooth.BluetoothDevice device)
public boolean isChangedBTDevice()
public boolean isConnected()
public boolean isDisconnected()
public ConnectStateManage.STATE getCurrentState()
public boolean isTryToConnecting()
public android.bluetooth.BluetoothDevice getConnectBTDevice()