title: How to WhiteList app in Doze mode Android 6.0
body: <p>This question is related to the Android 6.0 Preview 3 which will be final released at the end of this month.</p>
  
  <p>I'm testing some stuff in Android 6.0 in the preview 3 from Google on Nexus 5 'hammerhead'.</p>
  
  <p>The new feature is the "doze mode" - something like deep sleep mode when the network is disabled and phone sleeps, only the SMS, calls or high priority GCM messages can wake it up. But like WhatsApp - in the doze mode it receives the messages after 2 hours or more depends on the timers. But there is a list of 'not optimised' apps called "white list" where u can manually add app.</p>
  
  <p>Ok, I'd like to find a way to add my application programmatically without user interaction to the "white list app list" which exists in the device in battery settings.</p>
  
  <p>Trying to use the reflection to get into it I found:</p>
  
  <p>Within the android.os.IDeviceIdleController there is a method:</p>
  
  <blockquote>
    <p>public abstract void addPowerSaveWhitelistApp (String packageNameOfApp)</p>
  </blockquote>
  
  <p>But this is an interface... So we can not make an instance of interface.</p>
  
  <p>There is not yet documentation about this Interface or about methods, or any inheritance tree.</p>
  
  <p>Maybe you have some idea where i should look for a possibility of programmatically add there my app?</p>
  
  <p>There is also a method</p>
  
  <blockquote>
    <p>public abstract boolean isPowerSaveWhitelistApp (String packageName)</p>
  </blockquote>
  
  <p>Which i think should be possible to access somehow?! to check if the app exist on the White List and maybe at the very end hopefully ASK user to add it to the White List.</p>
  
  <p>So my question is, have anyone of you tried to make something with better result ?? cuz I'm stuck and i think its a dead end. </p>
  
  <p>for more info: <a href="https://newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-doze">https://newcircle.com/s/post/1739/2015/06/12/diving-into-android-m-doze</a></p>