From fce0c3486331fc85b7397a2f5c4128da31ead01a Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Fri, 29 Sep 2017 11:04:05 -0700 Subject: [PATCH] Remove verification for DownloadReceiver when failure When the ACTION_DOWNLOAD_RESULT_INTERNAL intent is received with a failure result, don't require that extras exist in the receiver. Test: Manual, Testapps Change-Id: I9ac43a33aff88755cbc804890ce230743195f44d --- .../java/android/telephony/mbms/MbmsDownloadReceiver.java | 6 ++++++ .../java/android/telephony/mbms/vendor/VendorUtils.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java b/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java index 61415b50b2d2a..fe2753722aaea 100644 --- a/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java +++ b/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java @@ -165,6 +165,12 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { Log.w(LOG_TAG, "Download result did not include a result code. Ignoring."); return false; } + // We do not need to verify below extras if the result is not success. + if (MbmsDownloadSession.RESULT_SUCCESSFUL != + intent.getIntExtra(MbmsDownloadSession.EXTRA_MBMS_DOWNLOAD_RESULT, + MbmsDownloadSession.RESULT_CANCELLED)) { + return true; + } if (!intent.hasExtra(MbmsDownloadSession.EXTRA_MBMS_DOWNLOAD_REQUEST)) { Log.w(LOG_TAG, "Download result did not include the associated request. Ignoring."); return false; diff --git a/telephony/java/android/telephony/mbms/vendor/VendorUtils.java b/telephony/java/android/telephony/mbms/vendor/VendorUtils.java index 8fb27b2953e63..a43f12244168e 100644 --- a/telephony/java/android/telephony/mbms/vendor/VendorUtils.java +++ b/telephony/java/android/telephony/mbms/vendor/VendorUtils.java @@ -38,8 +38,9 @@ public class VendorUtils { /** * The MBMS middleware should send this when a download of single file has completed or - * failed. Mandatory extras are + * failed. The only mandatory extra is * {@link MbmsDownloadSession#EXTRA_MBMS_DOWNLOAD_RESULT} + * and the following are required when the download has completed: * {@link MbmsDownloadSession#EXTRA_MBMS_FILE_INFO} * {@link MbmsDownloadSession#EXTRA_MBMS_DOWNLOAD_REQUEST} * {@link #EXTRA_TEMP_LIST}