Alternate to use Window inside Android Services
<p>i would like to use following code to turn off Button back that i got from <a href="http://stackoverflow.com/a/4937448/1218762">http://stackoverflow.com/a/4937448/1218762</a></p>

<pre><code>final Window win = getWindow();
final WindowManager.LayoutParams winParams = win.getAttributes();
winParams.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;

//set screen brightness to the lowest possible
winParams.screenBrightness = 0.01f;

if (Build.VERSION.SDK_INT &lt; 8) {
  // hack for pre-froyo to set buttonBrightness off
  try {
      Field buttonBrightness = winParams.getClass().getField(
            "buttonBrightness");
      buttonBrightness.set(winParams, 0);
     }   catch (Exception e) {
       e.printStackTrace();
     }
} else {
 winParams.buttonBrightness = 0;
 }
win.setAttributes(winParams);
</code></pre>

<p><strong>Reference :</strong> visit <a href="https://play.google.com/store/apps/details?id=pt.bbarao.nightmode&amp;feature=search_result#?t=W251bGwsMSwxLDEsInB0LmJiYXJhby5uaWdodG1vZGUiXQ" rel="nofollow"> Night Mode</a> where you you can turn off Button Lights in Service , i know Services don't have Window but how is it possible ?</p>

<p>Thank You.</p>
