зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1305430 - part2 : replace action checking with isMediaPlaying(). r=sebastian
MozReview-Commit-ID: F2WyASzWAMJ --HG-- extra : rebase_source : 07a9a41ab745907306baf420a747423d995ab9d4
This commit is contained in:
Родитель
4677833a54
Коммит
5619d26af8
|
@ -334,7 +334,7 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
|
|||
final Notification.MediaStyle style = new Notification.MediaStyle();
|
||||
style.setShowActionsInCompactView(0);
|
||||
|
||||
final boolean isMediaPlaying = action.equals(ACTION_PAUSE);
|
||||
final boolean isPlaying = isMediaPlaying();
|
||||
final int visibility = tab.isPrivate() ?
|
||||
Notification.VISIBILITY_PRIVATE : Notification.VISIBILITY_PUBLIC;
|
||||
|
||||
|
@ -347,13 +347,13 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
|
|||
.setDeleteIntent(createDeleteIntent())
|
||||
.setStyle(style)
|
||||
.addAction(createNotificationAction(action))
|
||||
.setOngoing(isMediaPlaying)
|
||||
.setOngoing(isPlaying)
|
||||
.setShowWhen(false)
|
||||
.setWhen(0)
|
||||
.setVisibility(visibility)
|
||||
.build();
|
||||
|
||||
if (isMediaPlaying) {
|
||||
if (isPlaying) {
|
||||
startForeground(MEDIA_CONTROL_ID, notification);
|
||||
} else {
|
||||
stopForeground(false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче