com.eveningoutpost.dexdrip.Services.MissedReadingService Java Examples

The following examples show how to use com.eveningoutpost.dexdrip.Services.MissedReadingService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Notifications.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onHandleIntent(Intent intent) {

    final PowerManager.WakeLock wl = JoH.getWakeLock("NotificationsService", 60000);

    boolean unclearReading;
    try {
        Log.d("Notifications", "Running Notifications Intent Service");
        final Context context = getApplicationContext();

        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            // TODO move this
            ActivityRecognizedService.reStartActivityRecogniser(context);
        }

        ReadPerfs(context);
        unclearReading = notificationSetter(context);
        scheduleWakeup(context, unclearReading);
        context.startService(new Intent(context, MissedReadingService.class));

    } finally {
        JoH.releaseWakeLock(wl);
    }
}
 
Example #2
Source File: MissedReadingActivity.java    From xDrip with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    Context context = getApplicationContext();
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs.edit().putInt("missed_readings_start", AlertType.toTime(startHour, startMinute)).apply();
    prefs.edit().putInt("missed_readings_end", AlertType.toTime(endHour, endMinute)).apply();
    prefs.edit().putString("bg_missed_minutes", bgMissedMinutes.getText().toString()).apply();
    prefs.edit().putString("bg_missed_alerts_snooze", bgMissedSnoozeMin.getText().toString()).apply();
    prefs.edit().putString("bg_missed_alerts_reraise_sec", bgMissedReraiseSec.getText().toString()).apply();

    prefs.edit().putBoolean("bg_missed_alerts", checkboxEnableAlert.isChecked()).apply();
    prefs.edit().putBoolean("missed_readings_all_day", checkboxAllDay.isChecked()).apply();
    prefs.edit().putBoolean("bg_missed_alerts_enable_alerts_reraise", checkboxEnableReraise.isChecked()).apply();

    MissedReadingService.delayedLaunch();
  //  context.startService(new Intent(context, MissedReadingService.class));
}
 
Example #3
Source File: Notifications.java    From xDrip-Experimental with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onHandleIntent(Intent intent) {
    PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
    PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NotificationsIntent");
    AtomicBoolean unclearReading = new AtomicBoolean(false);
    wl.acquire();
    try {
        Log.d("Notifications", "Running Notifications Intent Service");
        Context context = getApplicationContext();
        ReadPerfs(context);
        notificationSetter(context, unclearReading);
        ArmTimer(context, unclearReading.get());
        context.startService(new Intent(context, MissedReadingService.class));
    } finally {
        if (wl.isHeld()) wl.release();
    }
}
 
Example #4
Source File: MissedReadingActivity.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    Context context = getApplicationContext();
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs.edit().putInt("missed_readings_start", AlertType.toTime(startHour, startMinute)).apply();
    prefs.edit().putInt("missed_readings_end", AlertType.toTime(endHour, endMinute)).apply();
    prefs.edit().putString("bg_missed_minutes", bgMissedMinutes.getText().toString()).apply();
    prefs.edit().putString("bg_missed_alerts_snooze", bgMissedSnoozeMin.getText().toString()).apply();
    prefs.edit().putString("bg_missed_alerts_reraise_sec", bgMissedReraiseSec.getText().toString()).apply();

    prefs.edit().putBoolean("bg_missed_alerts", checkboxEnableAlert.isChecked()).apply();
    prefs.edit().putBoolean("missed_readings_all_day", checkboxAllDay.isChecked()).apply();
    prefs.edit().putBoolean("bg_missed_alerts_enable_alerts_reraise", checkboxEnableReraise.isChecked()).apply();

    MissedReadingService.delayedLaunch();
  //  context.startService(new Intent(context, MissedReadingService.class));
}
 
Example #5
Source File: Notifications.java    From xDrip-plus with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onHandleIntent(Intent intent) {

    final PowerManager.WakeLock wl = JoH.getWakeLock("NotificationsService", 60000);

    boolean unclearReading;
    try {
        Log.d("Notifications", "Running Notifications Intent Service");
        final Context context = getApplicationContext();

        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            // TODO move this
            ActivityRecognizedService.reStartActivityRecogniser(context);
        }

        ReadPerfs(context);
        unclearReading = notificationSetter(context);
        scheduleWakeup(context, unclearReading);
        context.startService(new Intent(context, MissedReadingService.class));

    } finally {
        JoH.releaseWakeLock(wl);
    }
}
 
