OSDN Git Service

Remove all activities that do not successfully launch.
authorBryce Lee <brycelee@google.com>
Wed, 17 May 2017 23:45:36 +0000 (16:45 -0700)
committerBryce Lee <brycelee@google.com>
Wed, 17 May 2017 23:45:42 +0000 (16:45 -0700)
We previously were only removing activities that launched with
a fatal result code. Activities that do not start due to a
non-fatal error should also be removed.

Change-Id: I0b38eaaab7e38ed314c6022705170def38e10436
Fixes: 38021882
Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser

services/core/java/com/android/server/am/ActivityStarter.java

index a2eec5c..c57fc96 100644 (file)
@@ -956,7 +956,7 @@ class ActivityStarter {
             // If we are not able to proceed, disassociate the activity from the task. Leaving an
             // activity in an incomplete state can lead to issues, such as performing operations
             // without a window container.
-            if (ActivityManager.isStartResultFatalError(result)
+            if (!ActivityManager.isStartResultSuccessful(result)
                     && mStartActivity.getTask() != null) {
                 mStartActivity.getTask().removeActivity(mStartActivity);
             }