Introduce result ranges for activity start return results.
The return result from starting activity actually represents two pieces of information. First, it conveys whether the activity started. Secondly, it conveys whether there was a fatal error if the activity did not start. Many parts of the code assume that a value greater than or equal to the defined success means that the activity successfully started. This is not the case as there are a number of results greater than success where the activity does not start. This change addresses the issue by introducing three distinct result ranges. The first represents results where the activity could not start due to a fatal error. The second represents results where the activity did not start due to a non-fatal error. The last range represents successful activity starts. Two convenience methods have been added to ActivityManager to return whether the result represents a fatal error and whether the result was successful. Change-Id: Ifaf844c353641a28b03b3c2d7b6be053fd9b8b44 Fixes: 38021882 Test: cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.DeviceOwnerTest#testLockTask_deviceOwnerUser
Loading
Please register or sign in to comment