@Test public void checkDaySinceLastUpdate() { assertTrue(configurationClient.shouldUpdate()); }
boolean shouldUpdate() { SharedPreferences sharedPreferences = TelemetryUtils.obtainSharedPreferences(context); long lastUpdateTime = sharedPreferences.getLong(MAPBOX_CONFIG_SYNC_KEY_TIMESTAMP, 0); long millisecondDiff = System.currentTimeMillis() - lastUpdateTime; return millisecondDiff >= DAY_IN_MILLIS; }
ConfigurationClient implements Callback { boolean shouldUpdate() { SharedPreferences sharedPreferences = TelemetryUtils.obtainSharedPreferences(context); long lastUpdateTime = sharedPreferences.getLong(MAPBOX_CONFIG_SYNC_KEY_TIMESTAMP, 0); long millisecondDiff = System.currentTimeMillis() - lastUpdateTime; return millisecondDiff >= DAY_IN_MILLIS; } }
ConfigurationClient implements Callback { boolean shouldUpdate() { SharedPreferences sharedPreferences = TelemetryUtils.obtainSharedPreferences(context); long lastUpdateTime = sharedPreferences.getLong(MAPBOX_CONFIG_SYNC_KEY_TIMESTAMP, 0); long millisecondDiff = System.currentTimeMillis() - lastUpdateTime; return millisecondDiff >= DAY_IN_MILLIS; } ConfigurationClient(Context context, String userAgent, String accessToken, OkHttpClient client); }
ConfigurationClient implements Callback { boolean shouldUpdate() { SharedPreferences sharedPreferences = TelemetryUtils.obtainSharedPreferences(context); long lastUpdateTime = sharedPreferences.getLong(MAPBOX_CONFIG_SYNC_KEY_TIMESTAMP, 0); long millisecondDiff = System.currentTimeMillis() - lastUpdateTime; return millisecondDiff >= DAY_IN_MILLIS; } ConfigurationClient(Context context, String userAgent, String accessToken, OkHttpClient client); @Override void onFailure(Call call, IOException e); @Override void onResponse(Call call, Response response); }
ConfigurationClient implements Callback { boolean shouldUpdate() { SharedPreferences sharedPreferences = TelemetryUtils.obtainSharedPreferences(context); long lastUpdateTime = sharedPreferences.getLong(MAPBOX_CONFIG_SYNC_KEY_TIMESTAMP, 0); long millisecondDiff = System.currentTimeMillis() - lastUpdateTime; return millisecondDiff >= DAY_IN_MILLIS; } ConfigurationClient(Context context, String userAgent, String accessToken, OkHttpClient client); @Override void onFailure(Call call, IOException e); @Override void onResponse(Call call, Response response);  }