Merge "Log each time the layer stack changes for DisplayDevice." into tm-qpr-dev

This commit is contained in:
Santos Cordon
2023-03-01 11:57:05 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.display.DisplayViewport;
import android.os.IBinder;
import android.util.Slog;
import android.view.Display;
import android.view.DisplayAddress;
import android.view.Surface;
@@ -37,6 +38,7 @@ import java.io.PrintWriter;
* </p>
*/
abstract class DisplayDevice {
private static final String TAG = "DisplayDevice";
private static final Display.Mode EMPTY_DISPLAY_MODE = new Display.Mode.Builder().build();
private final DisplayAdapter mDisplayAdapter;
@@ -266,10 +268,13 @@ abstract class DisplayDevice {
/**
* Sets the display layer stack while in a transaction.
*/
public final void setLayerStackLocked(SurfaceControl.Transaction t, int layerStack) {
public final void setLayerStackLocked(SurfaceControl.Transaction t, int layerStack,
int layerStackTag) {
if (mCurrentLayerStack != layerStack) {
mCurrentLayerStack = layerStack;
t.setDisplayLayerStack(mDisplayToken, layerStack);
Slog.i(TAG, "[" + layerStackTag + "] Layerstack set to " + layerStack + " for "
+ mUniqueId);
}
}

View File

@@ -494,7 +494,7 @@ final class LogicalDisplay {
DisplayDevice device,
boolean isBlanked) {
// Set the layer stack.
device.setLayerStackLocked(t, isBlanked ? BLANK_LAYER_STACK : mLayerStack);
device.setLayerStackLocked(t, isBlanked ? BLANK_LAYER_STACK : mLayerStack, mDisplayId);
// Also inform whether the device is the same one sent to inputflinger for its layerstack.
// Prevent displays that are disabled from receiving input.
// TODO(b/188914255): Remove once input can dispatch against device vs layerstack.