Fix parceling and unparceling for URIs in Telecom.

When testing parceling and unparceling of numbers with postdial digits
it appears in parcelling to the dialer there were some cases where
the commas were being URL encoded during parceling.

Elsewhere in the platform the Uri.writeToParcel and
Uri.CREATOR.createFromParcel methods are used.  Switching to those methods
ensured that the parceling did not uri-encode on parcel/unparcel.
GatewayInfo already used the right method to unparcel.

Test: Unit/CTS tests.
Fixes: 152172598
Change-Id: I32b7d049107cb3901fd934dc609541d1d2622a5a
This commit is contained in:
Tyler Gunn
2020-04-13 17:19:24 -07:00
parent bcc707d44c
commit 7c61306fa5
2 changed files with 4 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ public class GatewayInfo implements Parcelable {
@Override
public void writeToParcel(Parcel destination, int flags) {
destination.writeString(mGatewayProviderPackageName);
mGatewayAddress.writeToParcel(destination, 0);
mOriginalAddress.writeToParcel(destination, 0);
Uri.writeToParcel(destination, mGatewayAddress);
Uri.writeToParcel(destination, mOriginalAddress);
}
}

View File

@@ -629,7 +629,7 @@ public final class ParcelableCall implements Parcelable {
int capabilities = source.readInt();
int properties = source.readInt();
long connectTimeMillis = source.readLong();
Uri handle = source.readParcelable(classLoader);
Uri handle = Uri.CREATOR.createFromParcel(source);
int handlePresentation = source.readInt();
String callerDisplayName = source.readString();
int callerDisplayNamePresentation = source.readInt();
@@ -711,7 +711,7 @@ public final class ParcelableCall implements Parcelable {
destination.writeInt(mCapabilities);
destination.writeInt(mProperties);
destination.writeLong(mConnectTimeMillis);
destination.writeParcelable(mHandle, 0);
Uri.writeToParcel(destination, mHandle);
destination.writeInt(mHandlePresentation);
destination.writeString(mCallerDisplayName);
destination.writeInt(mCallerDisplayNamePresentation);