Don't let NotificationMediaManager cause NPEs

If setUpWithPresenter() hasn't been called on NotificationMediaManager,
it can NPE when serving up APIs.

Long term, we probably need a way to make sure classes which need to bet
set up don't do anything before they get that chance.

Test: open camera, kill sysui, make sure it boots
Change-Id: Idc41bf9aeecda2bcc55c03b4c027c15fbc880a4f
Fixes: 119322135
This commit is contained in:
Evan Laird
2018-11-12 15:26:34 -05:00
parent b2eb6bd683
commit f0348b13b8

View File

@@ -280,7 +280,10 @@ public class NotificationMediaManager implements Dumpable {
if (metaDataChanged) {
getEntryManager().updateNotifications();
}
mPresenter.updateMediaMetaData(metaDataChanged, true);
if (mPresenter != null) {
mPresenter.updateMediaMetaData(metaDataChanged, true);
}
}
public void clearCurrentMediaNotification() {