Merge "Add new Alarm provider class for setting an alarm." into gingerbread

This commit is contained in:
Patrick Scott
2010-09-24 11:34:10 -07:00
committed by Android (Google) Code Review
4 changed files with 160 additions and 0 deletions

View File

@@ -947,6 +947,17 @@
visibility="public"
>
</field>
<field name="SET_ALARM"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;com.android.alarm.permission.SET_ALARM&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="SET_ALWAYS_FINISH"
type="java.lang.String"
transient="false"
@@ -131718,6 +131729,67 @@
</package>
<package name="android.provider"
>
<class name="AlarmClock"
extends="java.lang.Object"
abstract="false"
static="false"
final="true"
deprecated="not deprecated"
visibility="public"
>
<constructor name="AlarmClock"
type="android.provider.AlarmClock"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</constructor>
<field name="ACTION_SET_ALARM"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.intent.action.SET_ALARM&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="EXTRA_HOUR"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.intent.extra.alarm.HOUR&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="EXTRA_MESSAGE"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.intent.extra.alarm.MESSAGE&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="EXTRA_MINUTES"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.intent.extra.alarm.MINUTES&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
</class>
<interface name="BaseColumns"
abstract="true"
static="false"

View File

@@ -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";
}

View File

@@ -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 -->
<!-- ======================================= -->

View File

@@ -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.</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_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>