title: Android O and background limits prevents simple alarm notification
body: <p>My own app uses the exact same technique as shown by Google I/O app of 2016. <a href="https://github.com/google/iosched" rel="noreferrer">see source</a></p>
  
  <p>I need to remind users at a very specific point in time - using a notification.</p>
  
  <p>For this, I use the <code>AlarmManager</code> to wake the device at the correct point in time:</p>
  
  <pre><code>    if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
          am.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, alarmTime, pendingIntent);
      } else if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.KITKAT) {
          am.setExact(AlarmManager.RTC_WAKEUP, alarmTime, pendingIntent);
      } else {
          am.set(AlarmManager.RTC_WAKEUP, alarmTime, pendingIntent);
      }
  </code></pre>
  
  <p>The <code>pendingIntent</code> is created like this:</p>
  
  <pre><code>    final Intent intent = new Intent(MyAlarmService.ACTION_NOTIFY_RIDE, null, this, MyAlarmService.class);
      pendingIntent = PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
  </code></pre>
  
  <p>Now, my <code>MyAlarmService</code> class is a simple <code>IntentService</code> handling the wake-up just for the purpose of create a notification for the user.</p>
  
  <p>The message I get in the log is the following:</p>
  
  <pre><code>W/ActivityManager: Background start not allowed: service Intent { act=xxx.xxx.xxx.action.NOTIFY_RIDE flg=0x4 cmp=xxx.xxx.xxx./xxx.xxx.xxx.service.MyAlarmService (has extras) } 
  </code></pre>
  
  <p>Now, Google's own implementation is obviously broken - even though I do not want to do any heavy background work, I cannot use this technique anymore. But HOW am I supposed to wake up the user at a very specific point in time then? (think of my App as an alarm clock)</p>