title: Screen dimming/locking prevention android
body: <p>I am using this code to prevent dimming/locking screen, it is perfectly working for prevention of locking, but dimming effect is not prevented yet. please tell me some way out to prevent dimming also</p>
  
  <pre><code>protected void setScreenLock(boolean on){
  
  
    if(mWakeLock == null){
          PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
          mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK |
                                      PowerManager.ON_AFTER_RELEASE, TAG);
      }
      if(on){
       mWakeLock.acquire();
      }else{
          if(mWakeLock.isHeld()){
              mWakeLock.release();
          }
       mWakeLock = null;
      }
  
  }
  </code></pre>