summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-09-24 11:36:51 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-24 11:36:51 -0700
commit888bcdbeca34819c07d7dc06dc03d91207aea0c0 (patch)
tree636f3993bd3c66d2d8608fe803cbf617ab517a0f /core
parentc55f6da7281d34a4b875975cdf68f5062dfe4b34 (diff)
parent3ae249dc6a23f40cfc189ce2e25f75de32e7889a (diff)
downloadframeworks_base-888bcdbeca34819c07d7dc06dc03d91207aea0c0.zip
frameworks_base-888bcdbeca34819c07d7dc06dc03d91207aea0c0.tar.gz
frameworks_base-888bcdbeca34819c07d7dc06dc03d91207aea0c0.tar.bz2
am 3ae249dc: Merge "Add new Alarm provider class for setting an alarm." into gingerbread
Merge commit '3ae249dc6a23f40cfc189ce2e25f75de32e7889a' into gingerbread-plus-aosp * commit '3ae249dc6a23f40cfc189ce2e25f75de32e7889a': Add new Alarm provider class for setting an alarm.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/provider/AlarmClock.java71
-rw-r--r--core/res/AndroidManifest.xml8
-rw-r--r--core/res/res/values/strings.xml9
3 files changed, 88 insertions, 0 deletions
diff --git a/core/java/android/provider/AlarmClock.java b/core/java/android/provider/AlarmClock.java
new file mode 100644
index 0000000..b93dfd8
--- /dev/null
+++ b/core/java/android/provider/AlarmClock.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.provider;
+
+import android.annotation.SdkConstant;
+import android.annotation.SdkConstant.SdkConstantType;
+
+/**
+ * The AlarmClock provider contains an Intent action and extras that can be used
+ * to start an Activity to set a new alarm in an alarm clock application.
+ *
+ * Applications that wish to receive the ACTION_SET_ALARM Intent should create
+ * an activity to handle the Intent that requires the permission
+ * com.android.alarm.permission.SET_ALARM. Applications that wish to create a
+ * new alarm should use
+ * {@link android.content.Context#startActivity Context.startActivity()} so that
+ * the user has the option of choosing which alarm clock application to use.
+ */
+public final class AlarmClock {
+ /**
+ * Activity Action: Set an alarm.
+ * <p>
+ * Input: Nothing.
+ * <p>
+ * 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.
+ * <p>
+ * 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.
+ * <p>
+ * 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.
+ * <p>
+ * 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 ab0ff3f..68a5a14 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -242,6 +242,14 @@
android:description="@string/permdesc_writeHistoryBookmarks"
android:protectionLevel="dangerous" />
+ <!-- Allows an application to broadcast an Intent to set an alarm for the
+ user. -->
+ <permission android:name="com.android.alarm.permission.SET_ALARM"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
+ android:label="@string/permlab_setAlarm"
+ android:description="@string/permdesc_setAlarm"
+ android:protectionLevel="normal" />
+
<!-- ======================================= -->
<!-- Permissions for accessing location info -->
<!-- ======================================= -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 808b371..ebccfb6 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1619,6 +1619,15 @@
<!-- Title of an application permission, listed so the user can choose whether
they want to allow the application to do this. -->
+ <string name="permlab_setAlarm">set alarm in alarm clock</string>
+ <!-- Description of an application permission, listed so the user can choose whether
+ they want to allow the application to do this. -->
+ <string name="permdesc_setAlarm">Allows the application to set an alarm in
+ an installed alarm clock application. Some alarm clock applications may
+ not implement this feature.</string>
+
+ <!-- Title of an application permission, listed so the user can choose whether
+ they want to allow the application to do this. -->
<string name="permlab_writeGeolocationPermissions">Modify Browser geolocation permissions</string>
<!-- Description of an application permission, listed so the user can choose whether
they want to allow the application to do this. -->