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

Commit d20a111d authored by v-liupengfei6's avatar v-liupengfei6
Browse files

RecentTasks:fix NPE problem to avoid system_server process crash.

It is possible for a task.getBaseIntent() method call to return a null object, so it is necessary to determine whether it is null before calling it

Test: atest
Bug: 384431818
Change-Id: Id4d9ad2addba4f0a7f298b6d752b3c4ed14b422a
parent 2daef7f6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1488,8 +1488,8 @@ class RecentTasks {
            boolean skipExcludedCheck) {
        if (!skipExcludedCheck) {
            // Keep the most recent task of home display even if it is excluded from recents.
            final boolean isExcludeFromRecents =
                    (task.getBaseIntent().getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
            final boolean isExcludeFromRecents = task.getBaseIntent() != null
                    && (task.getBaseIntent().getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
                    == FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
            if (isExcludeFromRecents) {
                if (DEBUG_RECENTS_TRIM_TASKS) {