title: Android Oreo foreground service not work in Doze mode
body: <p>To overcome the android OREO (targetSdkVersion 27) background service limitation, I have created a foreground service with Notification. Notification is showing in notification bar and so far the service is running. I have put my code related to Activity Recognition and Location Tracking using FusedLocationClient in the foreground service class. The ActivityRecognition and Location Tracking are working as expected when the phone is active or the screen is on. But they don’t work when the screen is off or in Doze mode. I am not sure whether I am misunderstanding the Android documentation that there should not have any limitation while using Foreground Service with visible Notification. </p>
  
  <p>My primary target is to get user Activity Status and Location record on maximum 1/2 minutes interval. But my current foreground service provides location and activity fewer times and it only returns when the device screen is ON. 
  By the way, my foreground service is not a bound service and I start the service using following code:</p>
  
  <pre><code>Intent startIntent = new Intent(_context, ForegroundLocationService.class);
  ContextCompat.startForegroundService(_context.getApplicationContext(),startIntent);
  </code></pre>
  
  <p>I am calling above code using a helper class which is called from MainApplication (extends Application) class, not from any activity class.</p>
  
  <p>So, in OREO what else I have to do to achieve my target, please suggest me.</p>