public class

CyanogenModAlarmClock

extends Object
java.lang.Object
   ↳ cyanogenmod.alarmclock.CyanogenModAlarmClock

Class Overview

The CyanogenModAlarmClock class contains utilities for interacting with a variety of Alarm features that the CyanogenMod AlarmClock application (based on AOSP DeskClock) supports.

Summary

Constants
String ACTION_SET_ALARM_ENABLED Service Action: Set an existing alarm to be either enabled or disabled.
String EXTRA_ALARM_ID Bundle extra: The id of the alarm.
String EXTRA_ENABLED Bundle extra: Whether to set the alarm to enabled to disabled.
String MODIFY_ALARMS_PERMISSION Allows an application to make modifications to existing alarms, such as turning them on or off.
String READ_ALARMS_PERMISSION Allows an application to have read access to all alarms in the CyanogenMod DeskClock application.
Public Constructors
CyanogenModAlarmClock()
Public Methods
static Intent createAlarmIntent(Context context)

Retrieves an Intent that is prepopulated with the proper action and ComponentName to create a new alarm in the CyanogenMod DeskClock application.

[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_SET_ALARM_ENABLED

Added in API level 2

Service Action: Set an existing alarm to be either enabled or disabled.

This action sets an alarm to be enabled or disabled.

This action requests an alarm with the id specified by EXTRA_ALARM_ID be set to enabled or disabled, depending on the value set with EXTRA_ENABLED.

Requires permission MODIFY_ALARMS_PERMISSION to launch this intent.

Always set the package name of the Intent that will launch this action to ERROR(/#DESKCLOCK_PACKAGE) explicitly, for security.

Request parameters

  • EXTRA_ALARM_ID (required): The id of the alarm to modify, as stored in _ID
  • EXTRA_ENABLED (required): Whether to set this alarm to be enabled or disabled.

Constant Value: "cyanogenmod.alarmclock.SET_ALARM_ENABLED"

public static final String EXTRA_ALARM_ID

Added in API level 2

Bundle extra: The id of the alarm.

Used by ACTION_SET_ALARM_ENABLED.

This extra is required.

The value is an Long and is the ID stored in _ID for this alarm.

Constant Value: "cyanogenmod.intent.extra.alarmclock.ID"

public static final String EXTRA_ENABLED

Added in API level 2

Bundle extra: Whether to set the alarm to enabled to disabled.

Used by ACTION_SET_ALARM_ENABLED.

This extra is required.

The value is an Boolean and if true, will set the alarm specified by EXTRA_ALARM_ID to be enabled. Otherwise, the alarm will be disabled.

Constant Value: "cyanogenmod.intent.extra.alarmclock.ENABLED"

public static final String MODIFY_ALARMS_PERMISSION

Added in API level 2

Allows an application to make modifications to existing alarms, such as turning them on or off.

Constant Value: "cyanogenmod.alarmclock.permission.MODIFY_ALARMS"

public static final String READ_ALARMS_PERMISSION

Added in API level 2

Allows an application to have read access to all alarms in the CyanogenMod DeskClock application.

See Also
Constant Value: "cyanogenmod.alarmclock.permission.READ_ALARMS"

Public Constructors

public CyanogenModAlarmClock ()

Added in API level 2

Public Methods

public static Intent createAlarmIntent (Context context)

Added in API level 2

Retrieves an Intent that is prepopulated with the proper action and ComponentName to create a new alarm in the CyanogenMod DeskClock application.

The action will be set to ACTION_SET_ALARM. Use the Intent extras contained at AlarmClock to configure the alarm.

Requires permission SET_ALARM to launch this intent.

Returns
  • The Intent to create a new alarm with the CyanogenMod DeskClock application.
See Also