title: PowerManager.isIgnoringBatteryOptimizations always returns true even if is removed from 'Not optimized apps'
body: <p>I have a mileage logbook app which does GPS tracking and is able to establish a OBDII connection to a car in background.</p>
  
  <p>Now I want to show a Popup which informs the users if my app is not whitelisted in doze since this may stop my background (actually foreground) services...</p>
  
  <p>I do:</p>
  
  <pre><code> String PACKAGE_NAME = getApplicationContext().getPackageName();
              PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
              boolean status = false;
              status = pm.isIgnoringBatteryOptimizations(PACKAGE_NAME);
  
              if (!status) {
                  // show popup
              }
  </code></pre>
  
  <p>but PowerManager.isIgnoringBatteryOptimizations always returns 'true' even if it is removed from 'Not optimized apps' again. Only if I uninstall the app 'false' is returned again...
  Tested on Galaxy Note 8 (Android 8.0) and Emulator 8.1</p>
  
  <p>Question is simple: Is this a bug? Or how to remove the app from whitelist so that PowerManager.isIgnoringBatteryOptimizations is returnung 'false' again?</p>