Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_DeskClock
Commits
b60cd1a6
Commit
b60cd1a6
authored
14 years ago
by
Daniel Sandler
Browse files
Options
Download
Email Patches
Plain Diff
Pop up alarms using Notification.fullScreenIntent.
Bug: 2785727 Change-Id: I2d37510572b0bc46c5c804b9c46ad00626523b05
parent
529ffc1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
src/com/android/deskclock/AlarmReceiver.java
src/com/android/deskclock/AlarmReceiver.java
+10
-9
No files found.
src/com/android/deskclock/AlarmReceiver.java
View file @
b60cd1a6
...
...
@@ -103,14 +103,6 @@ public class AlarmReceiver extends BroadcastReceiver {
c
=
AlarmAlertFullScreen
.
class
;
}
/* launch UI, explicitly stating that this is not due to user action
* so that the current app's notification management is not disturbed */
Intent
alarmAlert
=
new
Intent
(
context
,
c
);
alarmAlert
.
putExtra
(
Alarms
.
ALARM_INTENT_EXTRA
,
alarm
);
alarmAlert
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_NO_USER_ACTION
);
context
.
startActivity
(
alarmAlert
);
// Disable the snooze alert if this alarm is the snooze.
Alarms
.
disableSnoozeAlert
(
context
,
alarm
.
id
);
// Disable this alarm if it does not repeat.
...
...
@@ -144,9 +136,18 @@ public class AlarmReceiver extends BroadcastReceiver {
context
.
getString
(
R
.
string
.
alarm_notify_text
),
pendingNotify
);
n
.
flags
|=
Notification
.
FLAG_SHOW_LIGHTS
|
Notification
.
FLAG_ONGOING_EVENT
;
|
Notification
.
FLAG_ONGOING_EVENT
|
Notification
.
FLAG_HIGH_PRIORITY
;
n
.
defaults
|=
Notification
.
DEFAULT_LIGHTS
;
// NEW: Embed the full-screen UI here. The notification manager will
// take care of displaying it if it's OK to do so.
Intent
alarmAlert
=
new
Intent
(
context
,
c
);
alarmAlert
.
putExtra
(
Alarms
.
ALARM_INTENT_EXTRA
,
alarm
);
alarmAlert
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_NO_USER_ACTION
);
n
.
fullScreenIntent
=
PendingIntent
.
getActivity
(
context
,
alarm
.
id
,
alarmAlert
,
0
);
// Send the notification using the alarm id to easily identify the
// correct notification.
NotificationManager
nm
=
getNotificationManager
(
context
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment