Alarm Portal #1377
Mikenux
started this conversation in
New Portals
Alarm Portal
#1377
Replies: 1 comment 1 reply
-
Updates to the proposal |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Notes
Target Apps
The targets are apps that use alarm clocks (i.e. alarms that ring at specific times).
Currently, only classic alarm clocks (i.e. alarms that ring at a specific time and can be snoozed) are targeted here. Other types of alarms may be added in the future, with discussion.
Goals
Requirements
Classic Alarm
Add Classic Alarm
"AddClassicAlarm" is a method to register a classic alarm clock.
This method can be used only if the app is focused.
An app adds an alarm using the following properties:
When an alarm is added, the portal returns the following response to the app:
Only one alarm can be added at a time. An app can only add another alarm after receiving the "alarm_id" of a previously added alarm.
"app" option of the "ringtone" property
An app can only use this option if its sound can be reliably muted by the system and the app does not have any permissions to override this muting.
Alarm Ringing and App Autostart
"Ringing" Notification
This notification is presented to the user with the following properties:
It is presented at the time the alarm rings and when the alarm snooze duration has elapsed ("snooze_duration" property). If the alarm rings again, the current ringing time (taken from the system clock) is also displayed.
The system plays the ringtone or the app plays its sound. For apps that play sound themselves, if the system does not detect any sound output from the app or if the app uses the "internet" option of the "app" option, it plays a default ringtone.
The notification has the actions "Snooze", "Stop" and "Show App" (see the "Actions" section below) as buttons and is displayed until an action is activated. The snooze duration is shown on the "Snooze" button.
"Snooze" Notification
This notification is presented briefly with the following properties:
If wanted, the time when the alarm will ring again ("original alarm ringing time" plus "snooze duration") without user action can also be displayed.
No sound is played when this notification is presented. The "Snooze" notification is accessible from the notification tray.
The notification has the actions "Snooze More", "Stop" and "Show App" (see the "Actions" section below) as buttons and is displayed until an action is activated. The snooze duration is shown on the "Snooze More" button.
When the snooze duration has elapsed, the alarm rings again with a "Ringing" notification, unless the "ringing_number" property is set to "1".
Actions
Actions are managed by the portal. An app cannot decide whether to display them or not.
Snooze / Snooze More
When the "Snooze" or "Snooze More" action is activated, it does the following:
Stop
When the "Stop" action is activated, a "stop" signal is sent (see "Signals" section below), the alarm notification is removed and the alarm cannot ring again.
Show App
When the "Show App" action is activated, the action defined in the "show-app-action" property of the alarm is used. If nothing is defined, the app is simply launched and presented to the user. From the app, it is expected that the user can trigger snooze and stop actions. When one of these actions is triggered from the app, it uses the "SetAlarmState" method to set the "snoozed" or "stopped" state for the currently active alarm (see the "Set Alarm State" section below).
Additionally, the application cannot modify:
Signals
There are two signals: "snoozed" and "stopped". The relevant signal is sent to the app if it is running. If the app is not running, the signal is stored and will be sent when the app is launched. This lets the app know that an alarm has actually rang or been snoozed to update its user interface accordingly.
Set Alarm State
The "SetAlarmState" is a method for setting the alarm states of an already added alarm.
This method can only be used if the app is focused.
The following properties are used:
States Specific to Classic Alarms
For classic alarms, there is the "classic_state" with which two states can be set:
Play System Ringtone
"PlaySystemRingtone" is a method to play the default ringtone used by the system.
This method can only be used if the app is focused.
It provides the following options:
Alarm Manager
An alarm manager is used to manage alarms. There are two types of management which are described in the subsections below.
"Too Many!" Management
The "Too Many!" management detects when too many alarms are added and/or activated. When this is the case, the portal notifies the user.
The portal notifies the user when the following global conditions (i.e. not per application) are met directly or after closing an app:
The first three conditions are checked from midnight to midnight every 60 minutes. The last one is global.
The portal notifies with a window presenting all the added and/or activated alarms (regardless of the app). Alarms are displayed with their name, ringing time, ringtone, on/off state and the app they belong to, with their description possibly behind a button. They are sorted by ringing time. When this window is displayed, the app is not allowed to add or activate an alarm, and no "alarm_id" is returned to the application.
When reviewing alarms, the user has two options:
Note that it is possible to separate the review of added alarms without displaying their on/off state from activated alarms. In this case, this is done in two steps. When added alarms are deleted, they do not appear when displaying activated alarms.
Activation Conflict Management
Activation conflict management consists of detecting activated alarms (i.e. "on" state) whose ringing times conflict and allowing the user to resolve them.
When the ringing times of the alarms conflict, a window is displayed to present them to the user with their names (and their description possibly behind a button), their ringtone and the app to which they belong. Alarms are sorted by ringing time.
There are two possible actions:
When the user has validated the merges and/or deletions, the portal emits a "done" signal to the app if its alarm has not been deleted. If the app alarm has been deleted, the portal permanently blocks any addition and activation of alarms from this app and does not emit a "done" signal. In case an alarm using app-side sound playback is merged, the app will still start automatically, but with its sound muted until its alarm is stopped.
Conflicting Alarms Due to Snoozing
When alarms ring at the same time due to snoozing, no window to manage the conflict is displayed. Instead, the sound level of alarms is manipulated. If an alarm rings for the first time due to its ringing time, reduce the sound level of alarms that ring again after snoozing. If all alarms have been snoozed and ring again at the same time, lower the sound level of all except the alarm with the latest ringing time. To lower the sound level of alarms played on the app side, the relevant apps need an audio portal or other mechanism; Otherwise, use the sound played by an app as the highest sound level.
Lowering sound volumes for conflicting alarms due to snoozing can be included in the portal for a cross-desktop user experience. However, this is not required and can be done by desktop environments based on their preferences.
Too Many and Conflicting Alarms
If there are too many alarms and conflicting activated alarms at the same time, first display the "too many alarms" window, then the "conflicting alarms" window.
Classic Alarm: "Notification" Drawn Over App
When an alarm rings or snoozes, the relevant notification can be displayed over the app when it is running, focused, or opened from the "Show App" action. The "Sow App" action can instead be an action to display an enlarged notification. This allows all actions to be reliable. However, offering customization options is necessary and to be defined.
This removes from the proposal:
Questions
Beta Was this translation helpful? Give feedback.
All reactions