I want to set system clock by SystemClock.setCurrentTimeMillis
, but met following error:
"Unable to open alarm driver: Permission denied"
Below is the Description of setCurrentMillis
API from Android Developers Site:
public static boolean setCurrentTimeMillis (long millis)
Since: API Level 1 Sets the current wall time, in milliseconds. Requires the calling process to have appropriate permissions.
Returns if the clock was successfully set to the specified time.
So, Application Needs to obtain the Permission to set the time.
In AndroidManisfest.xml I inserted android.permission.SET_TIME
but I have the same message error.
I have tried various solutions found in the internet and it seems that it's not possible to set system time without root even on FroYo (Android 2.2) where android.permission.SET_TIME
was introduced, normal application can't get this permission because /dev/alarm file has 664 permission
. So the solution is to change permission in 666
but require rooted device and is too invasive to be a solution.
I want to create an App for my Company to synchronize data between different systems and is essential to have synchronized clocks.
Thank you in advance for your willingness
Eclipses