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
// 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);
}