Correcting the package name used on splash screen window.
The top activity in TaskActivitiesReport can be filter out if the state of top activity is INITIALIZING, this doesn't make sense for splash screen, because the state of the top activity do can be INITIALIZING. Create a filed targetActivityInfo in StartingWindowInfo to specify the starting activity info. Bug: 193459277 Test: atest SplashscreenTests StartingSurfaceDrawerTests Change-Id: Ifec7aff644013a0426e0622162ab24f6b9fb3d8f
This commit is contained in:
@@ -168,16 +168,14 @@ public class StartingSurfaceDrawer {
|
||||
void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken,
|
||||
@StartingWindowType int suggestType) {
|
||||
final RunningTaskInfo taskInfo = windowInfo.taskInfo;
|
||||
final ActivityInfo activityInfo = taskInfo.topActivityInfo;
|
||||
if (activityInfo == null) {
|
||||
final ActivityInfo activityInfo = windowInfo.targetActivityInfo != null
|
||||
? windowInfo.targetActivityInfo
|
||||
: taskInfo.topActivityInfo;
|
||||
if (activityInfo == null || activityInfo.packageName == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int displayId = taskInfo.displayId;
|
||||
if (activityInfo.packageName == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int taskId = taskInfo.taskId;
|
||||
Context context = mContext;
|
||||
// replace with the default theme if the application didn't set
|
||||
|
||||
@@ -214,6 +214,7 @@ public class StartingSurfaceDrawerTests {
|
||||
final ActivityManager.RunningTaskInfo taskInfo = new ActivityManager.RunningTaskInfo();
|
||||
taskInfo.topActivityInfo = info;
|
||||
taskInfo.taskId = taskId;
|
||||
windowInfo.targetActivityInfo = info;
|
||||
windowInfo.taskInfo = taskInfo;
|
||||
return windowInfo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user