private static void updateMigrations() { Sensor.InitDb(context);//ensure database has already been initialized BgReading.updateDB(); LibreBlock.updateDB(); LibreData.updateDB(); }
DataRequester(Context context, String thispath, byte[] thispayload) { path = thispath; payload = thispayload; if (JoH.quietratelimit("db-init",10)) { Sensor.InitDb(context);//ensure database has already been initialized } Log.d(TAG, "DataRequester DataRequester: " + thispath + " lastRequest:" + JoH.dateTimeText(lastRequest)); }
@Override public void onCreate() { Log.d(TAG, "onCreate entered"); Context context = getApplicationContext(); Home.setAppContext(context); xdrip.checkAppContext(context); Sensor.InitDb(context); mPrefs = PreferenceManager.getDefaultSharedPreferences(context); listenForChangeInSettings(); setupStepSensor(); super.onCreate(); }
Boolean connected = dataMap.getBoolean("connected", false); Log.d(TAG, "syncActiveBtDeviceData add ActiveBluetoothDevice for name=" + name + " address=" + address + " connected=" + connected); Sensor.InitDb(context);//ensure database has already been initialized if (name != null && !name.isEmpty() && address != null && !address.isEmpty()) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
private boolean resetDataToLatest(DataMap dataMap, Context context) {//KS if (dataMap != null) { Double dmTimestamp = dataMap.getDouble("timestamp"); Log.d(TAG, "resetDataToLatest dataMap.datetime=" + JoH.dateTimeText(dmTimestamp.longValue()) + " dataMap.sgvDouble=" + dataMap.getDouble("sgvDouble")); // todo ratelimit Sensor.InitDb(context);//ensure database has already been initialized final BgReading last = BgReading.last(); if (last != null) { long bgTimestamp = last.timestamp; Log.d(TAG, "resetDataToLatest last.timestamp=" + JoH.dateTimeText(bgTimestamp) + " last.calculated_value=" + last.calculated_value); if (bgTimestamp > dmTimestamp) { dataMap(dataMap, last, mPrefs, new com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder(context)); return true; } } } return false; }
Sensor.InitDb(context);//ensure database has already been initialized for (DataMap entry : entries) { if (entry != null) {
Sensor.InitDb(context);//ensure database has already been initialized AlertType.remove_all(); for (DataMap entry : entries) {
.create(); Log.d(TAG, "syncTreatmentsData add Treatments Table entries count=" + entries.size()); Sensor.InitDb(context);//ensure database has already been initialized for (DataMap entry : entries) { if (entry != null) {
Sensor.InitDb(context);//ensure database has already been initialized Sensor sensor = Sensor.currentSensor(); if (sensor != null) {
private void syncSensorData(DataMap dataMap, Context context) {//KS Log.d(TAG, "syncSensorData"); if (dataMap != null) { String uuid = dataMap.getString("uuid"); Log.d(TAG, "syncSensorData add Sensor for uuid=" + uuid); long started_at = dataMap.getLong("started_at"); Integer latest_battery_level = dataMap.getInt("latest_battery_level"); String sensor_location = dataMap.getString("sensor_location"); Sensor.InitDb(context);//ensure database has already been initialized if (uuid != null && !uuid.isEmpty()) { Log.d(TAG, "syncSensorData add Sensor for uuid=" + uuid + " timestamp=" + started_at + " timeString=" + JoH.dateTimeText(started_at)); Sensor sensor = Sensor.getByUuid(uuid); if (sensor == null) { Log.d(TAG, "syncSensorData createUpdate new Sensor..."); Sensor.createUpdate(started_at, 0, latest_battery_level, sensor_location, uuid); Sensor newsensor = Sensor.currentSensor(); if (newsensor != null) { Log.d(TAG, "syncSensorData createUpdate Sensor with uuid=" + uuid + " started at=" + started_at); } else Log.d(TAG, "syncSensorData Failed to createUpdate new Sensor for uuid=" + uuid); } else Log.d(TAG, "syncSensorData Sensor already exists with uuid=" + uuid); } } }
Sensor.InitDb(context);//ensure database has already been initialized
Context context = getApplicationContext(); xdrip.checkAppContext(context); Sensor.InitDb(context);//ensure db is initialized final PowerManager.WakeLock wl = JoH.getWakeLock("g5-start-service", 120000); try {