@Override protected void onPause() { PersistentStore.setString(LAST_TAB_STORE, currenttab); super.onPause(); } }
public static boolean updateStringIfDifferent(final String name, final String current) { if (current == null) return false; // can't handle nulls if (PersistentStore.getString(name).equals(current)) return false; PersistentStore.setString(name, current); return true; }
public static void appendString(String name, String value, String delimiter) { String current = getString(name); if (current.length() > 0) current += delimiter; setString(name, current + value); }
static void setPin(String address, String pin) { if (pin == null || address == null) return; if (getPin(address).equals(pin)) return; PersistentStore.setString(PENDIQ_PIN_PREFIX + address, pin); }
@Override protected void onPause() { PersistentStore.setString(LAST_TAB_STORE, currenttab); super.onPause(); } }
protected static boolean saveDataToCache(String tag, CalibrationData data) { final String lookup_tag = "CalibrationDataCache-" + tag; memory_cache.put(lookup_tag, data); PersistentStore.setString(lookup_tag, dataToJsonString(data)); return true; }
static void setModel(final String model) { final String mac = getMac(); if (mac != null) { PersistentStore.setString("lefun_model_" + mac, model); } }
public static boolean updateStringIfDifferent(final String name, final String current) { if (current == null) return false; // can't handle nulls if (PersistentStore.getString(name).equals(current)) return false; PersistentStore.setString(name, current); return true; }
private static void saveIndex() { final Gson gson = new GsonBuilder().create(); final String[] array = new String[indexed.size()]; int i = 0; for (Map.Entry entry : indexed.entrySet()) { array[i++] = (((RollCall) entry.getValue()).toS()); } PersistentStore.setString(ROLLCALL_SAVED_INDEX, gson.toJson(array)); UserError.Log.d(TAG, "Saving"); }
private static void saveIndex() { final Gson gson = new GsonBuilder().create(); final String[] array = new String[indexed.size()]; int i = 0; for (Map.Entry entry : indexed.entrySet()) { array[i++] = (((RollCall) entry.getValue()).toS()); } PersistentStore.setString(ROLLCALL_SAVED_INDEX, gson.toJson(array)); UserError.Log.d(TAG, "Saving"); }
void filterChanged(String filter) { currentFilter = filter.toLowerCase().trim(); Inevitable.task("event-log-filter-update", 200, () -> { refresh(); PersistentStore.setString(PREF_LAST_SEARCH, currentFilter); }); }
void filterChanged(String filter) { currentFilter = filter.toLowerCase().trim(); Inevitable.task("event-log-filter-update", 200, () -> { refresh(); PersistentStore.setString(PREF_LAST_SEARCH, currentFilter); }); }
public synchronized static void receivedText(Context context, String text) { if (text.equals(PersistentStore.getString(LAST_WATCH_RECEIVED_TEXT))) { Log.e(TAG, "Received text is same as previous, ignoring: " + text); return; } PersistentStore.setString(LAST_WATCH_RECEIVED_TEXT, text); startHomeWithExtra(context, WEARABLE_VOICE_PAYLOAD, text); }
public static synchronized boolean differentBytes(String name, byte[] bytes) { final String id = "differentBytes-" + name; final String last_hash = PersistentStore.getString(id); final String this_hash = CipherUtils.getSHA256(bytes); if (this_hash.equals(last_hash)) return false; PersistentStore.setString(id, this_hash); return true; }
public static void DeleteNotificationByType(String type) { if (legacy_types.contains(type)) { UserNotification userNotification = UserNotification.GetNotificationByType(type); if (userNotification != null) { userNotification.delete(); } } else { PersistentStore.setString("UserNotification:timestamp:" + type, ""); } }
private static void saveQueue() { final String queue_json = extractQueueJson(); if (!(queue_json == null ? "" : queue_json).equals(PersistentStore.getString(PREF_SAVED_QUEUE))) { PersistentStore.setString(PREF_SAVED_QUEUE, queue_json); UserError.Log.d(TAG, "Saved queue stream backup: " + queue_json); } }
private static void setCurrentToBackup(final String newIP, String toSave) { if (toSave == null) { toSave = getOasisIPfromPrefs(); } if (toSave.equals(newIP)) return; final String backup = PersistentStore.getString(PREF_OASISIP); if (!toSave.equals(backup) && (!emptyString(toSave))) { PersistentStore.setString(PREF_OASISIP, toSave); UserError.Log.d(TAG, "Saving to backup: " + toSave); } }
private static void refreshStatus(String store_marker) { PersistentStore.setString(store_marker, ""); if (JoH.ratelimit("nightscout-manual-poll", 15)) { startSyncService(100); JoH.static_toast_short("Refreshing Status"); } } }
private static boolean updateVersion(String version) { if ((!PersistentStore.getString(PEER_VERSION).equals(version) || (JoH.pratelimit("allow-version-recheck", RETRY_TIME)))) { PersistentStore.setString(PEER_VERSION, version); PersistentStore.setLong(PEER_VERSION_UPDATED, JoH.tsl()); UserError.Log.d(TAG, "Updated peer version to: " + version); return true; } else { return false; } }
public static void resetTransmitterBatteryStatus() { final String transmitterId = Pref.getString("dex_txid", "NULL"); PersistentStore.setString(G5_BATTERY_MARKER + transmitterId, ""); PersistentStore.setLong(G5_BATTERY_FROM_MARKER + transmitterId, 0); PersistentStore.setLong(G5_BATTERY_LEVEL_MARKER + transmitterId, 0); PersistentStore.commit(); }