Home | History | Annotate | Download | only in connectivitymanagertest

Lines Matching refs:State

19 import android.net.NetworkInfo.State;
28 public static final int DO_NOTHING = -1; // no state change
30 private List<State> mStateDepository;
31 private State mTransitionTarget;
33 private String mReason = null; // record mReason of state transition failure
36 mStateDepository = new ArrayList<State>();
38 mTransitionTarget = State.UNKNOWN;
41 public NetworkState(State currentState) {
42 mStateDepository = new ArrayList<State>();
45 mTransitionTarget = State.UNKNOWN;
48 // Reinitialize the network state
52 mTransitionTarget = State.UNKNOWN;
57 public void setStateTransitionCriteria(State initState, int transitionDir, State targetState) {
67 public void recordState(State currentState) {
71 // Verify state transition
73 Log.v(LOG_TAG, "print state depository: " + printStates());
76 Log.v(LOG_TAG, "no state is recorded");
77 mReason = "no state is recorded.";
82 Log.v(LOG_TAG, "state changed.");
83 mReason = "Unexpected state change";
106 * return false if any state transition is not valid and save a message in mReason
110 if (mStateDepository.get(0) != State.CONNECTED) {
111 mReason += " initial state should be CONNECTED, but it is " +
115 State lastState = mStateDepository.get(mStateDepository.size() - 1);
117 mReason += " the last state should be DISCONNECTED, but it is " + lastState;
121 State preState = mStateDepository.get(i-1);
122 State curState = mStateDepository.get(i);
123 if ((preState == State.CONNECTED) && ((curState == State.DISCONNECTING) ||
124 (curState == State.DISCONNECTED))) {
126 } else if ((preState == State.DISCONNECTING) && (curState == State.DISCONNECTED)) {
128 } else if ((preState == State.DISCONNECTED) && (curState == State.DISCONNECTED)) {
131 mReason += " Transition state from " + preState.toString() + " to " +
142 if (mStateDepository.get(0) != State.DISCONNECTED) {
143 mReason += " initial state should be DISCONNECTED, but it is " +
147 State lastState = mStateDepository.get(mStateDepository.size() - 1);
149 mReason += "The last state should be " + mTransitionTarget + ", but it is " + lastState;
153 State preState = mStateDepository.get(i-1);
154 State curState = mStateDepository.get(i);
155 if ((preState == State.DISCONNECTED) && ((curState == State.CONNECTING) ||
156 (curState == State.CONNECTED) || (curState == State.DISCONNECTED))) {
158 } else if ((preState == State.CONNECTING) && (curState == State.CONNECTED)) {
160 } else if ((preState == State.CONNECTED) && (curState == State.CONNECTED)) {
163 mReason += " Transition state from " + preState.toString() + " to " +
171 public List<State> getTransitionStates() {
175 // return state failure mReason