Bug 1305430 - part1 : send the notification again after tab got its favicon. r=sebastian

Sometimes the tab doesn't get its favicon yet when we send the notification.
Therefore, we would listen the FAVICON event and then re-send the notification again if we used the default cover icon in previous notification.

MozReview-Commit-ID: JSphLBEhGy2

--HG--
extra : rebase_source : 55f12e30583480a1d0d7f2743974a05180198ad5
This commit is contained in:
Alastor Wu 2016-10-06 14:01:43 +08:00
Родитель 4a7fd611df
Коммит 4677833a54
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -114,9 +114,21 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
mController.getTransportControls().stop();
}
break;
case FAVICON:
if (playingTab == tab) {
final String actionForPendingIntent = isMediaPlaying() ?
ACTION_PAUSE : ACTION_RESUME;
notifyControlInterfaceChanged(actionForPendingIntent);
}
break;
}
}
private boolean isMediaPlaying() {
return mActionState.equals(ACTION_RESUME) ||
mActionState.equals(ACTION_RESUME_BY_AUDIO_FOCUS);
}
private void initialize() {
if (mInitialize ||
!isAndroidVersionLollopopOrHigher()) {