Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0348b13 authored by Evan Laird's avatar Evan Laird
Browse files

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
parent b2eb6bd6
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -280,8 +280,11 @@ public class NotificationMediaManager implements Dumpable {
        if (metaDataChanged) {
        if (metaDataChanged) {
            getEntryManager().updateNotifications();
            getEntryManager().updateNotifications();
        }
        }

        if (mPresenter != null) {
            mPresenter.updateMediaMetaData(metaDataChanged, true);
            mPresenter.updateMediaMetaData(metaDataChanged, true);
        }
        }
    }


    public void clearCurrentMediaNotification() {
    public void clearCurrentMediaNotification() {
        mMediaNotificationKey = null;
        mMediaNotificationKey = null;