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

Commit fb310f6a authored by Adam Powell's avatar Adam Powell Committed by android-build-merger
Browse files

Merge \"Make Activity.getReferrer tolerate custom Parcelables in intents\" into nyc-dev

am: 7a37f894

Change-Id: I7f1b3f03d9e18fbfa732f2a96242f5f5966828ea
parents 5fe5dcdf 7a37f894
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import android.hardware.input.InputManager;
import android.media.AudioManager;
import android.media.session.MediaController;
import android.net.Uri;
import android.os.BadParcelableException;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
@@ -5006,6 +5007,7 @@ public class Activity extends ContextThemeWrapper
    @Nullable
    public Uri getReferrer() {
        Intent intent = getIntent();
        try {
            Uri referrer = intent.getParcelableExtra(Intent.EXTRA_REFERRER);
            if (referrer != null) {
                return referrer;
@@ -5014,6 +5016,10 @@ public class Activity extends ContextThemeWrapper
            if (referrerName != null) {
                return Uri.parse(referrerName);
            }
        } catch (BadParcelableException e) {
            Log.w(TAG, "Cannot read referrer from intent;"
                    + " intent extras contain unknown custom Parcelable objects");
        }
        if (mReferrer != null) {
            return new Uri.Builder().scheme("android-app").authority(mReferrer).build();
        }