Example #6
Source File: xdrip.java    From xDrip-Experimental with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
    Context context = getApplicationContext();
    CollectionServiceStarter collectionServiceStarter = new CollectionServiceStarter(context);
    collectionServiceStarter.start(getApplicationContext());
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, false);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, false);
    context.startService(new Intent(context, MissedReadingService.class));	
    new IdempotentMigrations(getApplicationContext()).performAll();
    AlertType.fromSettings(getApplicationContext());
}
 
Example #7
Source File: Notifications.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onHandleIntent(Intent intent) {
    PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
    PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NotificationsIntent");
    wl.acquire(60000);
    boolean unclearReading = false;
    try {
        Log.d("Notifications", "Running Notifications Intent Service");
        final Context context = getApplicationContext();

        bg_notifications = Pref.getBoolean("bg_notifications", false);
        if (bg_notifications) {
            //KS TODO ActivityRecognizedService.reStartActivityRecogniser(context);

            /* //KS TODO if (Pref.getBoolean("motion_tracking_enabled", false)) {
                ActivityRecognizedService.reStartActivityRecogniser(context);
            }*/

            ReadPerfs(context);
            unclearReading = notificationSetter(context);
            //ArmTimer(context, unclearReading);
            //context.startService(new Intent(context, MissedReadingService.class));
        }
        ArmTimer(context, unclearReading);//KS start this to handle Collector restart
        context.startService(new Intent(context, MissedReadingService.class));//KS start this to handle Collector restart

    } finally {
        if (wl.isHeld()) wl.release();
    }
}
 
Example #8
Source File: MissedReadingActivity.java    From xDrip-Experimental with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onDestroy() {
    super.onDestroy();
    Context context = getApplicationContext();
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
    prefs.edit().putInt("missed_readings_start", AlertType.toTime(startHour, startMinute)).apply();
    prefs.edit().putInt("missed_readings_end", AlertType.toTime(endHour, endMinute)).apply();
    prefs.edit().putString("bg_missed_minutes", bgMissedMinutes.getText().toString()).apply();

    prefs.edit().putBoolean("bg_missed_alerts", checkboxEnableAlert.isChecked()).apply();
    prefs.edit().putBoolean("missed_readings_all_day", checkboxAllDay.isChecked()).apply();
    
    context.startService(new Intent(context, MissedReadingService.class));
}
 
Example #9
Source File: Notifications.java    From xDrip-Experimental with GNU General Public License v3.0 5 votes vote down vote up
private long calcuatleArmTimeUnclearalert(Context ctx, long now, boolean unclearAlert) {
    if (!unclearAlert) {
        return Long.MAX_VALUE;
    }
    Long wakeTimeUnclear = Long.MAX_VALUE;

    UserNotification userNotification = UserNotification.GetNotificationByType("bg_unclear_readings_alert");
    if (userNotification == null) {
        // An alert should have already being played, how is this NULL.
    	Log.wtf(TAG, "No active alert exists.");
        wakeTimeUnclear = now + MissedReadingService.getOtherAlertReraiseSec(ctx) * 1000;
    } else {
        // This alert is snoozed
        // reminder - userNotification.timestamp is the time that the alert should be played again
        wakeTimeUnclear = (long)userNotification.timestamp;
    }
    
    if(wakeTimeUnclear < now ) {
        // we should alert now,
        wakeTimeUnclear = now;
    }
    if( wakeTimeUnclear == Long.MAX_VALUE) {
        // Should not happen
        Log.e(TAG ,"calcuatleArmTimeUnclearalert wakeTimeUnclear bad value setting it to one minute from now " + new Date(wakeTimeUnclear) + " in " +  ((wakeTimeUnclear - now)/60000d) + " minutes" );
        return now + 60 * 1000;
    }
    Log.w(TAG ,"calcuatleArmTimeUnclearalert returning " + new Date(wakeTimeUnclear) + " in " +  ((wakeTimeUnclear - now)/60000d) + " minutes" );
    return wakeTimeUnclear;
}
 
Example #10
Source File: Notifications.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onHandleIntent(Intent intent) {
    PowerManager pm = (PowerManager) getApplicationContext().getSystemService(Context.POWER_SERVICE);
    PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "NotificationsIntent");
    wl.acquire(60000);
    boolean unclearReading = false;
    try {
        Log.d("Notifications", "Running Notifications Intent Service");
        final Context context = getApplicationContext();

        bg_notifications = Pref.getBoolean("bg_notifications", false);
        if (bg_notifications) {
            //KS TODO ActivityRecognizedService.reStartActivityRecogniser(context);

            /* //KS TODO if (Pref.getBoolean("motion_tracking_enabled", false)) {
                ActivityRecognizedService.reStartActivityRecogniser(context);
            }*/

            ReadPerfs(context);
            unclearReading = notificationSetter(context);
            //ArmTimer(context, unclearReading);
            //context.startService(new Intent(context, MissedReadingService.class));
        }
        ArmTimer(context, unclearReading);//KS start this to handle Collector restart
        context.startService(new Intent(context, MissedReadingService.class));//KS start this to handle Collector restart

    } finally {
        if (wl.isHeld()) wl.release();
    }
}
 
