use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project android_packages_apps_Launcher3 by AOSPA.
the class TaplTestsQuickstep method testPressBack.
// TODO(b/204830798): test with all navigation modes(add @NavigationModeSwitch annotation)
// after the bug resolved.
@Ignore("b/205027405")
@Test
@PortraitLandscape
@ScreenRecord
public void testPressBack() throws Exception {
mLauncher.getWorkspace().switchToAllApps();
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
try {
allApps.getAppIcon(APP_NAME).dragToWorkspace(false, false);
} finally {
allApps.unfreeze();
}
mLauncher.getWorkspace().getWorkspaceAppIcon(APP_NAME).launch(getAppPackageName());
mLauncher.pressBack();
mLauncher.getWorkspace();
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
}
use of com.android.launcher3.logging.StatsLogManager.LauncherEvent.IGNORE in project android_packages_apps_Launcher3 by AOSPA.
the class LauncherAppWidgetProviderInfo method initSpans.
public void initSpans(Context context, InvariantDeviceProfile idp) {
int minSpanX = 0;
int minSpanY = 0;
int maxSpanX = idp.numColumns;
int maxSpanY = idp.numRows;
int spanX = 0;
int spanY = 0;
Rect widgetPadding = new Rect();
Rect localPadding = new Rect();
AppWidgetHostView.getDefaultPaddingForWidget(context, provider, widgetPadding);
Point cellSize = new Point();
for (DeviceProfile dp : idp.supportedProfiles) {
dp.getCellSize(cellSize);
// If grids supports insetting widgets, we do not account for widget padding.
if (dp.shouldInsetWidgets()) {
localPadding.setEmpty();
} else {
localPadding.set(widgetPadding);
}
minSpanX = Math.max(minSpanX, getSpanX(localPadding, minResizeWidth, dp.cellLayoutBorderSpacePx.x, cellSize.x));
minSpanY = Math.max(minSpanY, getSpanY(localPadding, minResizeHeight, dp.cellLayoutBorderSpacePx.y, cellSize.y));
if (ATLEAST_S) {
if (maxResizeWidth > 0) {
maxSpanX = Math.min(maxSpanX, getSpanX(localPadding, maxResizeWidth, dp.cellLayoutBorderSpacePx.x, cellSize.x));
}
if (maxResizeHeight > 0) {
maxSpanY = Math.min(maxSpanY, getSpanY(localPadding, maxResizeHeight, dp.cellLayoutBorderSpacePx.y, cellSize.y));
}
}
spanX = Math.max(spanX, getSpanX(localPadding, minWidth, dp.cellLayoutBorderSpacePx.x, cellSize.x));
spanY = Math.max(spanY, getSpanY(localPadding, minHeight, dp.cellLayoutBorderSpacePx.y, cellSize.y));
}
if (ATLEAST_S) {
// Ensures maxSpan >= minSpan
maxSpanX = Math.max(maxSpanX, minSpanX);
maxSpanY = Math.max(maxSpanY, minSpanY);
// Otherwise, use the span of minWidth/Height.
if (targetCellWidth >= minSpanX && targetCellWidth <= maxSpanX && targetCellHeight >= minSpanY && targetCellHeight <= maxSpanY) {
spanX = targetCellWidth;
spanY = targetCellHeight;
}
}
// If minSpanX/Y > spanX/Y, ignore the minSpanX/Y to match the behavior described in
// minResizeWidth & minResizeHeight Android documentation. See
// https://developer.android.com/reference/android/appwidget/AppWidgetProviderInfo
this.minSpanX = Math.min(spanX, minSpanX);
this.minSpanY = Math.min(spanY, minSpanY);
this.maxSpanX = maxSpanX;
this.maxSpanY = maxSpanY;
this.mIsMinSizeFulfilled = Math.min(spanX, minSpanX) <= idp.numColumns && Math.min(spanY, minSpanY) <= idp.numRows;
// Ensures the default span X and span Y will not exceed the current grid size.
this.spanX = Math.min(spanX, idp.numColumns);
this.spanY = Math.min(spanY, idp.numRows);
}
Aggregations