title: Android system application DEVICE_POWER permission error
body: <p>I try to use <code>goToSleep()</code> method to put phone into deep sleep.
  Program was installed into /system/app directory so Android System Info says, that it is a system application, but if i try call goToSleep() i get this error</p>
  
  <p><strong>Neither user 10085 nor current process has android.permission.DEVICE_POWER.</strong></p>
  
  <p>Code sampling:</p>
  
  <pre class="lang-java prettyprint-override"><code>            IPowerManager mPowerManager = IPowerManager.Stub.asInterface(ServiceManager.getService("power"));
  
              long time = SystemClock.uptimeMillis() + 1000;
              try {
                  mPowerManager.goToSleep(time);
              } catch (RemoteException e) {
                   Toast.makeText(getApplicationContext(), "error: " + e.toString(), Toast.LENGTH_LONG).show();
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;permission android:name="android.permission.DEVICE_POWER"/&gt; 
  &lt;uses-permission android:name="android.permission.DEVICE_POWER" /&gt;
  &lt;permission android:name="android.permission.REBOOT"/&gt;
  &lt;uses-permission android:name="android.permission.REBOOT"/&gt;
  </code></pre>
  
  <p>As i understand, if i run system application than i can gain access to all android hide or system functions, or i'm wrong?</p>
  
  <p>Things that i try to do to run app as system applicaiton:</p>
  
  <ol>
  <li>copy file to /system/app</li>
  <li>chown 0:0</li>
  <li>chmod 4755</li>
  <li>chmod ugo+s</li>
  </ol>
  
  <p>Maybe someone else has already encountered this problem. Any suggestions would be helpful</p>