Added WindowManagerWrapper#setProvidesInsetsTypes
Allows launcher to set providesInsetsType on a window Also, cleaned up ctor for ShellTaskOrganizer to reduce duplicate code. Bug: 169054709 Test: builds Change-Id: I9e1f4a27b924013c0b6b17f0a5e10ac3411cbf4e
This commit is contained in:
@@ -39,13 +39,14 @@ public class TaskOrganizer extends WindowOrganizer {
|
||||
private ITaskOrganizerController mTaskOrganizerController;
|
||||
|
||||
public TaskOrganizer() {
|
||||
mTaskOrganizerController = getController();
|
||||
this(null);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@VisibleForTesting
|
||||
public TaskOrganizer(ITaskOrganizerController taskOrganizerController) {
|
||||
mTaskOrganizerController = taskOrganizerController;
|
||||
mTaskOrganizerController = taskOrganizerController != null
|
||||
? taskOrganizerController : getController();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,10 +66,7 @@ public class ShellTaskOrganizer extends TaskOrganizer {
|
||||
|
||||
public ShellTaskOrganizer(SyncTransactionQueue syncQueue, TransactionPool transactionPool,
|
||||
ShellExecutor mainExecutor, ShellExecutor animExecutor) {
|
||||
super();
|
||||
addListener(new FullscreenTaskListener(syncQueue), WINDOWING_MODE_FULLSCREEN);
|
||||
mTransitions = new Transitions(this, transactionPool, mainExecutor, animExecutor);
|
||||
if (Transitions.ENABLE_SHELL_TRANSITIONS) registerTransitionPlayer(mTransitions);
|
||||
this(null, syncQueue, transactionPool, mainExecutor, animExecutor);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
@@ -88,7 +88,7 @@ import java.util.function.Consumer;
|
||||
* This class is also responsible for general resize/offset PiP operations within SysUI component,
|
||||
* see also {@link PipMotionHelper}.
|
||||
*/
|
||||
public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
||||
public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
|
||||
DisplayController.OnDisplaysChangedListener {
|
||||
private static final String TAG = PipTaskOrganizer.class.getSimpleName();
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.graphics.Rect;
|
||||
import android.os.Handler;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.view.InsetsState;
|
||||
import android.view.SurfaceControl;
|
||||
import android.view.WindowManager;
|
||||
import android.view.WindowManagerGlobal;
|
||||
@@ -81,12 +82,25 @@ public class WindowManagerWrapper {
|
||||
WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
public static final int WINDOWING_MODE_FREEFORM = WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
|
||||
public static final int ITYPE_EXTRA_NAVIGATION_BAR = InsetsState.ITYPE_EXTRA_NAVIGATION_BAR;
|
||||
|
||||
private static final WindowManagerWrapper sInstance = new WindowManagerWrapper();
|
||||
|
||||
public static WindowManagerWrapper getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets {@param providesInsetsTypes} as the inset types provided by {@param params}.
|
||||
* @param params The window layout params.
|
||||
* @param providesInsetsTypes The inset types we would like this layout params to provide.
|
||||
*/
|
||||
public void setProvidesInsetsTypes(WindowManager.LayoutParams params,
|
||||
int[] providesInsetsTypes) {
|
||||
params.providesInsetsTypes = providesInsetsTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the stable insets for the primary display.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user