title: Service not starting on Oreo in app widget using PendingIntent
body: <p>I'm using Android app widgets. I'm creating a <code>PendingIntent</code> object and use it in the method <code>RemoteViews#setOnClickPendingIntent()</code>. This is the pending intent:</p>
  
  <pre><code>// The below code is called in the onUpdate(Context, AppWidgetManager, int[]) method of the AppWidgetProvider class.
  
  // Explicit intent
  Intent intent = new Intent(context, MyService.class);
  intent.setAction(MY_ACTION);
  intent.putExtra(EXTRA_KEY, VALUE);
  
  // Create the pending intent
  PendingIntent pendingIntent = PendingIntent.getService(context, appWidgetId, intent, 0);
  
  // 'views' is a RemoteViews object provided by onUpdate in the AppWidgetProvider class.
  views.setOnClickPendingIntent(R.id.root_layout, pendingIntent);
  </code></pre>
  
  <p>The above code works as expected before Android Oreo. However, in Android Oreo it no longer starts the service if the app is swiped away from recents. (no longer active). Aren't <code>PendingIntent</code>s excluded in Oreo's background execution limits?</p>
  
  <p>For testing purposes I replaced <code>getService</code> with <code>getForegroundService</code> but the <code>Service</code> is still not started. Both methods show the below message in the log:</p>
  
  <pre><code>W/ActivityManager: Background start not allowed: service Intent { act=com.example.myapp.MY_ACTION flg=0x10000000 cmp=com.example.myapp/com.example.myapp.MyService bnds=[607,716][833,942] (has extras) } to com.example.myapp/com.example.myapp.MyService from pid=-1 uid=10105 pkg=com.example.myapp
  </code></pre>
  
  <p>Why is the <code>Service</code> not started, even when using <code>getForegroundService</code>?  I tested this on a Nexus 6P running Android 8.1.0.</p>