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

Commit f20f3c08 authored by Gabriele M's avatar Gabriele M
Browse files

Don't crash when checking if components are protected

intent.getComponent() can be null, but isComponentProtected() expects
a valid object. Add a null pointer check and don't treat the app as
protected if null.

Fixes 15360dfe
("Always hide protected apps from the recent tasks list")

Change-Id: I2e0ccdfb9ded7aa32305bc2ac97e0950940d186b
parent 9c271908
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2191,7 +2191,8 @@ class ActivityStarter {

    private boolean shouldExcludeFromRecents(final Intent intent, final int userId)
            throws RemoteException {
        return AppGlobals.getPackageManager().isComponentProtected(
        return intent.getComponent() != null &&
                AppGlobals.getPackageManager().isComponentProtected(
                        null, -1, intent.getComponent(), userId);
    }
}