From a73c4b082c2ab38831fc57c6bfb425d32ffe2aa4 Mon Sep 17 00:00:00 2001 From: Patrick Scott Date: Wed, 22 Sep 2010 08:16:53 -0400 Subject: [PATCH] Add new Alarm provider class for setting an alarm. The new class provides static variables for creating an intent to broadcast to applications implementing the alarm clock. A new permission has been added and applications are recommended to require this permission if accepting the set alarm broadcast. Change-Id: I7b1014acdc54371cbda19bcf9b5c395b647aa413 --- api/current.xml | 72 ++++++++++++++++++++++ core/java/android/provider/AlarmClock.java | 71 +++++++++++++++++++++ core/res/AndroidManifest.xml | 8 +++ core/res/res/values/strings.xml | 9 +++ 4 files changed, 160 insertions(+) create mode 100644 core/java/android/provider/AlarmClock.java diff --git a/api/current.xml b/api/current.xml index 956f2b8f3c524..4a81b42960be7 100644 --- a/api/current.xml +++ b/api/current.xml @@ -947,6 +947,17 @@ visibility="public" > + + + + + + + + + + + + + + + * Input: Nothing. + *

+ * Output: Nothing. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_SET_ALARM = "android.intent.action.SET_ALARM"; + + /** + * Activity Extra: Provide a custom message for the alarm. + *

+ * This can be passed as an extra field in the Intent created with + * ACTION_SET_ALARM. + */ + public static final String EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE"; + + /** + * Activity Extra: The hour of the alarm being set. + *

+ * This value can be passed as an extra field to the Intent created with + * ACTION_SET_ALARM. If it is not provided, the behavior is undefined and + * is up to the application. The value is an integer and ranges from 0 to + * 23. + */ + public static final String EXTRA_HOUR = "android.intent.extra.alarm.HOUR"; + + /** + * Activity Extra: The minutes of the alarm being set. + *

+ * This value can be passed as an extra field to the Intent created with + * ACTION_SET_ALARM. If it is not provided, the behavior is undefined and + * is up to the application. The value is an integer and ranges from 0 to + * 59. + */ + public static final String EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES"; +} diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index ab0ff3f1032db..68a5a1405903a 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -242,6 +242,14 @@ android:description="@string/permdesc_writeHistoryBookmarks" android:protectionLevel="dangerous" /> + + + diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 808b371f93374..ebccfb65f14c5 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1617,6 +1617,15 @@ Browser\'s history or bookmarks stored on your phone. Malicious applications can use this to erase or modify your Browser\'s data. + + set alarm in alarm clock + + Allows the application to set an alarm in + an installed alarm clock application. Some alarm clock applications may + not implement this feature. + Modify Browser geolocation permissions