Bug 1311245 - part3 : mActionState should only store resume/pause/stop. r=sebastian

There is no big difference between 'ACTION_RESUME' and 'ACTION_RESUME_BY_AUDIO_FOCUS', we can simplify it.

MozReview-Commit-ID: 4nqfgoopuJ6

--HG--
extra : rebase_source : adf46ef7f3ccd81ed68c02ba32187a8da8b8c7a0
This commit is contained in:
Alastor Wu 2016-10-27 10:12:30 +08:00
parent 8800fa805c
commit 95c44cf1ee

View File

@ -134,8 +134,7 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
}
private boolean isMediaPlaying() {
return mActionState.equals(ACTION_RESUME) ||
mActionState.equals(ACTION_RESUME_BY_AUDIO_FOCUS);
return mActionState.equals(ACTION_RESUME);
}
private void initialize() {
@ -251,11 +250,9 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
} else if (action.equals(ACTION_PAUSE_BY_AUDIO_FOCUS)) {
Log.d(LOGTAG, "Controller, pause by audio focus changed");
notifyControlInterfaceChanged(ACTION_RESUME);
mActionState = ACTION_PAUSE_BY_AUDIO_FOCUS;
} else if (action.equals(ACTION_RESUME_BY_AUDIO_FOCUS)) {
Log.d(LOGTAG, "Controller, resume by audio focus changed");
notifyControlInterfaceChanged(ACTION_PAUSE);
mActionState = ACTION_RESUME_BY_AUDIO_FOCUS;
}
}