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

Commit 5f56c1fd authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan
Browse files

SystemUI: don't crash when user disable default apps

If the user has disabled the default clock or calendar application,
System UI will crash when the user clicks the Clock or Calendar
from the notification bar. This patch fixes the issue.

Change-Id: Icdc3679cdd35b5b3a24086e1ada67d0defabc5cb
parent 59d50089
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -275,6 +275,11 @@ public class Clock extends TextView implements OnClickListener, OnLongClickListe
    }

    private void collapseStartActivity(Intent what) {
        // don't do anything if the activity can't be resolved (e.g. app disabled)
        if (getContext().getPackageManager().resolveActivity(what, 0) == null) {
            return;
        }

        // collapse status bar
        StatusBarManager statusBarManager = (StatusBarManager) getContext().getSystemService(
                Context.STATUS_BAR_SERVICE);
+5 −0
Original line number Diff line number Diff line
@@ -150,6 +150,11 @@ public class DateView extends TextView implements OnClickListener, OnLongClickLi
    }

    private void collapseStartActivity(Intent what) {
        // don't do anything if the activity can't be resolved (e.g. app disabled)
        if (getContext().getPackageManager().resolveActivity(what, 0) == null) {
            return;
        }

        // collapse status bar
        StatusBarManager statusBarManager = (StatusBarManager) getContext().getSystemService(
                Context.STATUS_BAR_SERVICE);