Removing buggy EXTRA_ALARM_COUNT call and useless log statement (#139)

* Removing ALARM_EXTRA_COUNT code as it was just being used for a non essential log message

Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
This commit is contained in:
James Sutton 2016-10-13 11:30:43 +01:00 committed by GitHub
parent 3c87e55625
commit ad1ea94d51

View File

@ -138,19 +138,8 @@ class AlarmPingSender implements MqttPingSender {
// This guarantees that the phone will not sleep until you have
// finished handling the broadcast.", but this class still get
// a wake lock to wait for ping finished.
int count;
try {
count = intent.getIntExtra(Intent.EXTRA_ALARM_COUNT, -1);
} catch (ClassCastException ex){
// This is a Motorola Phone (Probably a Moto G or X)
// And so Intent.EXTRA_ALARM_COUNT is actually a Long!
Long longCount = intent.getLongExtra(Intent.EXTRA_ALARM_COUNT, -1);
count = longCount.intValue();
}
Log.d(TAG, "Ping " + count + " times.");
Log.d(TAG, "Check time :" + System.currentTimeMillis());
Log.d(TAG, "Sending Ping at:" + System.currentTimeMillis());
PowerManager pm = (PowerManager) service
.getSystemService(Service.POWER_SERVICE);