public void onClick(DialogInterface dialog, int whichButton) { if (Pref.getBooleanDefaultFalse("default_to_voice_notes")) showcasemenu(SHOWCASE_NOTE_LONG); dialog = null; } });
private static boolean addChannelGroup() { // If notifications are grouped, the BG number icon doesn't update if (Pref.getBooleanDefaultFalse("use_number_icon")) { return false; } return Pref.getBooleanDefaultFalse("notification_channels_grouping"); }
private static boolean addChannelGroup() { // If notifications are grouped, the BG number icon doesn't update if (Pref.getBooleanDefaultFalse("use_number_icon")) { return false; } return Pref.getBooleanDefaultFalse("notification_channels_grouping"); }
public static String noiseString(double thisnoise) { if (thisnoise > NOISE_HIGH) return "Extreme"; if (thisnoise > NOISE_TOO_HIGH_FOR_PREDICT) return "Very High"; if (thisnoise > NOISE_TRIGGER) return "High"; if (thisnoise > NOISE_TRIGGER_ULTRASENSITIVE && Pref.getBooleanDefaultFalse("engineering_mode") && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive")) return "Some"; return "Low"; }
protected static boolean compensateNoise() { return (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER || (BgGraphBuilder.last_noise > BgGraphBuilder.NOISE_TRIGGER_ULTRASENSITIVE && Pref.getBooleanDefaultFalse("engineering_mode") && Pref.getBooleanDefaultFalse("bg_compensate_noise_ultrasensitive") )) && (BgGraphBuilder.best_bg_estimate > 0) && (BgGraphBuilder.last_bg_estimate > 0) && (prefs.getBoolean("bg_compensate_noise", false)); }
private void attemptSend() { if (Pref.getBooleanDefaultFalse("cloud_storage_api_enable") || Pref.getBooleanDefaultFalse("wear_sync") || Pref.getBooleanDefaultFalse("cloud_storage_mongodb_enable") || Pref.getBooleanDefaultFalse("cloud_storage_influxdb_enable")) { synctoCloudDatabases(); // attempt to sync queues startSyncService(6 * Constants.MINUTE_IN_MS); // set retry timer } }
private String getDeviceString(BgReading record) { String withMethod = "xDrip-" + prefs.getString("dex_collection_method", "BluetoothWixel"); if (Pref.getBooleanDefaultFalse("nightscout_device_append_source_info") && record.source_info != null && record.source_info.length() > 0) { return withMethod + " " + record.source_info; } return withMethod; }
private String getDeviceString(BgReading record) { String withMethod = "xDrip-" + prefs.getString("dex_collection_method", "BluetoothWixel"); if (Pref.getBooleanDefaultFalse("nightscout_device_append_source_info") && record.source_info != null && record.source_info.length() > 0) { return withMethod + " " + record.source_info; } return withMethod; }
private static boolean getEGlucose() { // if (android_wear) { return usingG6() && Pref.getBooleanDefaultFalse("show_g_prediction"); // } else { // return usingG6(); // } }
private static void sendToAmazfit() { if (Pref.getBooleanDefaultFalse("pref_amazfit_enable_key")) { JoH.startService(Amazfitservice.class); } }
private static void sendToAmazfit() { if (Pref.getBooleanDefaultFalse("pref_amazfit_enable_key")) { JoH.startService(Amazfitservice.class); } }
private NotificationCompat.Builder notificationBuilder(String title, String content, Intent intent, String channelId) { return new NotificationCompat.Builder(mContext, channelId) .setVisibility(Pref.getBooleanDefaultFalse("public_notifications") ? Notification.VISIBILITY_PUBLIC : Notification.VISIBILITY_PRIVATE) .setSmallIcon(R.drawable.ic_action_communication_invert_colors_on) .setContentTitle(title) .setContentText(content) .setPriority(Pref.getBooleanDefaultFalse("high_priority_notifications") ? Notification.PRIORITY_MAX : Notification.PRIORITY_HIGH) .setContentIntent(notificationIntent(intent)); }
@Override public void onClick(View v) { if (!Pref.getBooleanDefaultFalse("default_to_voice_notes")) { showNoteTextInputDialog(v, 0); } else { promptSpeechNoteInput(v); } } });
public synchronized void Snooze(Context ctx, int repeatTime) { Snooze(ctx, repeatTime, true); if (Pref.getBooleanDefaultFalse("bg_notifications_watch") ) { startWatchUpdaterService(ctx, WatchUpdaterService.ACTION_SNOOZE_ALERT, TAG, "repeatTime", "" + repeatTime); } }
public synchronized void Snooze(Context ctx, int repeatTime) { Snooze(ctx, repeatTime, true); if (Pref.getBooleanDefaultFalse("bg_notifications_watch") ) { startWatchUpdaterService(ctx, WatchUpdaterService.ACTION_SNOOZE_ALERT, TAG, "repeatTime", "" + repeatTime); } }
public static boolean isDataSuitableForDoubleCalibration() { final List<BgReading> uncalculated = BgReading.latestUnCalculated(3); if (uncalculated.size() < 3) return false; final ProcessInitialDataQuality.InitialDataQuality idq = ProcessInitialDataQuality.getInitialDataQuality(uncalculated); if (!idq.pass) { UserError.Log.d(TAG, "Data quality failure for double calibration: " + idq.advice); } return idq.pass || Pref.getBooleanDefaultFalse("bypass_calibration_quality_check"); }
public static void pushTreatmentSyncToWatch(Treatments treatment, boolean is_new) { Log.d(TAG, "pushTreatmentSyncToWatch Add treatment to UploaderQueue."); if (Pref.getBooleanDefaultFalse("wear_sync")) { if (UploaderQueue.newEntryForWatch(is_new ? "insert" : "update", treatment) != null) { SyncService.startSyncService(3000); // sync in 3 seconds } } }
private static void sendToWear() { if ((Pref.getBooleanDefaultFalse("wear_sync")) && !Home.get_forced_wear()) {//KS not necessary since MongoSendTask sends UploaderQueue.newEntry BG to WatchUpdaterService.sendWearUpload JoH.startService(WatchUpdaterService.class); // I don't think this wakelock is really needed anymore if (Pref.getBoolean("excessive_wakelocks", false)) { JoH.getWakeLock("wear-quickFix3", 15000); // dangling wakelock } } }
private static void textToSpeech(BgReading bgReading, BestGlucose.DisplayGlucose dg) { //Text to speech if (Pref.getBooleanDefaultFalse("bg_to_speech") || VehicleMode.shouldSpeak()) { if (dg == null) dg = BestGlucose.getDisplayGlucose(); if (dg != null) { BgToSpeech.speak(dg.mgdl, dg.timestamp, dg.delta_name); } else { BgToSpeech.speak(bgReading.calculated_value, bgReading.timestamp, bgReading.slopeName()); } } }
private static void uploadToShare(BgReading bgReading, boolean is_follower) { if ((!is_follower) && (Pref.getBooleanDefaultFalse("share_upload"))) { if (JoH.ratelimit("sending-to-share-upload", 10)) { UserError.Log.d("ShareRest", "About to call ShareRest!!"); String receiverSn = Pref.getString("share_key", "SM00000000").toUpperCase(); BgUploader bgUploader = new BgUploader(xdrip.getAppContext()); bgUploader.upload(new ShareUploadPayload(receiverSn, bgReading)); } } } }