Add an AlarmManager API to set the system time (with the proper permissions).

This commit is contained in:
Dan Egnor
2010-02-04 20:27:47 -08:00
parent 9446c50468
commit 97e4494728
6 changed files with 67 additions and 3 deletions

View File

@ -242,6 +242,14 @@ class AlarmManagerService extends IAlarmManager.Stub {
setRepeating(type, bucketTime, interval, operation);
}
public void setTime(long millis) {
mContext.enforceCallingOrSelfPermission(
"android.permission.SET_TIME",
"setTime");
SystemClock.setCurrentTimeMillis(millis);
}
public void setTimeZone(String tz) {
mContext.enforceCallingOrSelfPermission(
"android.permission.SET_TIME_ZONE",