Improve Taskbar touchableRegion debuggability

- Add DebugTouchableRegion which includes the last region that we
  set as well as the reason (code path) for it, which we dump.
- If persist.debug.draw_taskbar_debug_ui is enabled, we will also
  outline the touchable region on the screen.

Flag: None
Test: testThreeButtonsTaskbarBoundsAfterConfigChangeDuringIme
Bug: 315393203

Change-Id: I70b37e8b8804c4a48ffe3956d2a24aa5eab452fd
This commit is contained in:
Tony Wickham
2024-01-05 20:37:06 +00:00
parent 79f5536524
commit 762f8151f6
5 changed files with 91 additions and 7 deletions

View File

@@ -19,8 +19,10 @@ import static com.android.launcher3.taskbar.TaskbarPinningController.PINNING_PER
import static com.android.launcher3.taskbar.TaskbarPinningController.PINNING_TRANSIENT;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.SystemProperties;
import android.view.ViewTreeObserver;
import com.android.launcher3.DeviceProfile;
@@ -39,6 +41,9 @@ import java.io.PrintWriter;
public class TaskbarDragLayerController implements TaskbarControllers.LoggableTaskbarController,
TaskbarControllers.BackgroundRendererController {
private static final boolean DEBUG = SystemProperties.getBoolean(
"persist.debug.draw_taskbar_debug_ui", false);
private final TaskbarActivityContext mActivity;
private final TaskbarDragLayer mTaskbarDragLayer;
private final int mFolderMargin;
@@ -299,5 +304,15 @@ public class TaskbarDragLayerController implements TaskbarControllers.LoggableTa
mTaskbarStashViaTouchController,
};
}
/**
* Draws debug UI on top of everything in TaskbarDragLayer.
*/
public void drawDebugUi(Canvas canvas) {
if (!DEBUG) {
return;
}
mControllers.taskbarInsetsController.drawDebugTouchableRegionBounds(canvas);
}
}
}