Merge "Add getInterfaceVersion to NetdEventListener" into qt-dev
diff --git a/services/core/java/com/android/server/GestureLauncherService.java b/services/core/java/com/android/server/GestureLauncherService.java
index 8077e34..de96aaa 100644
--- a/services/core/java/com/android/server/GestureLauncherService.java
+++ b/services/core/java/com/android/server/GestureLauncherService.java
@@ -35,6 +35,7 @@
import android.os.PowerManager.WakeLock;
import android.os.SystemClock;
import android.os.SystemProperties;
+import android.os.Trace;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.MutableBoolean;
@@ -404,26 +405,35 @@
*/
@VisibleForTesting
boolean handleCameraGesture(boolean useWakelock, int source) {
- boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
- Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
- if (!userSetupComplete) {
- if (DBG) Slog.d(TAG, String.format(
- "userSetupComplete = %s, ignoring camera gesture.",
- userSetupComplete));
- return false;
- }
- if (DBG) Slog.d(TAG, String.format(
- "userSetupComplete = %s, performing camera gesture.",
- userSetupComplete));
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "GestureLauncher:handleCameraGesture");
+ try {
+ boolean userSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
+ if (!userSetupComplete) {
+ if (DBG) {
+ Slog.d(TAG, String.format(
+ "userSetupComplete = %s, ignoring camera gesture.",
+ userSetupComplete));
+ }
+ return false;
+ }
+ if (DBG) {
+ Slog.d(TAG, String.format(
+ "userSetupComplete = %s, performing camera gesture.",
+ userSetupComplete));
+ }
- if (useWakelock) {
- // Make sure we don't sleep too early
- mWakeLock.acquire(500L);
+ if (useWakelock) {
+ // Make sure we don't sleep too early
+ mWakeLock.acquire(500L);
+ }
+ StatusBarManagerInternal service = LocalServices.getService(
+ StatusBarManagerInternal.class);
+ service.onCameraLaunchGestureDetected(source);
+ return true;
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
- StatusBarManagerInternal service = LocalServices.getService(
- StatusBarManagerInternal.class);
- service.onCameraLaunchGestureDetected(source);
- return true;
}
private final BroadcastReceiver mUserReceiver = new BroadcastReceiver() {
diff --git a/services/core/java/com/android/server/am/ActivityManagerConstants.java b/services/core/java/com/android/server/am/ActivityManagerConstants.java
index 0da39e7..104cadc 100644
--- a/services/core/java/com/android/server/am/ActivityManagerConstants.java
+++ b/services/core/java/com/android/server/am/ActivityManagerConstants.java
@@ -120,7 +120,7 @@
/**
* Default value for mFlagBackgroundActivityStartsEnabled if not explicitly set in
* Settings.Global. This allows it to be set experimentally unless it has been
- * enabled/disabled in developer options. Defaults to true.
+ * enabled/disabled in developer options. Defaults to false.
*/
private static final String KEY_DEFAULT_BACKGROUND_ACTIVITY_STARTS_ENABLED =
"default_background_activity_starts_enabled";
@@ -497,7 +497,7 @@
boolean enabledInDeviceConfig = DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
KEY_DEFAULT_BACKGROUND_ACTIVITY_STARTS_ENABLED,
- /*defaultValue*/ true);
+ /*defaultValue*/ false);
mFlagBackgroundActivityStartsEnabled = enabledInDeviceConfig;
if (!enabledInDeviceConfig) {
whitelistedPackageNames = DeviceConfig.getProperty(
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java
index 2f1b22e..446b128 100644
--- a/services/core/java/com/android/server/am/ServiceRecord.java
+++ b/services/core/java/com/android/server/am/ServiceRecord.java
@@ -551,12 +551,10 @@
.removeAllowBackgroundActivityStartsToken(this);
ams.mHandler.removeCallbacks(mStartedWhitelistingBgActivityStartsCleanUp);
}
- mAppForStartedWhitelistingBgActivityStarts = null;
}
- if (mHasStartedWhitelistingBgActivityStarts) {
- // Make sure the cleanup callback knows about the new process.
- mAppForStartedWhitelistingBgActivityStarts = _proc;
- }
+ // Make sure the cleanup callback knows about the new process.
+ mAppForStartedWhitelistingBgActivityStarts = mHasStartedWhitelistingBgActivityStarts
+ ? _proc : null;
if (mHasStartedWhitelistingBgActivityStarts
|| mHasBindingWhitelistingBgActivityStarts) {
_proc.addAllowBackgroundActivityStartsToken(this);
@@ -656,6 +654,9 @@
*/
void whitelistBgActivityStartsOnServiceStart() {
setHasStartedWhitelistingBgActivityStarts(true);
+ if (app != null) {
+ mAppForStartedWhitelistingBgActivityStarts = app;
+ }
// This callback is stateless, so we create it once when we first need it.
if (mStartedWhitelistingBgActivityStartsCleanUp == null) {
diff --git a/services/core/java/com/android/server/rollback/TEST_MAPPING b/services/core/java/com/android/server/rollback/TEST_MAPPING
index 921b754..8c7b5ac 100644
--- a/services/core/java/com/android/server/rollback/TEST_MAPPING
+++ b/services/core/java/com/android/server/rollback/TEST_MAPPING
@@ -14,5 +14,13 @@
}
]
}
+ ],
+ "imports": [
+ {
+ "path": "cts/tests/rollback"
+ },
+ {
+ "path": "cts/hostsidetests/rollback"
+ }
]
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index c885c5e..1718ac6 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -161,7 +161,7 @@
private ActivityOptions mOptions;
// If it is true, background activity can only be started in an existing task that contains
- // an activity with same uid.
+ // an activity with same uid, or if activity starts are enabled in developer options.
private boolean mRestrictedBgActivity;
private int mLaunchMode;
@@ -921,7 +921,7 @@
|| stack.getResumedActivity().info.applicationInfo.uid != realCallingUid)) {
if (!mService.checkAppSwitchAllowedLocked(callingPid, callingUid,
realCallingPid, realCallingUid, "Activity start")) {
- if (!restrictedBgActivity) {
+ if (!(restrictedBgActivity && handleBackgroundActivityAbort(r))) {
mController.addPendingActivityLaunch(new PendingActivityLaunch(r,
sourceRecord, startFlags, stack, callerApp));
}
@@ -1916,7 +1916,7 @@
mNoAnimation = (mLaunchFlags & FLAG_ACTIVITY_NO_ANIMATION) != 0;
- if (restrictedBgActivity) {
+ if (mRestrictedBgActivity && !mService.isBackgroundActivityStartsEnabled()) {
mAvoidMoveToFront = true;
mDoResume = false;
}
@@ -2380,7 +2380,6 @@
if (handleBackgroundActivityAbort(mStartActivity)) {
return START_ABORTED;
}
- return START_ABORTED;
}
// We only want to allow changing stack in two cases:
// 1. If the target task is not the top one. Otherwise we would move the launching task to
@@ -2553,17 +2552,15 @@
if (handleBackgroundActivityAbort(mStartActivity)) {
return START_ABORTED;
}
- return START_ABORTED;
}
final TaskRecord task = (prev != null)
? prev.getTaskRecord() : mTargetStack.createTaskRecord(
mSupervisor.getNextTaskIdForUserLocked(mStartActivity.mUserId), mStartActivity.info,
mIntent, null, null, true, mStartActivity, mSourceRecord, mOptions);
- if (mRestrictedBgActivity && !task.containsAppUid(mCallingUid)) {
+ if (mRestrictedBgActivity && prev != null && !task.containsAppUid(mCallingUid)) {
if (handleBackgroundActivityAbort(mStartActivity)) {
return START_ABORTED;
}
- return START_ABORTED;
}
addOrReparentStartingActivity(task, "setTaskToCurrentTopOrCreateNewTask");
mTargetStack.positionChildWindowContainerAtTop(task);
diff --git a/tests/RollbackTest/Android.bp b/tests/RollbackTest/Android.bp
index 1932871..1cf3d36 100644
--- a/tests/RollbackTest/Android.bp
+++ b/tests/RollbackTest/Android.bp
@@ -78,45 +78,6 @@
package_splits: ["anydpi"],
}
-apex {
- name: "com.android.tests.rollback.testapex.RollbackTestApexV1",
- manifest: "TestApex/RollbackTestApexV1.json",
- file_contexts: "apex.test",
- prebuilts: ["RollbackTestApex.prebuilt.txt"],
- key: "RollbackTestApex.key",
- installable: false,
-}
-
-apex {
- name: "com.android.tests.rollback.testapex.RollbackTestApexV2",
- manifest: "TestApex/RollbackTestApexV2.json",
- file_contexts: "apex.test",
- prebuilts: ["RollbackTestApex.prebuilt.txt"],
- key: "RollbackTestApex.key",
- installable: false,
-}
-
-apex {
- name: "com.android.tests.rollback.testapex.RollbackTestApexV3",
- manifest: "TestApex/RollbackTestApexV3.json",
- file_contexts: "apex.test",
- prebuilts: ["RollbackTestApex.prebuilt.txt"],
- key: "RollbackTestApex.key",
- installable: false,
-}
-
-apex_key {
- name: "RollbackTestApex.key",
- public_key: "TestApex/com.android.tests.rollback.testapex.avbpubkey",
- private_key: "TestApex/com.android.tests.rollback.testapex.pem",
- installable: false,
-}
-
-prebuilt_etc {
- name: "RollbackTestApex.prebuilt.txt",
- src: "TestApex/RollbackTestApex.prebuilt.txt",
-}
-
android_test {
name: "RollbackTest",
manifest: "RollbackTest/AndroidManifest.xml",
@@ -132,9 +93,6 @@
":RollbackTestAppBv2",
":RollbackTestAppASplitV1",
":RollbackTestAppASplitV2",
- ":com.android.tests.rollback.testapex.RollbackTestApexV1",
- ":com.android.tests.rollback.testapex.RollbackTestApexV2",
- ":com.android.tests.rollback.testapex.RollbackTestApexV3",
],
test_config: "RollbackTest.xml",
sdk_version: "test_current",
diff --git a/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java b/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java
index b3a9f49..1ddfa6e 100644
--- a/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java
+++ b/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/StagedRollbackTest.java
@@ -17,7 +17,6 @@
package com.android.tests.rollback;
import static com.android.tests.rollback.RollbackTestUtils.assertRollbackInfoEquals;
-import static com.android.tests.rollback.RollbackTestUtils.getRecentlyCommittedRollbackInfoById;
import static com.android.tests.rollback.RollbackTestUtils.getUniqueRollbackInfoForPackage;
import android.Manifest;
@@ -31,7 +30,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -55,15 +53,7 @@
private static final String TAG = "RollbackTest";
private static final String TEST_APP_A = "com.android.tests.rollback.testapp.A";
private static final String TEST_APP_A_V1 = "RollbackTestAppAv1.apk";
- private static final String TEST_APP_A_V2 = "RollbackTestAppAv2.apk";
private static final String TEST_APP_A_CRASHING_V2 = "RollbackTestAppACrashingV2.apk";
- private static final String TEST_APEX_PKG = "com.android.tests.rollback.testapex";
- private static final String TEST_APEX_V1 =
- "com.android.tests.rollback.testapex.RollbackTestApexV1.apex";
- private static final String TEST_APEX_V2 =
- "com.android.tests.rollback.testapex.RollbackTestApexV2.apex";
- private static final String TEST_APEX_V3 =
- "com.android.tests.rollback.testapex.RollbackTestApexV3.apex";
/**
* Adopts common shell permissions needed for rollback tests.
@@ -85,59 +75,6 @@
RollbackTestUtils.dropShellPermissionIdentity();
}
-
- /**
- * Test rollbacks of staged installs involving only apks.
- * Enable rollback phase.
- */
- @Test
- public void testApkOnlyEnableRollback() throws Exception {
- RollbackTestUtils.uninstall(TEST_APP_A);
- assertEquals(-1, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- RollbackTestUtils.install(TEST_APP_A_V1, false);
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
- RollbackTestUtils.processUserData(TEST_APP_A);
-
- RollbackTestUtils.installStaged(true, TEST_APP_A_V2);
-
- // At this point, the host test driver will reboot the device and run
- // testApkOnlyCommitRollback().
- }
-
- /**
- * Test rollbacks of staged installs involving only apks.
- * Commit rollback phase.
- */
- @Test
- public void testApkOnlyCommitRollback() throws Exception {
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
- RollbackTestUtils.processUserData(TEST_APP_A);
-
- RollbackManager rm = RollbackTestUtils.getRollbackManager();
- RollbackInfo rollback = getUniqueRollbackInfoForPackage(
- rm.getAvailableRollbacks(), TEST_APP_A);
- assertRollbackInfoEquals(TEST_APP_A, 2, 1, rollback);
- assertTrue(rollback.isStaged());
-
- RollbackTestUtils.rollback(rollback.getRollbackId(),
- new VersionedPackage(TEST_APP_A, 2));
-
- rollback = getUniqueRollbackInfoForPackage(
- rm.getRecentlyCommittedRollbacks(), TEST_APP_A);
- assertRollbackInfoEquals(TEST_APP_A, 2, 1, rollback, new VersionedPackage(TEST_APP_A, 2));
- assertTrue(rollback.isStaged());
- assertNotEquals(-1, rollback.getCommittedSessionId());
-
- RollbackTestUtils.waitForSessionReady(rollback.getCommittedSessionId());
-
- // The app should not be rolled back until after reboot.
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- // At this point, the host test driver will reboot the device and run
- // testApkOnlyConfirmRollback().
- }
-
/**
* Test rollbacks of staged installs involving only apks with bad update.
* Enable rollback phase.
@@ -209,7 +146,7 @@
* Confirm rollback phase.
*/
@Test
- public void testApkOnlyConfirmRollback() throws Exception {
+ public void testBadApkOnlyConfirmRollback() throws Exception {
assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
RollbackTestUtils.processUserData(TEST_APP_A);
@@ -220,171 +157,4 @@
assertTrue(rollback.isStaged());
assertNotEquals(-1, rollback.getCommittedSessionId());
}
-
- /**
- * Test rollbacks of staged installs an apk and an apex.
- * Enable rollback phase.
- */
- @Test
- public void testApkAndApexEnableRollback() throws Exception {
- RollbackTestUtils.uninstall(TEST_APP_A);
- RollbackTestUtils.install(TEST_APP_A_V1, false);
-
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- RollbackTestUtils.installStaged(true, TEST_APP_A_V2, TEST_APEX_V2);
-
- // At this point, the host test driver will reboot the device and run
- // testApkAndApexCommitRollback().
- }
-
- /**
- * Test rollbacks of staged installs an apk and an apex.
- * Commit rollback phase.
- */
- @Test
- public void testApkAndApexCommitRollback() throws Exception {
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- RollbackTestUtils.processUserData(TEST_APP_A);
-
- RollbackManager rm = RollbackTestUtils.getRollbackManager();
-
- RollbackInfo rollback = getUniqueRollbackInfoForPackage(
- rm.getAvailableRollbacks(), TEST_APP_A);
- String[] packagesNames = {TEST_APEX_PKG, TEST_APP_A};
- assertRollbackInfoEquals(packagesNames, 2, 1, rollback);
- assertTrue(rollback.isStaged());
-
- RollbackTestUtils.rollback(rollback.getRollbackId());
-
- RollbackInfo committed = getRecentlyCommittedRollbackInfoById(rollback.getRollbackId());
-
- assertRollbackInfoEquals(packagesNames, 2, 1, committed);
- assertTrue(committed.isStaged());
- assertNotEquals(-1, committed.getCommittedSessionId());
-
- RollbackTestUtils.waitForSessionReady(committed.getCommittedSessionId());
-
- // The apex and apk should not be rolled back until after reboot.
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- // At this point, the host test driver will reboot the device and run
- // testApkAndApexConfirmRollback().
- }
-
- /**
- * Test rollbacks of staged installs an apk and an apex.
- * Confirm rollback phase.
- */
- @Test
- public void testApkAndApexConfirmRollback() throws Exception {
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APP_A));
-
- RollbackTestUtils.processUserData(TEST_APP_A);
- }
-
- /**
- * Test rollbacks of staged installs involving only apex.
- * Enable rollback phase.
- */
- @Test
- public void testApexOnlyEnableRollback() throws Exception {
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- RollbackTestUtils.installStaged(true, TEST_APEX_V2);
-
- // At this point, the host test driver will reboot the device and run
- // testApexOnlyCommitRollback().
- }
-
- /**
- * Test rollbacks of staged installs involving only apex.
- * Commit rollback phase.
- */
- @Test
- public void testApexOnlyCommitRollback() throws Exception {
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
-
- RollbackManager rm = RollbackTestUtils.getRollbackManager();
- RollbackInfo rollback = getUniqueRollbackInfoForPackage(
- rm.getAvailableRollbacks(), TEST_APEX_PKG);
- assertRollbackInfoEquals(TEST_APEX_PKG, 2, 1, rollback);
- assertTrue(rollback.isStaged());
-
- RollbackTestUtils.rollback(rollback.getRollbackId());
-
- RollbackInfo committed = getRecentlyCommittedRollbackInfoById(rollback.getRollbackId());
-
- assertRollbackInfoEquals(TEST_APEX_PKG, 2, 1, committed);
- assertTrue(committed.isStaged());
- assertNotEquals(-1, committed.getCommittedSessionId());
-
- RollbackTestUtils.waitForSessionReady(committed.getCommittedSessionId());
-
- // The apex should not be rolled back until after reboot.
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
-
- // At this point, the host test driver will reboot the device and run
- // testApexOnlyConfirmRollback().
- }
-
- /**
- * Test rollbacks of staged installs involving only apex.
- * Confirm rollback phase.
- */
- @Test
- public void testApexOnlyConfirmRollback() throws Exception {
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- }
-
- /**
- * Tests that apex update expires existing rollbacks for that apex.
- * Enable rollback phase.
- */
- @Test
- public void testApexRollbackExpirationEnableRollback() throws Exception {
- assertEquals(1, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- RollbackTestUtils.installStaged(true, TEST_APEX_V2);
-
- // At this point, the host test driver will reboot the device and run
- // testApexRollbackExpirationUpdateApex().
- }
-
- /**
- * Tests that apex update expires existing rollbacks for that apex.
- * Update apex phase.
- */
- @Test
- public void testApexRollbackExpirationUpdateApex() throws Exception {
- assertEquals(2, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
- RollbackTestUtils.installStaged(false, TEST_APEX_V3);
-
- // At this point, the host test driver will reboot the device and run
- // testApexRollbackExpirationConfirmExpiration().
- }
-
- /**
- * Tests that apex update expires existing rollbacks for that apex.
- * Confirm expiration phase.
- */
- @Test
- public void testApexRollbackExpirationConfirmExpiration() throws Exception {
- assertEquals(3, RollbackTestUtils.getInstalledVersion(TEST_APEX_PKG));
-
- RollbackManager rm = RollbackTestUtils.getRollbackManager();
- assertNull(getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(), TEST_APEX_PKG));
- }
-
- /**
- * Helper function called by the host test to install v1 of the test apex,
- * assuming the test apex is not installed.
- */
- @Test
- public void installTestApexV1() throws Exception {
- RollbackTestUtils.installStaged(false, TEST_APEX_V1);
- }
}
diff --git a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
index 2433434..75a95ad 100644
--- a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
+++ b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
@@ -19,7 +19,6 @@
import static org.junit.Assert.assertTrue;
import com.android.ddmlib.Log.LogLevel;
-import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.log.LogUtil.CLog;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
@@ -32,9 +31,6 @@
*/
@RunWith(DeviceJUnit4ClassRunner.class)
public class StagedRollbackTest extends BaseHostJUnit4Test {
-
- private static final String TEST_APEX_PKG = "com.android.tests.rollback.testapex";
-
/**
* Runs the given phase of a test by calling into the device.
* Throws an exception if the test phase fails.
@@ -48,18 +44,6 @@
}
/**
- * Tests staged rollbacks involving only apks.
- */
- @Test
- public void testApkOnly() throws Exception {
- runPhase("testApkOnlyEnableRollback");
- getDevice().reboot();
- runPhase("testApkOnlyCommitRollback");
- getDevice().reboot();
- runPhase("testApkOnlyConfirmRollback");
- }
-
- /**
* Tests watchdog triggered staged rollbacks involving only apks.
*/
@Test
@@ -79,66 +63,6 @@
}
getDevice().waitForDeviceAvailable();
- runPhase("testApkOnlyConfirmRollback");
- }
-
- /**
- * Tests staged rollbacks involving only apex.
- */
- @Test
- public void testApexOnly() throws Exception {
- installTestApexV1();
- runPhase("testApexOnlyEnableRollback");
- getDevice().reboot();
- runPhase("testApexOnlyCommitRollback");
- getDevice().reboot();
- runPhase("testApexOnlyConfirmRollback");
- }
-
- /**
- * Tests staged rollbacks involving apk and apex.
- */
- @Test
- public void testApkAndApex() throws Exception {
- installTestApexV1();
- runPhase("testApkAndApexEnableRollback");
- getDevice().reboot();
- runPhase("testApkAndApexCommitRollback");
- getDevice().reboot();
- runPhase("testApkAndApexConfirmRollback");
- }
-
- /**
- * Tests that apex update expires existing rollbacks for that apex.
- */
- @Test
- public void testApexRollbackExpiration() throws Exception {
- installTestApexV1();
- runPhase("testApexRollbackExpirationEnableRollback");
- getDevice().reboot();
- runPhase("testApexRollbackExpirationUpdateApex");
- getDevice().reboot();
- runPhase("testApexRollbackExpirationConfirmExpiration");
- }
-
- /**
- * Do whatever is necessary to get version 1 of the test apex installed on
- * the device. Try to do so without extra reboots where possible to keep
- * the test execution time down.
- */
- private void installTestApexV1() throws Exception {
- for (ITestDevice.ApexInfo apexInfo : getDevice().getActiveApexes()) {
- if (TEST_APEX_PKG.equals(apexInfo.name)) {
- if (apexInfo.versionCode == 1) {
- return;
- }
- getDevice().uninstallPackage(TEST_APEX_PKG);
- getDevice().reboot();
- break;
- }
- }
-
- runPhase("installTestApexV1");
- getDevice().reboot();
+ runPhase("testBadApkOnlyConfirmRollback");
}
}
diff --git a/tests/RollbackTest/TestApex/RollbackTestApex.prebuilt.txt b/tests/RollbackTest/TestApex/RollbackTestApex.prebuilt.txt
deleted file mode 100644
index e871146..0000000
--- a/tests/RollbackTest/TestApex/RollbackTestApex.prebuilt.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-This file contains dummy content to include in the RollbackTestApex.
-
diff --git a/tests/RollbackTest/TestApex/RollbackTestApexV1.json b/tests/RollbackTest/TestApex/RollbackTestApexV1.json
deleted file mode 100644
index c3239ca..0000000
--- a/tests/RollbackTest/TestApex/RollbackTestApexV1.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "com.android.tests.rollback.testapex",
- "version": 1
-}
diff --git a/tests/RollbackTest/TestApex/RollbackTestApexV2.json b/tests/RollbackTest/TestApex/RollbackTestApexV2.json
deleted file mode 100644
index 9de3f45..0000000
--- a/tests/RollbackTest/TestApex/RollbackTestApexV2.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "com.android.tests.rollback.testapex",
- "version": 2
-}
diff --git a/tests/RollbackTest/TestApex/RollbackTestApexV3.json b/tests/RollbackTest/TestApex/RollbackTestApexV3.json
deleted file mode 100644
index 87a2c9d..0000000
--- a/tests/RollbackTest/TestApex/RollbackTestApexV3.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "com.android.tests.rollback.testapex",
- "version": 3
-}
diff --git a/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.avbpubkey b/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.avbpubkey
deleted file mode 100644
index b347331..0000000
--- a/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.avbpubkey
+++ /dev/null
Binary files differ
diff --git a/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.pem b/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.pem
deleted file mode 100644
index 7181ce5..0000000
--- a/tests/RollbackTest/TestApex/com.android.tests.rollback.testapex.pem
+++ /dev/null
@@ -1,51 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIJKQIBAAKCAgEArBLX+v6RMiK6soQFgbc0RZ+wticTD5sCbu9Q5B5WT7UnV1Wt
-cNI/n2bjks3UYNxTneOzMQOVjd4ln0BYZoNvoDtrc1BsYABpt4FywSq1zz/3sp3L
-3Vp8vaUyRsx0Da+PcOdYHPFs1WPX3Shw3MSPhUO/72KTm6GhO/cHEPEzSQLaw/zO
-8FiPpDdRqILqVJlu1DZ+i1DO+To9mKt59uLlxy3F+HAMnQaNW6+2NCV/vdCxQrEL
-m7PpsM6DymsFKcvVra1Il4apKkYNgcgTQ+AlmyPxGo6twfZvRMrU3bcrUmrg3OAx
-tMD7MufXlKkoFMlT5clrQ7P2ErKoFxhTVWhB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