Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,17 @@ private void checkBackAfterMissedTime(long alarmIn) {

// alarmIn is relative time ms
public void setAlarm(long alarmIn, boolean force) {
if(!force && (alarmIn < 5 * 60 * 1000)) {
// No need to check more than once every 5 minutes
alarmIn = 5 * 60 * 1000;
final SharedPreferences prefs;
final Context context;
final int bg_missed_minutes;

context = getApplicationContext();
prefs = PreferenceManager.getDefaultSharedPreferences(context);
bg_missed_minutes = readPerfsInt(prefs, "bg_missed_minutes", 5);// No need to check more than once every 5 minutes


if(!force && (alarmIn < bg_missed_minutes * 60 * 1000)) {
alarmIn = bg_missed_minutes * 60 * 1000;
}
Log.d(TAG, "Setting timer to " + alarmIn / 60000 + " minutes from now" );
//Calendar calendar = Calendar.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public static boolean isCollecting() {
}
}

Log.w(TAG,"isCollecting() returns: " + m_communicationStarted);

return m_communicationStarted;
}

Expand All @@ -99,7 +101,7 @@ public static void clearPin() {
}

public static void initialize() {
Log.i(TAG, "initialize!");
Log.w(TAG, "initialize Blukon!");
Pref.setInt("bridge_battery", 0); //force battery to no-value before first reading
Pref.setInt("nfc_sensor_age", 0); //force sensor age to no-value before first reading
JoH.clearRatelimit(BLUKON_GETSENSORAGE_TIMER);
Expand Down