From f8d67892332a535338cfd415340a83b31b373ee5 Mon Sep 17 00:00:00 2001 From: Yo Chiang Date: Fri, 21 Feb 2020 11:53:15 +0800 Subject: Fix VerificationActivity Intent VerificationActivity crashes when the Intent sent to it doesn't have an extras Bundle. This is because VerificationActivity copies the incoming Intents extras Bundle with getExtras() / putExtras(Bundle), and putExtras(Bundle) doesn't expect a null Bundle. Bug: 145891687 Test: adb shell am start-activity \ -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \ -a android.os.image.action.START_INSTALL \ -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip Test: Dynamic system service mustn't crash Change-Id: I111641f366d50d739b922bcc3a52993c44212759 --- .../src/com/android/dynsystem/VerificationActivity.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/DynamicSystemInstallationService/src') diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java index e42ded74acd0..82ea7449bf6d 100644 --- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java +++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java @@ -84,7 +84,6 @@ public class VerificationActivity extends Activity { // retrieve data from calling intent Intent callingIntent = getIntent(); Uri url = callingIntent.getData(); - Bundle extras = callingIntent.getExtras(); if (url != null) { sVerifiedUrl = url.toString(); @@ -96,7 +95,7 @@ public class VerificationActivity extends Activity { intent.setData(url); } intent.setAction(DynamicSystemClient.ACTION_START_INSTALL); - intent.putExtras(extras); + intent.putExtras(callingIntent); Log.d(TAG, "Starting Installation Service"); startServiceAsUser(intent, UserHandle.SYSTEM); -- cgit v1.2.3