public static void checkForDropAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean falling_alert = prefs.getBoolean("falling_alert", false); if(!falling_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.d("NOTIFICATIONS", "checkForDropAllert: Notifications are currently disabled!!"); return; } String dropRate = prefs.getString("falling_bg_val", "2"); float fdropRate = 2; try { fdropRate = Float.parseFloat(dropRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "reading falling_bg_val failed, continuing with 2", nfe); } Log.i(TAG_ALERT, "checkForDropAllert will check for rate of " + fdropRate); boolean dropAlert = checkForDropRiseAllert(fdropRate, true); Notifications.DropAlert(context, dropAlert); }
public static void checkForRisingAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean rising_alert = prefs.getBoolean("rising_alert", false); if(!rising_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: Notifications are currently disabled!!"); return; } String riseRate = prefs.getString("rising_bg_val", "2"); float friseRate = 2; try { friseRate = Float.parseFloat(riseRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "checkForRisingAllert reading falling_bg_val failed, continuing with 2", nfe); } Log.d(TAG_ALERT, "checkForRisingAllert will check for rate of " + friseRate); boolean riseAlert = checkForDropRiseAllert(friseRate, false); Notifications.RisingAlert(context, riseAlert); }
public static void checkForRisingAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean rising_alert = prefs.getBoolean("rising_alert", false); if(!rising_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: Notifications are currently disabled!!"); return; } String riseRate = prefs.getString("rising_bg_val", "2"); float friseRate = 2; try { friseRate = Float.parseFloat(riseRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "checkForRisingAllert reading falling_bg_val failed, continuing with 2", nfe); } Log.d(TAG_ALERT, "checkForRisingAllert will check for rate of " + friseRate); boolean riseAlert = checkForDropRiseAllert(friseRate, false); Notifications.RisingAlert(context, riseAlert); }
public static void checkForDropAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean falling_alert = prefs.getBoolean("falling_alert", false); if(!falling_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.d("NOTIFICATIONS", "checkForDropAllert: Notifications are currently disabled!!"); return; } String dropRate = prefs.getString("falling_bg_val", "2"); float fdropRate = 2; try { fdropRate = Float.parseFloat(dropRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "reading falling_bg_val failed, continuing with 2", nfe); } Log.i(TAG_ALERT, "checkForDropAllert will check for rate of " + fdropRate); boolean dropAlert = checkForDropRiseAllert(fdropRate, true); Notifications.DropAlert(context, dropAlert); }
public static void checkForRisingAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean rising_alert = prefs.getBoolean("rising_alert", false); if(!rising_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.i("NOTIFICATIONS", "checkForRisingAllert: Notifications are currently disabled!!"); return; } String riseRate = prefs.getString("rising_bg_val", "2"); float friseRate = 2; try { friseRate = Float.parseFloat(riseRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "checkForRisingAllert reading falling_bg_val failed, continuing with 2", nfe); } Log.d(TAG_ALERT, "checkForRisingAllert will check for rate of " + friseRate); boolean riseAlert = checkForDropRiseAllert(friseRate, false); Notifications.RisingAlert(context, riseAlert); }
public static void checkForDropAllert(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); Boolean falling_alert = prefs.getBoolean("falling_alert", false); if(!falling_alert) { return; } if(prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()){ Log.d("NOTIFICATIONS", "checkForDropAllert: Notifications are currently disabled!!"); return; } String dropRate = prefs.getString("falling_bg_val", "2"); float fdropRate = 2; try { fdropRate = Float.parseFloat(dropRate); } catch (NumberFormatException nfe) { Log.e(TAG_ALERT, "reading falling_bg_val failed, continuing with 2", nfe); } Log.i(TAG_ALERT, "checkForDropAllert will check for rate of " + fdropRate); boolean dropAlert = checkForDropRiseAllert(fdropRate, true); Notifications.DropAlert(context, dropAlert); }