summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/AlarmManager.java
diff options
context:
space:
mode:
authorDan Egnor <egnor@google.com>2010-02-04 20:27:47 -0800
committerDan Egnor <egnor@google.com>2010-02-05 12:31:41 -0800
commit97e44947282b3918ee0bed2d16b33b983f882580 (patch)
treeae30514672b93407b1c9438aa46555363f9f5fc6 /core/java/android/app/AlarmManager.java
parent9446c5046872e8ae44120d4057ae724875aba1a4 (diff)
downloadframeworks_base-97e44947282b3918ee0bed2d16b33b983f882580.zip
frameworks_base-97e44947282b3918ee0bed2d16b33b983f882580.tar.gz
frameworks_base-97e44947282b3918ee0bed2d16b33b983f882580.tar.bz2
Add an AlarmManager API to set the system time (with the proper permissions).
Diffstat (limited to 'core/java/android/app/AlarmManager.java')
-rw-r--r--core/java/android/app/AlarmManager.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/core/java/android/app/AlarmManager.java b/core/java/android/app/AlarmManager.java
index 53c7935..9082003 100644
--- a/core/java/android/app/AlarmManager.java
+++ b/core/java/android/app/AlarmManager.java
@@ -277,7 +277,26 @@ public class AlarmManager
} catch (RemoteException ex) {
}
}
-
+
+ /**
+ * Set the system wall clock time.
+ * Requires the permission android.permission.SET_TIME.
+ *
+ * @param millis time in milliseconds since the Epoch
+ */
+ public void setTime(long millis) {
+ try {
+ mService.setTime(millis);
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Set the system default time zone.
+ * Requires the permission android.permission.SET_TIME_ZONE.
+ *
+ * @param timeZone in the format understood by {@link java.util.TimeZone}
+ */
public void setTimeZone(String timeZone) {
try {
mService.setTimeZone(timeZone);