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

Commit 8a046ade authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Fix potential NPE when ActivityClientRecord is null" am: f47829a8 am:...

Merge "Fix potential NPE when ActivityClientRecord is null" am: f47829a8 am: a96babb6 am: 73a93851

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2336783



Change-Id: If60c3495b8f614cecc0dc471e5649e12e43a0d8a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents db0efd22 73a93851
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.app.ActivityThread.ActivityClientRecord;
import android.app.ClientTransactionHandler;
import android.app.ClientTransactionHandler;
import android.os.IBinder;
import android.os.IBinder;
import android.util.IntArray;
import android.util.IntArray;
import android.util.Log;


import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;


@@ -43,6 +44,7 @@ import java.util.List;
 * @hide
 * @hide
 */
 */
public class TransactionExecutorHelper {
public class TransactionExecutorHelper {
    private static final String TAG = TransactionExecutorHelper.class.getSimpleName();
    // A penalty applied to path with destruction when looking for the shortest one.
    // A penalty applied to path with destruction when looking for the shortest one.
    private static final int DESTRUCTION_PENALTY = 10;
    private static final int DESTRUCTION_PENALTY = 10;


@@ -162,6 +164,11 @@ public class TransactionExecutorHelper {
        if (finalStates == null || finalStates.length == 0) {
        if (finalStates == null || finalStates.length == 0) {
            return UNDEFINED;
            return UNDEFINED;
        }
        }
        if (r == null) {
            // Early return because the ActivityClientRecord hasn't been created or cannot be found.
            Log.w(TAG, "ActivityClientRecord was null");
            return UNDEFINED;
        }


        final int currentState = r.getLifecycleState();
        final int currentState = r.getLifecycleState();
        int closestState = UNDEFINED;
        int closestState = UNDEFINED;