Check null before getting task bounds
The task bounds was used to decide whether multiple launches can be combined into one event for tracking launch time. With below sample: startActivities(new Intent[] { new Intent(c, Activity1.class), new Intent(c, Activity2.class).setFlags( Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK) }); When launching Activity2, because Activity1 hasn't real started, Activity1 will be removed from task directly. Then its task will be null, that causes mLastLaunchedActivity.getTask() to be null. If the task is not available, check if the launched activity has the same uid as the caller uid. Fix: 276513946 Test: atest ActivityMetricsLaunchObserverTests#testConsecutiveLaunch Change-Id: I731f0446b62b666b22ba1a6b37364d95efd0a32c
Loading
Please register or sign in to comment