OBE Easy finally fixed

After failing with wakelocks and changing from Service to Broadcast Receiever I almost gave up thinking it was my phone which was broken.

Yesterday I finally got it fixed! The problem was that in Android 6.0 a Doze mode was introduced which caused the phone to ignore a lot of stuff when it was idling.

Instead of using AlarmManager.set, it was crucial to use the new setAlarm function:

if (Build.VERSION.SDK_INT >= 23) {
am.setAlarmClock(new AlarmManager.AlarmClockInfo(alarmInTimeMillis, pis.get(i)), pis.get(i));
} else if (Build.VERSION.SDK_INT >= 19) {
am.setExact(AlarmManager.RTC_WAKEUP, alarmInTimeMillis, pis.get(i));
} else {
am.set(AlarmManager.RTC_WAKEUP, alarmInTimeMillis, pis.get(i));
}

Really hope it’s fixed now. It finally worked this morning on my phone at least.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>