Merge "Correcting the package name used on splash screen window." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0793f65c95
@@ -22,6 +22,7 @@ import android.annotation.Nullable;
|
|||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.TaskInfo;
|
import android.app.TaskInfo;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.view.InsetsState;
|
import android.view.InsetsState;
|
||||||
@@ -77,6 +78,14 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
public ActivityManager.RunningTaskInfo taskInfo;
|
public ActivityManager.RunningTaskInfo taskInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link ActivityInfo} of the target activity which to create the starting window.
|
||||||
|
* It can be null if the info is the same as the top in task info.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public ActivityInfo targetActivityInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InsetsState of TopFullscreenOpaqueWindow
|
* InsetsState of TopFullscreenOpaqueWindow
|
||||||
* @hide
|
* @hide
|
||||||
@@ -174,6 +183,7 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||||
dest.writeTypedObject(taskInfo, flags);
|
dest.writeTypedObject(taskInfo, flags);
|
||||||
|
dest.writeTypedObject(targetActivityInfo, flags);
|
||||||
dest.writeInt(startingWindowTypeParameter);
|
dest.writeInt(startingWindowTypeParameter);
|
||||||
dest.writeTypedObject(topOpaqueWindowInsetsState, flags);
|
dest.writeTypedObject(topOpaqueWindowInsetsState, flags);
|
||||||
dest.writeTypedObject(topOpaqueWindowLayoutParams, flags);
|
dest.writeTypedObject(topOpaqueWindowLayoutParams, flags);
|
||||||
@@ -185,6 +195,7 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
|
|
||||||
void readFromParcel(@NonNull Parcel source) {
|
void readFromParcel(@NonNull Parcel source) {
|
||||||
taskInfo = source.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR);
|
taskInfo = source.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR);
|
||||||
|
targetActivityInfo = source.readTypedObject(ActivityInfo.CREATOR);
|
||||||
startingWindowTypeParameter = source.readInt();
|
startingWindowTypeParameter = source.readInt();
|
||||||
topOpaqueWindowInsetsState = source.readTypedObject(InsetsState.CREATOR);
|
topOpaqueWindowInsetsState = source.readTypedObject(InsetsState.CREATOR);
|
||||||
topOpaqueWindowLayoutParams = source.readTypedObject(
|
topOpaqueWindowLayoutParams = source.readTypedObject(
|
||||||
@@ -198,6 +209,7 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "StartingWindowInfo{taskId=" + taskInfo.taskId
|
return "StartingWindowInfo{taskId=" + taskInfo.taskId
|
||||||
|
+ " targetActivityInfo=" + targetActivityInfo
|
||||||
+ " displayId=" + taskInfo.displayId
|
+ " displayId=" + taskInfo.displayId
|
||||||
+ " topActivityType=" + taskInfo.topActivityType
|
+ " topActivityType=" + taskInfo.topActivityType
|
||||||
+ " preferredStartingWindowType="
|
+ " preferredStartingWindowType="
|
||||||
|
|||||||
@@ -168,16 +168,14 @@ public class StartingSurfaceDrawer {
|
|||||||
void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken,
|
void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken,
|
||||||
@StartingWindowType int suggestType) {
|
@StartingWindowType int suggestType) {
|
||||||
final RunningTaskInfo taskInfo = windowInfo.taskInfo;
|
final RunningTaskInfo taskInfo = windowInfo.taskInfo;
|
||||||
final ActivityInfo activityInfo = taskInfo.topActivityInfo;
|
final ActivityInfo activityInfo = windowInfo.targetActivityInfo != null
|
||||||
if (activityInfo == null) {
|
? windowInfo.targetActivityInfo
|
||||||
|
: taskInfo.topActivityInfo;
|
||||||
|
if (activityInfo == null || activityInfo.packageName == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int displayId = taskInfo.displayId;
|
final int displayId = taskInfo.displayId;
|
||||||
if (activityInfo.packageName == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final int taskId = taskInfo.taskId;
|
final int taskId = taskInfo.taskId;
|
||||||
Context context = mContext;
|
Context context = mContext;
|
||||||
// replace with the default theme if the application didn't set
|
// 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();
|
final ActivityManager.RunningTaskInfo taskInfo = new ActivityManager.RunningTaskInfo();
|
||||||
taskInfo.topActivityInfo = info;
|
taskInfo.topActivityInfo = info;
|
||||||
taskInfo.taskId = taskId;
|
taskInfo.taskId = taskId;
|
||||||
|
windowInfo.targetActivityInfo = info;
|
||||||
windowInfo.taskInfo = taskInfo;
|
windowInfo.taskInfo = taskInfo;
|
||||||
return windowInfo;
|
return windowInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4167,7 +4167,9 @@ class Task extends WindowContainer<WindowContainer> {
|
|||||||
StartingWindowInfo getStartingWindowInfo(ActivityRecord activity) {
|
StartingWindowInfo getStartingWindowInfo(ActivityRecord activity) {
|
||||||
final StartingWindowInfo info = new StartingWindowInfo();
|
final StartingWindowInfo info = new StartingWindowInfo();
|
||||||
info.taskInfo = getTaskInfo();
|
info.taskInfo = getTaskInfo();
|
||||||
|
info.targetActivityInfo = info.taskInfo.topActivityInfo != null
|
||||||
|
&& activity.info != info.taskInfo.topActivityInfo
|
||||||
|
? activity.info : null;
|
||||||
info.isKeyguardOccluded =
|
info.isKeyguardOccluded =
|
||||||
mAtmService.mKeyguardController.isDisplayOccluded(DEFAULT_DISPLAY);
|
mAtmService.mKeyguardController.isDisplayOccluded(DEFAULT_DISPLAY);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user