Merge "Make requested visibility available in snapshot starting window" into sc-v2-dev
This commit is contained in:
@@ -116,6 +116,10 @@ public class InsetsVisibilities implements Parcelable {
|
|||||||
dest.writeIntArray(mVisibilities);
|
dest.writeIntArray(mVisibilities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void readFromParcel(@NonNull Parcel in) {
|
||||||
|
in.readIntArray(mVisibilities);
|
||||||
|
}
|
||||||
|
|
||||||
public static final @NonNull Creator<InsetsVisibilities> CREATOR =
|
public static final @NonNull Creator<InsetsVisibilities> CREATOR =
|
||||||
new Creator<InsetsVisibilities>() {
|
new Creator<InsetsVisibilities>() {
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ 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;
|
||||||
|
import android.view.InsetsVisibilities;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,7 +166,13 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
* TaskSnapshot.
|
* TaskSnapshot.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public TaskSnapshot mTaskSnapshot;
|
public TaskSnapshot taskSnapshot;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The requested insets visibility of the top main window.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public final InsetsVisibilities requestedVisibilities = new InsetsVisibilities();
|
||||||
|
|
||||||
public StartingWindowInfo() {
|
public StartingWindowInfo() {
|
||||||
|
|
||||||
@@ -190,7 +197,8 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
dest.writeTypedObject(mainWindowLayoutParams, flags);
|
dest.writeTypedObject(mainWindowLayoutParams, flags);
|
||||||
dest.writeInt(splashScreenThemeResId);
|
dest.writeInt(splashScreenThemeResId);
|
||||||
dest.writeBoolean(isKeyguardOccluded);
|
dest.writeBoolean(isKeyguardOccluded);
|
||||||
dest.writeTypedObject(mTaskSnapshot, flags);
|
dest.writeTypedObject(taskSnapshot, flags);
|
||||||
|
requestedVisibilities.writeToParcel(dest, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void readFromParcel(@NonNull Parcel source) {
|
void readFromParcel(@NonNull Parcel source) {
|
||||||
@@ -203,7 +211,8 @@ public final class StartingWindowInfo implements Parcelable {
|
|||||||
mainWindowLayoutParams = source.readTypedObject(WindowManager.LayoutParams.CREATOR);
|
mainWindowLayoutParams = source.readTypedObject(WindowManager.LayoutParams.CREATOR);
|
||||||
splashScreenThemeResId = source.readInt();
|
splashScreenThemeResId = source.readInt();
|
||||||
isKeyguardOccluded = source.readBoolean();
|
isKeyguardOccluded = source.readBoolean();
|
||||||
mTaskSnapshot = source.readTypedObject(TaskSnapshot.CREATOR);
|
taskSnapshot = source.readTypedObject(TaskSnapshot.CREATOR);
|
||||||
|
requestedVisibilities.readFromParcel(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public class StartingWindowController implements RemoteCallable<StartingWindowCo
|
|||||||
mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, appToken,
|
mStartingSurfaceDrawer.addSplashScreenStartingWindow(windowInfo, appToken,
|
||||||
suggestionType);
|
suggestionType);
|
||||||
} else if (suggestionType == STARTING_WINDOW_TYPE_SNAPSHOT) {
|
} else if (suggestionType == STARTING_WINDOW_TYPE_SNAPSHOT) {
|
||||||
final TaskSnapshot snapshot = windowInfo.mTaskSnapshot;
|
final TaskSnapshot snapshot = windowInfo.taskSnapshot;
|
||||||
mStartingSurfaceDrawer.makeTaskSnapshotWindow(windowInfo, appToken,
|
mStartingSurfaceDrawer.makeTaskSnapshotWindow(windowInfo, appToken,
|
||||||
snapshot);
|
snapshot);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ import android.view.IWindowSession;
|
|||||||
import android.view.InputChannel;
|
import android.view.InputChannel;
|
||||||
import android.view.InsetsSourceControl;
|
import android.view.InsetsSourceControl;
|
||||||
import android.view.InsetsState;
|
import android.view.InsetsState;
|
||||||
import android.view.InsetsVisibilities;
|
|
||||||
import android.view.SurfaceControl;
|
import android.view.SurfaceControl;
|
||||||
import android.view.SurfaceSession;
|
import android.view.SurfaceSession;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -231,13 +230,12 @@ public class TaskSnapshotWindow {
|
|||||||
final Window window = snapshotSurface.mWindow;
|
final Window window = snapshotSurface.mWindow;
|
||||||
|
|
||||||
final InsetsState tmpInsetsState = new InsetsState();
|
final InsetsState tmpInsetsState = new InsetsState();
|
||||||
final InsetsVisibilities tmpRequestedVisibilities = new InsetsVisibilities();
|
|
||||||
final InputChannel tmpInputChannel = new InputChannel();
|
final InputChannel tmpInputChannel = new InputChannel();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "TaskSnapshot#addToDisplay");
|
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "TaskSnapshot#addToDisplay");
|
||||||
final int res = session.addToDisplay(window, layoutParams, View.GONE, displayId,
|
final int res = session.addToDisplay(window, layoutParams, View.GONE, displayId,
|
||||||
tmpRequestedVisibilities, tmpInputChannel, tmpInsetsState, tmpControls);
|
info.requestedVisibilities, tmpInputChannel, tmpInsetsState, tmpControls);
|
||||||
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
|
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
Slog.w(TAG, "Failed to add snapshot starting window res=" + res);
|
Slog.w(TAG, "Failed to add snapshot starting window res=" + res);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor
|
|||||||
* rotation must be the same).
|
* rotation must be the same).
|
||||||
*/
|
*/
|
||||||
private boolean isSnapshotCompatible(StartingWindowInfo windowInfo) {
|
private boolean isSnapshotCompatible(StartingWindowInfo windowInfo) {
|
||||||
final TaskSnapshot snapshot = windowInfo.mTaskSnapshot;
|
final TaskSnapshot snapshot = windowInfo.taskSnapshot;
|
||||||
if (snapshot == null) {
|
if (snapshot == null) {
|
||||||
if (DEBUG_SPLASH_SCREEN || DEBUG_TASK_SNAPSHOT) {
|
if (DEBUG_SPLASH_SCREEN || DEBUG_TASK_SNAPSHOT) {
|
||||||
Slog.d(TAG, "isSnapshotCompatible no snapshot " + windowInfo.taskInfo.taskId);
|
Slog.d(TAG, "isSnapshotCompatible no snapshot " + windowInfo.taskInfo.taskId);
|
||||||
|
|||||||
@@ -3521,6 +3521,7 @@ class Task extends TaskFragment {
|
|||||||
final WindowState mainWindow = activity.findMainWindow();
|
final WindowState mainWindow = activity.findMainWindow();
|
||||||
if (mainWindow != null) {
|
if (mainWindow != null) {
|
||||||
info.mainWindowLayoutParams = mainWindow.getAttrs();
|
info.mainWindowLayoutParams = mainWindow.getAttrs();
|
||||||
|
info.requestedVisibilities.set(mainWindow.getRequestedVisibilities());
|
||||||
}
|
}
|
||||||
// If the developer has persist a different configuration, we need to override it to the
|
// If the developer has persist a different configuration, we need to override it to the
|
||||||
// starting window because persisted configuration does not effect to Task.
|
// starting window because persisted configuration does not effect to Task.
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
|
|||||||
if (launchTheme != 0) {
|
if (launchTheme != 0) {
|
||||||
info.splashScreenThemeResId = launchTheme;
|
info.splashScreenThemeResId = launchTheme;
|
||||||
}
|
}
|
||||||
info.mTaskSnapshot = taskSnapshot;
|
info.taskSnapshot = taskSnapshot;
|
||||||
// make this happen prior than prepare surface
|
// make this happen prior than prepare surface
|
||||||
try {
|
try {
|
||||||
lastOrganizer.addStartingWindow(info, activity.token);
|
lastOrganizer.addStartingWindow(info, activity.token);
|
||||||
|
|||||||
Reference in New Issue
Block a user