diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2017-06-01 16:52:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-06-01 16:52:34 +0000 |
commit | 142a392b75e7bf8e4e880b5cc49d111fd8d82533 (patch) | |
tree | 6ce3ba9636bc06f5effbeda152af543cd9109ced | |
parent | 5dbdffbf815f6db58e96f360e4f1f5e95c71762f (diff) | |
parent | 4b88cf450200698d1af92c91a05149c394a7fa1b (diff) | |
download | base-142a392b75e7bf8e4e880b5cc49d111fd8d82533.tar.gz |
Merge "Move appName inside Downloadrequest."android-o-preview-3
4 files changed, 38 insertions, 18 deletions
diff --git a/telephony/java/android/telephony/MbmsDownloadManager.java b/telephony/java/android/telephony/MbmsDownloadManager.java index d9f8fa6b994c..a9ec299c4cd8 100644 --- a/telephony/java/android/telephony/MbmsDownloadManager.java +++ b/telephony/java/android/telephony/MbmsDownloadManager.java @@ -17,9 +17,10 @@ package android.telephony; import android.content.Context; +import android.content.Intent; import android.net.Uri; import android.os.RemoteException; -import android.telephony.mbms.DownloadCallback; +import android.telephony.mbms.IDownloadCallback; import android.telephony.mbms.DownloadRequest; import android.telephony.mbms.DownloadStatus; import android.telephony.mbms.IMbmsDownloadManagerCallback; @@ -242,8 +243,9 @@ public class MbmsDownloadManager { * * Asynchronous errors through the listener include any of the errors */ - public DownloadRequest download(DownloadRequest downloadRequest, DownloadCallback listener) { - return null; + public DownloadRequest download(DownloadRequest request, IDownloadCallback listener) { + request.setAppName(mDownloadAppName); + return request; } /** diff --git a/telephony/java/android/telephony/mbms/DownloadRequest.java b/telephony/java/android/telephony/mbms/DownloadRequest.java index dbaf10bb68eb..f3ca05840da2 100644 --- a/telephony/java/android/telephony/mbms/DownloadRequest.java +++ b/telephony/java/android/telephony/mbms/DownloadRequest.java @@ -21,6 +21,7 @@ import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; +import java.lang.IllegalStateException; import java.net.URISyntaxException; /** @@ -36,6 +37,7 @@ public class DownloadRequest implements Parcelable { private Uri dest; private int sub; private String appIntent; + private String appName; // not the Android app Name, the embms app Name public Builder setId(int id) { this.id = id; @@ -68,7 +70,7 @@ public class DownloadRequest implements Parcelable { } public DownloadRequest build() { - return new DownloadRequest(id, serviceInfo, source, dest, sub, appIntent); + return new DownloadRequest(id, serviceInfo, source, dest, sub, appIntent, appName); } } @@ -78,16 +80,18 @@ public class DownloadRequest implements Parcelable { private final Uri destinationUri; private final int subId; private final String serializedResultIntentForApp; + private String appName; // not the Android app Name, the embms app name private DownloadRequest(int id, FileServiceInfo serviceInfo, Uri source, Uri dest, - int sub, String appIntent) { + int sub, String appIntent, String name) { downloadId = id; fileServiceInfo = serviceInfo; sourceUri = source; destinationUri = dest; subId = sub; serializedResultIntentForApp = appIntent; + appName = name; } public static DownloadRequest copy(DownloadRequest other) { @@ -101,6 +105,7 @@ public class DownloadRequest implements Parcelable { destinationUri = dr.destinationUri; subId = dr.subId; serializedResultIntentForApp = dr.serializedResultIntentForApp; + appName = dr.appName; } private DownloadRequest(Parcel in) { @@ -110,6 +115,7 @@ public class DownloadRequest implements Parcelable { destinationUri = in.readParcelable(getClass().getClassLoader()); subId = in.readInt(); serializedResultIntentForApp = in.readString(); + appName = in.readString(); } public int describeContents() { @@ -123,6 +129,7 @@ public class DownloadRequest implements Parcelable { out.writeParcelable(destinationUri, flags); out.writeInt(subId); out.writeString(serializedResultIntentForApp); + out.writeString(appName); } public int getDownloadId() { @@ -153,6 +160,18 @@ public class DownloadRequest implements Parcelable { } } + /** @hide */ + public synchronized void setAppName(String newAppName) { + if (appName != null) { + throw new IllegalStateException("Attempting to reset appName"); + } + appName = newAppName; + } + + public String getAppName() { + return appName; + } + public static final Parcelable.Creator<DownloadRequest> CREATOR = new Parcelable.Creator<DownloadRequest>() { public DownloadRequest createFromParcel(Parcel in) { @@ -162,5 +181,4 @@ public class DownloadRequest implements Parcelable { return new DownloadRequest[size]; } }; - } diff --git a/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl b/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl index 3090e1275f54..6c2b8167d519 100755 --- a/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl +++ b/telephony/java/android/telephony/mbms/vendor/IMbmsDownloadService.aidl @@ -50,20 +50,20 @@ interface IMbmsDownloadService /** * should move the params into a DownloadRequest parcelable */ - int download(String appName, in DownloadRequest downloadRequest, IDownloadCallback listener); + int download(in DownloadRequest downloadRequest, IDownloadCallback listener); - List<DownloadRequest> listPendingDownloads(String appName); + List<DownloadRequest> listPendingDownloads(String appName, int subscriptionId); - int cancelDownload(String appName, in DownloadRequest downloadRequest); + int cancelDownload(in DownloadRequest downloadRequest); - DownloadStatus getDownloadStatus(String appName, in DownloadRequest downloadRequest); + DownloadStatus getDownloadStatus(in DownloadRequest downloadRequest); /* * named this for 2 reasons: * 1 don't want 'State' here as it conflicts with 'Status' of the previous function * 2 want to perfect typing 'Knowledge' */ - void resetDownloadKnowledge(String appName, in DownloadRequest downloadRequest); + void resetDownloadKnowledge(in DownloadRequest downloadRequest); /** * End of life for this MbmsDownloadManager. diff --git a/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java b/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java index 369aef1c2c68..505aeae15355 100644 --- a/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java +++ b/telephony/java/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java @@ -43,34 +43,34 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub { } @Override - public int download(String appName, DownloadRequest downloadRequest, IDownloadCallback listener) + public int download(DownloadRequest downloadRequest, IDownloadCallback listener) throws RemoteException { return 0; } @Override - public List<DownloadRequest> listPendingDownloads(String appName) throws RemoteException { + public List<DownloadRequest> listPendingDownloads(String appName, int subscriptionId) + throws RemoteException { return null; } @Override - public int cancelDownload(String appName, DownloadRequest downloadRequest) - throws RemoteException { + public int cancelDownload(DownloadRequest downloadRequest) throws RemoteException { return 0; } @Override - public DownloadStatus getDownloadStatus(String appName, DownloadRequest downloadRequest) + public DownloadStatus getDownloadStatus(DownloadRequest downloadRequest) throws RemoteException { return null; } @Override - public void resetDownloadKnowledge(String appName, DownloadRequest downloadRequest) + public void resetDownloadKnowledge(DownloadRequest downloadRequest) throws RemoteException { } @Override - public void dispose(String appName, int subId) throws RemoteException { + public void dispose(String appName, int subscriptionId) throws RemoteException { } } |