|
|
|
@ -416,7 +416,7 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
String action = intent.getAction();
|
|
|
|
|
if (TextUtils.equals(ACTION_HEARTBEAT, action)) {
|
|
|
|
|
Log.i(TAG, "HB Timer Fired ACTION=" + action);
|
|
|
|
|
infoLog("HB Timer Fired ACTION=" + action);
|
|
|
|
|
Runnable runnable = new Runnable() {
|
|
|
|
|
public void run() {
|
|
|
|
|
mService.sendHeartbeat(mService.mNativeHandle, mService.getSignalLevel());
|
|
|
|
@ -655,6 +655,10 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
alarmIntent.putExtra("HeartbeatTime", triggerTime);
|
|
|
|
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
|
|
|
|
|
|
|
Date date = new Date(triggerTime);
|
|
|
|
|
String dateStr = (String) DateFormat.format("kk:mm:ss", date);
|
|
|
|
|
infoLog( "HB Reg: " + dateStr + " Time=" + dateStr);
|
|
|
|
|
|
|
|
|
|
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
|
|
|
|
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, triggerTime, pendingIntent);
|
|
|
|
|
}
|
|
|
|
|