private String getRemoteWifiIndicate(final String our_wifi_ssid) { if (emptyString(our_wifi_ssid)) return ""; if (emptyString(ssid)) return ""; if (!our_wifi_ssid.equals(ssid)) return "\n" + ssid; return ""; }
private String getRemoteWifiIndicate(final String our_wifi_ssid) { if (emptyString(our_wifi_ssid)) return ""; if (emptyString(ssid)) return ""; if (!our_wifi_ssid.equals(ssid)) return "\n" + ssid; return ""; }
public static SpannableString nanoStatus() { return JoH.emptyString(lastState) ? null : new SpannableString(lastState); } }
public String getSecret() { if (secret == null) { final URI uri = getURI(); if (uri != null) { secret = uri.getUserInfo(); } } return (emptyString(secret) ? null : secret); }
public String getSecret() { if (secret == null) { final URI uri = getURI(); if (uri != null) { secret = uri.getUserInfo(); } } return (emptyString(secret) ? null : secret); }
public static String getOasisBackupIP() { final String backupIP = PersistentStore.getString(PREF_OASISIP); return emptyString(backupIP) ? null : backupIP; }
String getUrl(final String host) { if (emptyString(host)) return url; try { return HttpUrl.parse(url).newBuilder().host(host).build().toString(); } catch (NullPointerException e) { return null; } }
public static String getAuthRequestHeader() { final String username = Pref.getString("tidepool_username", null); final String password = Pref.getString("tidepool_password", null); if (emptyString(username) || emptyString(password)) return null; return Credentials.basic(username.trim(), password); } }
String getUrl(final String host) { if (emptyString(host)) return url; try { return HttpUrl.parse(url).newBuilder().host(host).build().toString(); } catch (NullPointerException e) { return null; } }
public static String getAuthRequestHeader() { final String username = Pref.getString("tidepool_username", null); final String password = Pref.getString("tidepool_password", null); if (emptyString(username) || emptyString(password)) return null; return Credentials.basic(username.trim(), password); } }
private static String getOasisIP() { final String ip = getOasisIPfromPrefs(); if (emptyString(lastLoadedIP)) { lastLoadedIP = ip; } setCurrentToBackup(ip, lastLoadedIP); return ip; }
private static String getOasisIP() { final String ip = getOasisIPfromPrefs(); if (emptyString(lastLoadedIP)) { lastLoadedIP = ip; } setCurrentToBackup(ip, lastLoadedIP); return ip; }
public static SpannableString nanoStatus() { if (JoH.emptyString(lastErrorState)) return null; return Span.colorSpan(lastErrorState, CRITICAL.color()); }
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 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); } }
public static List<StatusItem> megaStatus() { final KeyStore keyStore = FastStore.getInstance(); final List<StatusItem> l = new ArrayList<>(); l.add(new StatusItem("Tidepool Synced to", niceTimeScalar(msSince(UploadChunk.getLastEnd())) + " ago")); // TODO needs generic message format string final String status = keyStore.getS(TidepoolUploader.STATUS_KEY); if (!JoH.emptyString(status)) { l.add(new StatusItem("Tidepool Status", status)); } return l; } }
public static List<StatusItem> megaStatus() { final KeyStore keyStore = FastStore.getInstance(); final List<StatusItem> l = new ArrayList<>(); l.add(new StatusItem("Tidepool Synced to", niceTimeScalar(msSince(UploadChunk.getLastEnd())) + " ago")); // TODO needs generic message format string final String status = keyStore.getS(TidepoolUploader.STATUS_KEY); if (!JoH.emptyString(status)) { l.add(new StatusItem("Tidepool Status", status)); } return l; } }
public static boolean probeOasis(final String topic, final String hint) { if (emptyString(hint)) return false; if (Home.get_follower()) { final String url = HttpUrl.parse(getInitialUrl(hint)).newBuilder().addPathSegment("sync").addPathSegment("id") .addPathSegment(topic) .build().toString(); UserError.Log.d(TAG, "PROBE: " + url); queue.add(new QueueItem(url).setHandler(MasterPing)); runInBackground(); } else { UserError.Log.e(TAG, "Probe cancelled as not follower"); } return true; }
private void probeModelTypeIfUnknown() { if (emptyString(LeFun.getModel())) { new QueueMe() .setBytes(new TxPing().getBytes()) .setDescription("Set Probe model type") .expectReply().expireInSeconds(30) .queue(); } }
private void probeModelTypeIfUnknown() { if (emptyString(LeFun.getModel())) { new QueueMe() .setBytes(new TxPing().getBytes()) .setDescription("Set Probe model type") .expectReply().expireInSeconds(30) .queue(); } }