Example #11
Source File: Notifications.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
public static void bgUnclearAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context, "bg_unclear_readings_alert");
    OtherAlert(context, "bg_unclear_readings_alert", "Unclear Sensor Readings" + "  (@" + JoH.hourMinuteString() + ")", uncleanAlertNotificationId, NotificationChannels.BG_ALERT_CHANNEL, true, otherAlertReraiseSec);
}
 
Example #12
Source File: Notifications.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
public static void bgMissedAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context, "bg_missed_alerts");
    OtherAlert(context, "bg_missed_alerts", context.getString(R.string.bg_reading_missed) + "  (@" + JoH.hourMinuteString() + ")", missedAlertNotificationId, NotificationChannels.BG_MISSED_ALERT_CHANNEL, true, otherAlertReraiseSec);
}
 
Example #13
Source File: MissedReadingActivity.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_missed_readings);
    mContext = this;
    
    viewTimeStart = (TextView) findViewById(R.id.missed_reading_time_start);
    viewTimeEnd = (TextView) findViewById(R.id.missed_reading_time_end);
    checkboxAllDay = (CheckBox) findViewById(R.id.missed_reading_all_day);
    checkboxEnableAlert = (CheckBox) findViewById(R.id.missed_reading_enable_alert);
    checkboxEnableReraise = (CheckBox) findViewById(R.id.missed_reading_enable_alerts_reraise);
    
    layoutTimeBetween = (LinearLayout) findViewById(R.id.missed_reading_time_between);
    timeInstructions = (LinearLayout) findViewById(R.id.missed_reading_instructions);
    timeInstructionsStart = (TextView) findViewById(R.id.missed_reading_instructions_start);
    timeInstructionsEnd = (TextView) findViewById(R.id.missed_reading_instructions_end);
    bgMissedMinutes = (EditText) findViewById(R.id.missed_reading_bg_minutes);
    bgMissedSnoozeMin = (EditText) findViewById(R.id.missed_reading_bg_snooze);
    bgMissedReraiseSec = (EditText) findViewById(R.id.missed_reading_reraise_sec);
    viewAlertTime = (TextView) findViewById(R.id.missed_reading_text_alert_time);
    viewSelectTime = (TextView) findViewById(R.id.missed_reading_text_select_time);
    viewSnoozeTime = (TextView) findViewById(R.id.missed_reading_bg_snooze_text);
    viewReraiseTime = (TextView) findViewById(R.id.missed_reading_reraise_sec_text);

    
    // Set the different controls
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    int startMinutes = prefs.getInt("missed_readings_start", 0);
    int endMinutes = prefs.getInt("missed_readings_end", 0);
    boolean enableAlert = prefs.getBoolean("bg_missed_alerts",false);
    boolean allDay = prefs.getBoolean("missed_readings_all_day",true);
    boolean enableReraise = prefs.getBoolean("bg_missed_alerts_enable_alerts_reraise",false);
    
    checkboxAllDay.setChecked(allDay);
    checkboxEnableAlert.setChecked(enableAlert);
    checkboxEnableReraise.setChecked(enableReraise);
    
    startHour = AlertType.time2Hours(startMinutes);
    startMinute = AlertType.time2Minutes(startMinutes);
    endHour = AlertType.time2Hours(endMinutes);
    endMinute = AlertType.time2Minutes(endMinutes);
    bgMissedMinutes.setText(prefs.getString("bg_missed_minutes", "30"));
    bgMissedSnoozeMin.setText("" + MissedReadingService.getOtherAlertSnoozeMinutes(prefs, "bg_missed_alerts"));
    bgMissedReraiseSec.setText(prefs.getString("bg_missed_alerts_reraise_sec", "60"));
    
    addListenerOnButtons();
    enableAllControls();
}
 
