summaryrefslogtreecommitdiff
path: root/packages/DynamicSystemInstallationService/src
diff options
context:
space:
mode:
authorYo Chiang <yochiang@google.com>2019-12-18 15:58:02 +0800
committerYo Chiang <yochiang@google.com>2019-12-27 12:43:14 +0800
commita69bb0712d05ad6359c05e6a63a489a250bb5831 (patch)
tree2dc51ff82a46401670ee202a2420de04f1400708 /packages/DynamicSystemInstallationService/src
parent47fbf0aaa07b6dd4902756a662b29df418c48173 (diff)
VerificationActivity clones calling Intent
When VerificationActivity receives an Intent, clone the calling Intent's extras Bundle and pass the whole Bundle into DynamicSystemInstallationService Intent. Don't unpack and repack the calling Intent's extras field. Since VerificationActivity aren't using the contents of the extras Bundle, it shouldn't know about the details of extra. Test: adb shell am start-activity \ -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \ -a android.os.image.action.START_INSTALL \ --el KEY_USERDATA_SIZE 8589934592 \ -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip Change-Id: Ie19b9d4d9ebcbd4623d8c76637da4fa732a4a3c3
Diffstat (limited to 'packages/DynamicSystemInstallationService/src')
-rw-r--r--packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
index 8a2948b04e3e..3b3933b7db10 100644
--- a/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
+++ b/packages/DynamicSystemInstallationService/src/com/android/dynsystem/VerificationActivity.java
@@ -16,9 +16,6 @@
package com.android.dynsystem;
-import static android.os.image.DynamicSystemClient.KEY_SYSTEM_SIZE;
-import static android.os.image.DynamicSystemClient.KEY_USERDATA_SIZE;
-
import android.app.Activity;
import android.app.KeyguardManager;
import android.content.Context;
@@ -88,12 +85,8 @@ public class VerificationActivity extends Activity {
private void startInstallationService() {
// retrieve data from calling intent
Intent callingIntent = getIntent();
-
Uri url = callingIntent.getData();
- long systemSize = callingIntent.getLongExtra(KEY_SYSTEM_SIZE, 0);
- long userdataSize = callingIntent.getLongExtra(KEY_USERDATA_SIZE, 0);
- boolean enableWhenCompleted = callingIntent.getBooleanExtra(
- DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, false);
+ Bundle extras = callingIntent.getExtras();
sVerifiedUrl = url.toString();
@@ -101,10 +94,7 @@ public class VerificationActivity extends Activity {
Intent intent = new Intent(this, DynamicSystemInstallationService.class);
intent.setData(url);
intent.setAction(DynamicSystemClient.ACTION_START_INSTALL);
- intent.putExtra(KEY_SYSTEM_SIZE, systemSize);
- intent.putExtra(KEY_USERDATA_SIZE, userdataSize);
- intent.putExtra(
- DynamicSystemInstallationService.KEY_ENABLE_WHEN_COMPLETED, enableWhenCompleted);
+ intent.putExtras(extras);
Log.d(TAG, "Starting Installation Service");
startServiceAsUser(intent, UserHandle.SYSTEM);