private static void addToQueue(BgReading bgReading, String operation_type) { BgSendQueue bgSendQueue = new BgSendQueue(); bgSendQueue.operation_type = operation_type; bgSendQueue.bgReading = bgReading; bgSendQueue.success = false; bgSendQueue.mongo_success = false; bgSendQueue.save(); Log.d("BGQueue", "New value added to queue!"); }
public static void handleNewBgReading(BgReading bgReading, String operation_type, Context context, boolean is_follower) { handleNewBgReading(bgReading, operation_type, context, is_follower, false); }
public static double inMgdl(double value, SharedPreferences sPrefs) {//KS change to static if (!doMgdl(sPrefs)) { return value * Constants.MMOLL_TO_MGDL; } else { return value; } }
BgSendQueue.sendToPhone(context); } else { Log.d(TAG, "Calibrations, so doing everything: " + calibration.uuid); BgSendQueue.handleNewBgReading(bgReading, "create", context, Home.get_follower(), quick);
public synchronized static void updateDB() { final String[] updates = new String[]{"ALTER TABLE BgReadings ADD COLUMN dg_mgdl REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_slope REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_delta_name TEXT;", "ALTER TABLE BgReadings ADD COLUMN source_info TEXT;"}; for (String patch : updates) { try { SQLiteUtils.execSql(patch); } catch (Exception e) { } } // needs different handling on wear if (JoH.areWeRunningOnAndroidWear()) { BgSendQueue.emptyQueue(); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT FAIL", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT IGNORE", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgSendQueue", "BgReadings_temp", "BgReadings"); } }
BgSendQueue.sendToPhone(context); } else { Log.d(TAG, "Calibrations, so doing everything: " + calibration.uuid);
public void markMongoSuccess() { this.mongo_success = true; save(); }
final ArrayList<DataMap> dataMaps = new ArrayList<>(graph_bgs.size()); SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()); DataMap entries = dataMap(last_bg, sharedPrefs, bgGraphBuilder, context, battery); for (BgReading bg : graph_bgs) { dataMaps.add(dataMap(bg, sharedPrefs, bgGraphBuilder, context, battery)); entries.putString("extra_status_line", extraStatusLine(sharedPrefs)); DataMap stepsDataMap = getSensorSteps(sharedPrefs); if (stepsDataMap != null) { messageIntent.putExtra("steps", stepsDataMap.toBundle());
BgSendQueue.cleanQueue(); // no longer used
CustomComplicationProviderService.refresh(); if (!is_follower) addToQueue(bgReading, operation_type);
public synchronized static void updateDB() { final String[] updates = new String[]{"ALTER TABLE BgReadings ADD COLUMN dg_mgdl REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_slope REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_delta_name TEXT;", "ALTER TABLE BgReadings ADD COLUMN source_info TEXT;"}; for (String patch : updates) { try { SQLiteUtils.execSql(patch); } catch (Exception e) { } } // needs different handling on wear if (JoH.areWeRunningOnAndroidWear()) { BgSendQueue.emptyQueue(); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT FAIL", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT IGNORE", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgSendQueue", "BgReadings_temp", "BgReadings"); } }
BgSendQueue.sendToPhone(context); } else { Log.d(TAG, "Calibrations, so doing everything: " + calibration.uuid);
BgSendQueue.cleanQueue(); // no longer used
public static void handleNewBgReading(BgReading bgReading, String operation_type, Context context, boolean is_follower) { handleNewBgReading(bgReading, operation_type, context, is_follower, false); }
@Deprecated private static void addToQueue(BgReading bgReading, String operation_type) { BgSendQueue bgSendQueue = new BgSendQueue(); bgSendQueue.operation_type = operation_type; bgSendQueue.bgReading = bgReading; bgSendQueue.success = false; bgSendQueue.mongo_success = false; bgSendQueue.save(); Log.d("BGQueue", "New value added to queue!"); }
public synchronized static void updateDB() { final String[] updates = new String[]{"ALTER TABLE BgReadings ADD COLUMN dg_mgdl REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_slope REAL;", "ALTER TABLE BgReadings ADD COLUMN dg_delta_name TEXT;", "ALTER TABLE BgReadings ADD COLUMN source_info TEXT;"}; for (String patch : updates) { try { SQLiteUtils.execSql(patch); } catch (Exception e) { } } // needs different handling on wear if (JoH.areWeRunningOnAndroidWear()) { BgSendQueue.emptyQueue(); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT FAIL", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgReadings", "uuid TEXT UNIQUE ON CONFLICT IGNORE", "uuid TEXT UNIQUE ON CONFLICT REPLACE"); SqliteRejigger.rejigSchema("BgSendQueue", "BgReadings_temp", "BgReadings"); } }
public synchronized static void sendTreatment(String notes) { Log.d(TAG, "sendTreatment WEARABLE_TREATMENT_PAYLOAD notes=" + notes); DataMap dataMap = new DataMap(); dataMap.putDouble("timestamp", System.currentTimeMillis()); dataMap.putBoolean("watchkeypad", true); dataMap.putString("notes", notes); dataMap.putBoolean("ismgdl", doMgdl(PreferenceManager.getDefaultSharedPreferences(xdrip.getAppContext()))); Intent intent = new Intent(xdrip.getAppContext(), Simulation.class); intent.putExtra(WEARABLE_TREATMENT_PAYLOAD, dataMap.toBundle()); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); xdrip.getAppContext().startActivity(intent); }
public static void handleNewBgReading(BgReading bgReading, String operation_type, Context context) { handleNewBgReading(bgReading, operation_type, context, false); }
@Deprecated private static void addToQueue(BgReading bgReading, String operation_type) { BgSendQueue bgSendQueue = new BgSendQueue(); bgSendQueue.operation_type = operation_type; bgSendQueue.bgReading = bgReading; bgSendQueue.success = false; bgSendQueue.mongo_success = false; bgSendQueue.save(); Log.d("BGQueue", "New value added to queue!"); }
public static void handleNewBgReading(BgReading bgReading, String operation_type, Context context) { handleNewBgReading(bgReading, operation_type, context, false); }