Example #14
Source File: xdrip.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCreate() {
    xdrip.context = getApplicationContext();
    super.onCreate();
    try {
        if (PreferenceManager.getDefaultSharedPreferences(xdrip.context).getBoolean("enable_crashlytics", true)) {
            initCrashlytics(this);
            initBF();
        }
    } catch (Exception e) {
        Log.e(TAG, e.toString());
    }
    executor = new PlusAsyncExecutor();
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_advanced_settings, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_defaults, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_prefs, true);

    checkForcedEnglish(xdrip.context);

    JoH.ratelimit("policy-never", 3600); // don't on first load
    new IdempotentMigrations(getApplicationContext()).performAll();


    JobManager.create(this).addJobCreator(new XDripJobCreator());
    DailyJob.schedule();
    //SyncService.startSyncServiceSoon();

    if (!isRunningTest()) {
        MissedReadingService.delayedLaunch();
        NFCReaderX.handleHomeScreenScanPreference(getApplicationContext());
        AlertType.fromSettings(getApplicationContext());
        //new CollectionServiceStarter(getApplicationContext()).start(getApplicationContext());
        CollectionServiceStarter.restartCollectionServiceBackground();
        PlusSyncService.startSyncService(context, "xdrip.java");
        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            ActivityRecognizedService.startActivityRecogniser(getApplicationContext());
        }
        BluetoothGlucoseMeter.startIfEnabled();
        LeFunEntry.initialStartIfEnabled();
        MiBandEntry.initialStartIfEnabled();
        BlueJayEntry.initialStartIfEnabled();
        XdripWebService.immortality();
        VersionTracker.updateDevice();

    } else {
        Log.d(TAG, "Detected running test mode, holding back on background processes");
    }
    Reminder.firstInit(xdrip.getAppContext());
    PluggableCalibration.invalidateCache();
}
 
Example #15
Source File: SnoozeActivity.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
public void recheckAlerts() {
    Notifications.start();
    JoH.startService(MissedReadingService.class); // TODO this should be rate limited or similar as it is polled in various locations leading to excessive cpu
}
 
Example #16
Source File: xdrip.java    From xDrip-plus with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onCreate() {
    xdrip.context = getApplicationContext();
    super.onCreate();
    try {
        if (PreferenceManager.getDefaultSharedPreferences(xdrip.context).getBoolean("enable_crashlytics", true)) {
            initCrashlytics(this);
            initBF();
        }
    } catch (Exception e) {
        Log.e(TAG, e.toString());
    }
    executor = new PlusAsyncExecutor();
    PreferenceManager.setDefaultValues(this, R.xml.pref_general, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_sync, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_advanced_settings, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_notifications, true);
    PreferenceManager.setDefaultValues(this, R.xml.pref_data_source, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_defaults, true);
    PreferenceManager.setDefaultValues(this, R.xml.xdrip_plus_prefs, true);

    checkForcedEnglish(xdrip.context);

    JoH.ratelimit("policy-never", 3600); // don't on first load
    new IdempotentMigrations(getApplicationContext()).performAll();


    JobManager.create(this).addJobCreator(new XDripJobCreator());
    DailyJob.schedule();
    //SyncService.startSyncServiceSoon();

    if (!isRunningTest()) {
        MissedReadingService.delayedLaunch();
        NFCReaderX.handleHomeScreenScanPreference(getApplicationContext());
        AlertType.fromSettings(getApplicationContext());
        //new CollectionServiceStarter(getApplicationContext()).start(getApplicationContext());
        CollectionServiceStarter.restartCollectionServiceBackground();
        PlusSyncService.startSyncService(context, "xdrip.java");
        if (Pref.getBoolean("motion_tracking_enabled", false)) {
            ActivityRecognizedService.startActivityRecogniser(getApplicationContext());
        }
        BluetoothGlucoseMeter.startIfEnabled();
        LeFunEntry.initialStartIfEnabled();
        MiBandEntry.initialStartIfEnabled();
        BlueJayEntry.initialStartIfEnabled();
        XdripWebService.immortality();
        VersionTracker.updateDevice();

    } else {
        Log.d(TAG, "Detected running test mode, holding back on background processes");
    }
    Reminder.firstInit(xdrip.getAppContext());
    PluggableCalibration.invalidateCache();
}
 
Example #17
Source File: Preferences.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
    Context context = preference.getContext();
    context.startService(new Intent(context, MissedReadingService.class));
    return true;
}
 
Example #18
Source File: SnoozeActivity.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
public void recheckAlerts() {
    Notifications.start();
    JoH.startService(MissedReadingService.class); // TODO this should be rate limited or similar as it is polled in various locations leading to excessive cpu
}
 
