Add logs for getFocusedTaskHeightForTablet

Bug: 336660988
Bug: 360724626
Test: presubmit
Flag: TEST_ONLY
Change-Id: I67d4fc8211f24b77566bd24525d23054dfdded6e
This commit is contained in:
Alex Chau
2024-08-19 18:52:22 +01:00
parent cafe06f63d
commit d326e17fe2
3 changed files with 22 additions and 0 deletions
@@ -1,6 +1,7 @@
package com.android.quickstep;
import static com.android.launcher3.taskbar.TaskbarThresholdUtils.getFromNavThreshold;
import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.app.Activity;
@@ -8,6 +9,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.Nullable;
@@ -78,12 +80,25 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
}
case TestProtocol.REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET: {
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH,
"=== REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET ===");
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "isTablet: " + mDeviceProfile.isTablet);
if (!mDeviceProfile.isTablet) {
return null;
}
Rect focusedTaskRect = new Rect();
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "widthPx: " + mDeviceProfile.widthPx);
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "heightPx: " + mDeviceProfile.heightPx);
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "insets: " + mDeviceProfile.getInsets());
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "overviewTaskThumbnailTopMarginPx: "
+ mDeviceProfile.overviewTaskThumbnailTopMarginPx);
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "overviewActionsClaimedSpace: "
+ mDeviceProfile.getOverviewActionsClaimedSpace());
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH,
"overviewGridSideMargin: " + mDeviceProfile.overviewGridSideMargin);
LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
focusedTaskRect, RecentsPagedOrientationHandler.PORTRAIT);
Log.d(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH, "focusedTaskRect: " + focusedTaskRect);
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height());
return response;
}
@@ -173,6 +173,7 @@ public final class TestProtocol {
public static final String TEST_DRAG_APP_ICON_TO_MULTIPLE_WORKSPACES_FAILURE = "b/326908466";
public static final String WIDGET_CONFIG_NULL_EXTRA_INTENT = "b/324419890";
public static final String OVERVIEW_SELECT_TOOLTIP_MISALIGNED = "b/332485341";
public static final String OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH = "b/336660988";
public static final String REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW = "enable-grid-only-overview";
public static final String REQUEST_FLAG_ENABLE_APP_PAIRS = "enable-app-pairs";
@@ -23,6 +23,8 @@ import static com.android.launcher3.tapl.LauncherInstrumentation.log;
import static com.android.launcher3.tapl.OverviewTask.TASK_START_EVENT;
import static com.android.launcher3.tapl.TestHelpers.getOverviewPackageName;
import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;
import static com.android.launcher3.testing.shared.TestProtocol.OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH;
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
import android.graphics.Rect;
import android.util.Log;
@@ -533,9 +535,13 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer {
return null;
}
int focusedTaskHeight = mLauncher.getFocusedTaskHeightForTablet();
testLogD(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH,
"getFocusedTaskForTablet: " + focusedTaskHeight);
for (UiObject2 task : taskViews) {
OverviewTask overviewTask = new OverviewTask(mLauncher, task, this);
testLogD(OVERVIEW_FOCUS_TASK_HEIGHT_MISMATCH,
"overviewTask.getVisibleHeight(): " + overviewTask.getVisibleHeight());
if (overviewTask.getVisibleHeight() == focusedTaskHeight) {
return overviewTask;
}