From a0945109824e6749462520526b279db4f2f92fb6 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Tue, 10 Oct 2017 19:08:24 -0700 Subject: Fix URI unparceling and clarify an error condition Use the proper unparceling method for lists, add a more verbose exception for when the app fails to declare a critical piece of metadata. Change-Id: I29d5291d7b88476496334d268be94f7f8c08255c Fixes: 67640653 Test: manual, with testapp --- .../java/android/telephony/mbms/MbmsDownloadReceiver.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java b/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java index fe2753722aae..9af1eb9e14d7 100644 --- a/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java +++ b/telephony/java/android/telephony/mbms/MbmsDownloadReceiver.java @@ -287,7 +287,7 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { return; } - List tempFiles = intent.getParcelableExtra(VendorUtils.EXTRA_TEMP_LIST); + List tempFiles = intent.getParcelableArrayListExtra(VendorUtils.EXTRA_TEMP_LIST); if (tempFiles == null) { return; } @@ -309,7 +309,7 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { return; } int fdCount = intent.getIntExtra(VendorUtils.EXTRA_FD_COUNT, 0); - List pausedList = intent.getParcelableExtra(VendorUtils.EXTRA_PAUSED_LIST); + List pausedList = intent.getParcelableArrayListExtra(VendorUtils.EXTRA_PAUSED_LIST); if (fdCount == 0 && (pausedList == null || pausedList.size() == 0)) { Log.i(LOG_TAG, "No temp files actually requested. Ending."); @@ -492,9 +492,14 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { } catch (PackageManager.NameNotFoundException e) { throw new RuntimeException("Package manager couldn't find " + context.getPackageName()); } + if (appInfo.metaData == null) { + throw new RuntimeException("App must declare the file provider authority as metadata " + + "in the manifest."); + } String authority = appInfo.metaData.getString(MBMS_FILE_PROVIDER_META_DATA_KEY); if (authority == null) { - throw new RuntimeException("Must declare the file provider authority as meta data"); + throw new RuntimeException("App must declare the file provider authority as metadata " + + "in the manifest."); } return authority; } -- cgit v1.2.3-59-g8ed1b