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

Commit 97a6505b authored by Yisroel Forta's avatar Yisroel Forta Committed by Android (Google) Code Review
Browse files

Merge "Update startinfo equals for intent" into main

parents 229e8bc0 1ac286d1
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -1082,6 +1082,15 @@ public final class ApplicationStartInfo implements Parcelable {

        final ApplicationStartInfo o = (ApplicationStartInfo) other;

        boolean intentEquals = true;
        if (android.content.flags.Flags.intentSaveToXmlPackage()) {
            if (mStartIntent == null) {
                intentEquals = o.mStartIntent == null;
            } else {
                intentEquals = mStartIntent.filterEquals(o.mStartIntent);
            }
        }

        return mPid == o.mPid
                && mRealUid == o.mRealUid
                && mPackageUid == o.mPackageUid
@@ -1095,14 +1104,16 @@ public final class ApplicationStartInfo implements Parcelable {
                && timestampsEquals(o)
                && mWasForceStopped == o.mWasForceStopped
                && mMonotonicCreationTimeMs == o.mMonotonicCreationTimeMs
                && mStartComponent == o.mStartComponent;
                && mStartComponent == o.mStartComponent
                && intentEquals;
    }

    @Override
    public int hashCode() {
        return Objects.hash(mPid, mRealUid, mPackageUid, mDefiningUid, mReason, mStartupState,
                mStartType, mLaunchMode, mPackageName, mProcessName, mStartupTimestampsNs,
                mMonotonicCreationTimeMs, mStartComponent);
                mMonotonicCreationTimeMs, mStartComponent,
                android.content.flags.Flags.intentSaveToXmlPackage() ? mStartIntent : null);
    }

    private boolean timestampsEquals(@NonNull ApplicationStartInfo other) {
+2 −1
Original line number Diff line number Diff line
@@ -79,7 +79,8 @@ import java.util.ArrayList;
public class ApplicationStartInfoTest {

    private static final String TAG = ApplicationStartInfoTest.class.getSimpleName();
    private static final ComponentName COMPONENT = new ComponentName("com.android.test", ".Foo");
    private static final ComponentName COMPONENT =
            new ComponentName("com.android.test", "com.android.test.Foo");

    private static final int APP_1_UID = 10123;
    private static final int APP_1_PID_1 = 12345;