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

Commit 0d561708 authored by Winson Chiu's avatar Winson Chiu
Browse files

Encode Intent scheme when serializing to URI string RESTRICT AUTOMERGE

Avoids deserialization error when the scheme contains a
reserved character.

Bug: 261858325

Test: atest android.content.cts.IntentTest#testEncoding

Merged-In: Ic34b3f796b762763db5aa7b5d7c109ae70607470
Change-Id: Ic34b3f796b762763db5aa7b5d7c109ae70607470
parent c956023f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11488,7 +11488,7 @@ public class Intent implements Parcelable, Cloneable {
    private void toUriInner(StringBuilder uri, String scheme, String defAction,
            String defPackage, int flags) {
        if (scheme != null) {
            uri.append("scheme=").append(scheme).append(';');
            uri.append("scheme=").append(Uri.encode(scheme)).append(';');
        }
        if (mAction != null && !mAction.equals(defAction)) {
            uri.append("action=").append(Uri.encode(mAction)).append(';');