Return error code when there's an error starting an activity
When an error occurs while attempting to start an activity,
runStartActivity does not always return an error code like it should.
This causes tools like the simpleperf app profiler to have incorrect
behavior:
$ system/extras/simpleperf/scripts/app_profiler.py -p com.google.android.youtube -a doesntexist
18:08:45,394 [DEBUG] (simpleperf_utils.py:304) run adb cmd: ['adb', 'shell', 'am', 'start', '-n', 'com.google.android.youtube/doesntexist'] [result True]
<Blocks forever>
Immediately return an error code in these cases like elsewhere in the
function.
Bug: 294402973
Test: $ system/extras/simpleperf/scripts/app_profiler.py -p com.google.android.youtube -a doesntexist
Test: 17:39:26,843 [DEBUG] (simpleperf_utils.py:304) run adb cmd: ['adb', 'shell', 'am', 'start', '-n', 'com.google.android.youtube/doesntexist'] [result False]
Test: Can't start activity com.google.android.youtube/doesntexist
Change-Id: If1ebbde6ee77b27b8d6fa7d4097163d3b4594389
1 file changed