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

Commit afb993f6 authored by Andrei Stingaceanu's avatar Andrei Stingaceanu
Browse files

[Keyboard shortcuts] - fix NPE related to assist component

Not all devices have an assist component, reflect that in
the code.

Bug: 65749750
Test: manual
Change-Id: I2a014f45c9d15259c344cb34ef9ed3dd1f41a20e
parent 61330a33
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -433,6 +433,8 @@ public final class KeyboardShortcuts {
        // Assist.
        final AssistUtils assistUtils = new AssistUtils(mContext);
        final ComponentName assistComponent = assistUtils.getAssistComponentForUser(userId);
        // Not all devices have an assist component.
        if (assistComponent != null) {
            PackageInfo assistPackageInfo = null;
            try {
                assistPackageInfo = mPackageManager.getPackageInfo(
@@ -452,6 +454,7 @@ public final class KeyboardShortcuts {
                        KeyEvent.KEYCODE_UNKNOWN,
                        KeyEvent.META_META_ON));
            }
        }

        // Browser.
        final Icon browserIcon = getIconForIntentCategory(Intent.CATEGORY_APP_BROWSER, userId);