Loading telephony/java/android/telephony/mbms/DownloadRequest.java +18 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.telephony.mbms; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.Intent; import android.net.Uri; Loading @@ -26,7 +27,6 @@ import android.util.Log; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; Loading Loading @@ -72,6 +72,19 @@ public final class DownloadRequest implements Parcelable { private String appIntent; private int version = CURRENT_VERSION; /** * Builds a new DownloadRequest. * @param sourceUri the source URI for the DownloadRequest to be built. This URI should * never be null. */ public Builder(@NonNull Uri sourceUri) { if (sourceUri == null) { throw new IllegalArgumentException("Source URI must be non-null."); } source = sourceUri; } /** * Sets the service from which the download request to be built will download from. * @param serviceInfo Loading @@ -92,15 +105,6 @@ public final class DownloadRequest implements Parcelable { return this; } /** * Sets the source URI for the download request to be built. * @param source */ public Builder setSource(Uri source) { this.source = source; return this; } /** * Set the subscription ID on which the file(s) should be downloaded. * @param subscriptionId Loading Loading @@ -317,10 +321,12 @@ public final class DownloadRequest implements Parcelable { throw new RuntimeException("Could not get sha256 hash object"); } if (version >= 1) { // Hash the source URI, destination URI, and the app intent // Hash the source URI and the app intent digest.update(sourceUri.toString().getBytes(StandardCharsets.UTF_8)); if (serializedResultIntentForApp != null) { digest.update(serializedResultIntentForApp.getBytes(StandardCharsets.UTF_8)); } } // Add updates for future versions here return Base64.encodeToString(digest.digest(), Base64.URL_SAFE | Base64.NO_WRAP); } Loading Loading
telephony/java/android/telephony/mbms/DownloadRequest.java +18 −12 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.telephony.mbms; import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.Intent; import android.net.Uri; Loading @@ -26,7 +27,6 @@ import android.util.Log; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; Loading Loading @@ -72,6 +72,19 @@ public final class DownloadRequest implements Parcelable { private String appIntent; private int version = CURRENT_VERSION; /** * Builds a new DownloadRequest. * @param sourceUri the source URI for the DownloadRequest to be built. This URI should * never be null. */ public Builder(@NonNull Uri sourceUri) { if (sourceUri == null) { throw new IllegalArgumentException("Source URI must be non-null."); } source = sourceUri; } /** * Sets the service from which the download request to be built will download from. * @param serviceInfo Loading @@ -92,15 +105,6 @@ public final class DownloadRequest implements Parcelable { return this; } /** * Sets the source URI for the download request to be built. * @param source */ public Builder setSource(Uri source) { this.source = source; return this; } /** * Set the subscription ID on which the file(s) should be downloaded. * @param subscriptionId Loading Loading @@ -317,10 +321,12 @@ public final class DownloadRequest implements Parcelable { throw new RuntimeException("Could not get sha256 hash object"); } if (version >= 1) { // Hash the source URI, destination URI, and the app intent // Hash the source URI and the app intent digest.update(sourceUri.toString().getBytes(StandardCharsets.UTF_8)); if (serializedResultIntentForApp != null) { digest.update(serializedResultIntentForApp.getBytes(StandardCharsets.UTF_8)); } } // Add updates for future versions here return Base64.encodeToString(digest.digest(), Base64.URL_SAFE | Base64.NO_WRAP); } Loading