private State state; public void setState(State newstate){ if (!newstate.equals(state)){ if (state.equals(State.INACTIVE)){ timeInactive = 0; timeStarted = System.currentTimeMillis(); } else if (state.equals(State.ACTIVE)){ timeInactive = System.currentTimeMillis()-timeStarted; } } state = newstate; }
State temp = new State(0, 0, ""); System.out.println(temp.equals(temp));
public static boolean collectionAllowed(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mobileInfo = connectivityManager.getNetworkInfo( ConnectivityManager.TYPE_MOBILE); State mobile = NetworkInfo.State.DISCONNECTED; if ( mobileInfo != null) { mobile = mobileInfo.getState(); } NetworkInfo wifiInfo = connectivityManager.getNetworkInfo( ConnectivityManager.TYPE_WIFI); State wifi = NetworkInfo.State.DISCONNECTED; if ( wifiInfo != null) { wifi = wifiInfo.getState(); } boolean dataOnWifiOnly = (Boolean) PreferenceManager .getDefaultSharedPreferences(context).getBoolean( "data_wifi_only", true); if ((!dataOnWifiOnly && (mobile.equals(NetworkInfo.State.CONNECTED) || wifi .equals(NetworkInfo.State.CONNECTED))) || (dataOnWifiOnly && wifi.equals(NetworkInfo.State.CONNECTED))) { return true; } else { return false; } }
synchronized (sPropertyLock) { final State currentState = getState(service); if (state.equals(currentState)) { return;
throw new TechnicalException("Missing state parameter"); if (!state.equals(context.getSessionStore().get(context, OidcConfiguration.STATE_SESSION_ATTRIBUTE))) { throw new TechnicalException("State parameter is different from the one sent in authentication request. " + "Session expired or possible threat of cross-site request forgery");
if(newValue.equals(State.SUCCEEDED)){
if(s.equals(GOAL)) { s.setParent(current); return s;