Lines Matching refs:State
67 if (getState() == State.TEMPORARILY_DISABLED) { in reset()
68 setState(State.DENIED); in reset()
75 public void setState(State state) { in setState()
84 return getState() == State.ALLOWED; in isP2pEnabled()
93 setState(State.ALLOWED); in applyPermissionChange()
96 setState(permanent ? State.DISABLED : State.TEMPORARILY_DISABLED); in applyPermissionChange()
121 State state = getState(); in request()
126 listener.onP2pPermissionComplete(state == State.ALLOWED); in request()
181 State state = getState(); in listenForPreferenceChanges()
182 if (state.isTerminal() || state == State.DENIED) { in listenForPreferenceChanges()
183 listener.onP2pPermissionComplete(state == State.ALLOWED); in listenForPreferenceChanges()
236 public State getState() { in getState()
238 String stateString = mPrefs.getString(STATE_KEY, State.DENIED.name()); in getState()
239 State state = State.valueOf(stateString); in getState()
241 if (state == State.DISABLED) { in getState()
247 if (hasPermission && state != State.ALLOWED) { in getState()
249 state = State.ALLOWED; in getState()
251 } else if (!hasPermission && state == State.ALLOWED) { in getState()
252 state = State.DENIED; in getState()
268 public enum State { enum