Example #19
Source File: MissedReadingActivity.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_missed_readings);
    mContext = this;
    
    viewTimeStart = (TextView) findViewById(R.id.missed_reading_time_start);
    viewTimeEnd = (TextView) findViewById(R.id.missed_reading_time_end);
    checkboxAllDay = (CheckBox) findViewById(R.id.missed_reading_all_day);
    checkboxEnableAlert = (CheckBox) findViewById(R.id.missed_reading_enable_alert);
    checkboxEnableReraise = (CheckBox) findViewById(R.id.missed_reading_enable_alerts_reraise);
    
    layoutTimeBetween = (LinearLayout) findViewById(R.id.missed_reading_time_between);
    timeInstructions = (LinearLayout) findViewById(R.id.missed_reading_instructions);
    timeInstructionsStart = (TextView) findViewById(R.id.missed_reading_instructions_start);
    timeInstructionsEnd = (TextView) findViewById(R.id.missed_reading_instructions_end);
    bgMissedMinutes = (EditText) findViewById(R.id.missed_reading_bg_minutes);
    bgMissedSnoozeMin = (EditText) findViewById(R.id.missed_reading_bg_snooze);
    bgMissedReraiseSec = (EditText) findViewById(R.id.missed_reading_reraise_sec);
    viewAlertTime = (TextView) findViewById(R.id.missed_reading_text_alert_time);
    viewSelectTime = (TextView) findViewById(R.id.missed_reading_text_select_time);
    viewSnoozeTime = (TextView) findViewById(R.id.missed_reading_bg_snooze_text);
    viewReraiseTime = (TextView) findViewById(R.id.missed_reading_reraise_sec_text);

    
    // Set the different controls
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
    int startMinutes = prefs.getInt("missed_readings_start", 0);
    int endMinutes = prefs.getInt("missed_readings_end", 0);
    boolean enableAlert = prefs.getBoolean("bg_missed_alerts",false);
    boolean allDay = prefs.getBoolean("missed_readings_all_day",true);
    boolean enableReraise = prefs.getBoolean("bg_missed_alerts_enable_alerts_reraise",false);
    
    checkboxAllDay.setChecked(allDay);
    checkboxEnableAlert.setChecked(enableAlert);
    checkboxEnableReraise.setChecked(enableReraise);
    
    startHour = AlertType.time2Hours(startMinutes);
    startMinute = AlertType.time2Minutes(startMinutes);
    endHour = AlertType.time2Hours(endMinutes);
    endMinute = AlertType.time2Minutes(endMinutes);
    bgMissedMinutes.setText(prefs.getString("bg_missed_minutes", "30"));
    bgMissedSnoozeMin.setText("" + MissedReadingService.getOtherAlertSnoozeMinutes(prefs, "bg_missed_alerts"));
    bgMissedReraiseSec.setText(prefs.getString("bg_missed_alerts_reraise_sec", "60"));
    
    addListenerOnButtons();
    enableAllControls();
}
 
Example #20
Source File: Notifications.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
public static void bgUnclearAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context);
    String message = dateFormat.format(new Date()) + ": Unclear Sensor Readings";
    OtherAlert(context, "bg_unclear_readings_alert", message, uncleanAlertNotificationId,  otherAlertReraiseSec);
}
 
Example #21
Source File: Notifications.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
public static void bgMissedAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context);
    String message = "BG Readings Missed (" + dateFormat.format(new Date()) + ")";
    OtherAlert(context, "bg_missed_alerts", message, missedAlertNotificationId, otherAlertReraiseSec);
}
 
Example #22
Source File: AutoStart.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
    Log.d("DexDrip", "Service auto starter, starting!");
    CollectionServiceStarter.newStart(context);
    context.startService(new Intent(context, MissedReadingService.class));
}
 
Example #23
Source File: Notifications.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
public static void bgMissedAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context, "bg_missed_alerts");
    OtherAlert(context, "bg_missed_alerts", context.getString(R.string.bg_reading_missed) + "  (@" + JoH.hourMinuteString() + ")", missedAlertNotificationId, NotificationChannels.BG_MISSED_ALERT_CHANNEL, true, otherAlertReraiseSec);
}
 
Example #24
Source File: SnoozeActivity.java    From xDrip-Experimental with GNU General Public License v3.0 4 votes vote down vote up
public void recheckAlerts() {
  Context context = getApplicationContext();
  context.startService(new Intent(context, Notifications.class));
  context.startService(new Intent(context, MissedReadingService.class));
}
 
Example #25
Source File: Notifications.java    From xDrip with GNU General Public License v3.0 4 votes vote down vote up
public static void bgUnclearAlert(Context context) {
    long otherAlertReraiseSec = MissedReadingService.getOtherAlertReraiseSec(context, "bg_unclear_readings_alert");
    OtherAlert(context, "bg_unclear_readings_alert", "Unclear Sensor Readings" + "  (@" + JoH.hourMinuteString() + ")", uncleanAlertNotificationId, NotificationChannels.BG_ALERT_CHANNEL, true, otherAlertReraiseSec);
}