blob: 3401cb1018f8c69cfe2dbfebae0e3761d59abdc2 [file] [log] [blame]
Patrick Scotta73c4b02010-09-22 08:16:53 -04001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.provider;
18
19import android.annotation.SdkConstant;
20import android.annotation.SdkConstant.SdkConstantType;
21
22/**
23 * The AlarmClock provider contains an Intent action and extras that can be used
24 * to start an Activity to set a new alarm in an alarm clock application.
25 *
26 * Applications that wish to receive the ACTION_SET_ALARM Intent should create
27 * an activity to handle the Intent that requires the permission
28 * com.android.alarm.permission.SET_ALARM. Applications that wish to create a
29 * new alarm should use
30 * {@link android.content.Context#startActivity Context.startActivity()} so that
31 * the user has the option of choosing which alarm clock application to use.
32 */
33public final class AlarmClock {
34 /**
35 * Activity Action: Set an alarm.
36 * <p>
37 * Input: Nothing.
38 * <p>
39 * Output: Nothing.
40 */
41 @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
42 public static final String ACTION_SET_ALARM = "android.intent.action.SET_ALARM";
43
44 /**
45 * Activity Extra: Provide a custom message for the alarm.
46 * <p>
47 * This can be passed as an extra field in the Intent created with
48 * ACTION_SET_ALARM.
49 */
50 public static final String EXTRA_MESSAGE = "android.intent.extra.alarm.MESSAGE";
51
52 /**
53 * Activity Extra: The hour of the alarm being set.
54 * <p>
55 * This value can be passed as an extra field to the Intent created with
56 * ACTION_SET_ALARM. If it is not provided, the behavior is undefined and
57 * is up to the application. The value is an integer and ranges from 0 to
58 * 23.
59 */
60 public static final String EXTRA_HOUR = "android.intent.extra.alarm.HOUR";
61
62 /**
63 * Activity Extra: The minutes of the alarm being set.
64 * <p>
65 * This value can be passed as an extra field to the Intent created with
66 * ACTION_SET_ALARM. If it is not provided, the behavior is undefined and
67 * is up to the application. The value is an integer and ranges from 0 to
68 * 59.
69 */
70 public static final String EXTRA_MINUTES = "android.intent.extra.alarm.MINUTES";
Patrick Scott80fdd652010-12-15 11:15:13 -050071
72 /**
73 * Activity Extra: Optionally skip the application UI.
74 * <p>
75 * This value can be passed as an extra field to the Intent created with
76 * ACTION_SET_ALARM. If true, the application is asked to bypass any
77 * intermediate UI and instead pop a toast indicating the result then
78 * finish the Activity. If false, the application may display intermediate
79 * UI like a confirmation dialog or alarm settings. The default is false.
80 */
81 public static final String EXTRA_SKIP_UI = "android.intent.extra.alarm.SKIP_UI";
Patrick Scotta73c4b02010-09-22 08:16:53 -040082}