Setting system time of ROOTED phone
<p>I am currently trying to set Android system time in software. Yes, I know that many people tried it - and failed like I do now. :-)</p>

<p>But I also know that it is possible to set Android system time on ROOTED phones. I have testet an app called ClockSync which does exaclty that.</p>

<p>So what I want is find out how to set system time on ROOTED devices. Please do not say it is not possible. :-)</p>

<p>What I tried so far is setting the following permissions:</p>

<pre><code>&lt;uses-permission android:name="android.permission.SET_TIME_ZONE"/&gt;
&lt;uses-permission android:name="android.permission.SET_TIME"/&gt;
</code></pre>

<p>And then in my code:</p>

<pre><code>AlarmManager a = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
long current_time_millies = System.currentTimeMillis();
try {
    a.setTime((long)current_time_millies+10000);
} catch (Exception e) {
// Why is this exception thrown?
}
</code></pre>

<p>But I always get the following exception: </p>

<blockquote>
  <p>java.lang.SecurityException: setTime: Neither user 10054 nor current process has android.permission.SET_TIME.</p>
</blockquote>

<p>I am testing it on the same device where ClockSync works perfectly. So - what am I doing wrong? Or better: Can you provide tested code that works?</p>
