Snap for 8195043 from 49141ccf2e to udc-release

Change-Id: I8570719af23961280151419708feea4615f3cab1
This commit is contained in:
Android Build Coastguard Worker committed 2022-02-18 04:08:33 +00:00
commit d4229cf5b6
9 files changed
+30 -56

No files matched your search

@@ -464,11 +464,15 @@ public class TaskView extends FrameLayout implements Reusable {
return getItemInfo(mTask);
}
protected WorkspaceItemInfo getItemInfo(Task task) {
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
protected WorkspaceItemInfo getItemInfo(@Nullable Task task) {
WorkspaceItemInfo stubInfo = new WorkspaceItemInfo();
stubInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_TASK;
stubInfo.container = LauncherSettings.Favorites.CONTAINER_TASKSWITCHER;
if (task == null) {
return stubInfo;
}
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
stubInfo.user = componentKey.user;
stubInfo.intent = new Intent().setComponent(componentKey.componentName);
stubInfo.title = task.title;
-2
View File
@@ -1682,8 +1682,6 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
AbstractFloatingView.closeOpenViews(this, false, TYPE_ALL & ~TYPE_REBIND_SAFE);
finishAutoCancelActionMode();
DragView.removeAllViews(this);
if (mPendingRequestArgs != null) {
outState.putParcelable(RUNTIME_STATE_PENDING_REQUEST_ARGS, mPendingRequestArgs);
}
@@ -139,12 +139,12 @@ public final class FeatureFlags {
public static final BooleanFlag ENABLE_BULK_WORKSPACE_ICON_LOADING = getDebugFlag(
"ENABLE_BULK_WORKSPACE_ICON_LOADING",
false,
true,
"Enable loading workspace icons in bulk.");
public static final BooleanFlag ENABLE_BULK_ALL_APPS_ICON_LOADING = getDebugFlag(
"ENABLE_BULK_ALL_APPS_ICON_LOADING",
false,
true,
"Enable loading all apps icons in bulk.");
// Keep as DeviceFlag for remote disable in emergency.
@@ -565,19 +565,4 @@ public abstract class DragView<T extends Context & ActivityContext> extends Fram
iv.setImageDrawable(drawable);
return iv;
}
/**
* Removes any stray DragView from the DragLayer.
*/
public static void removeAllViews(ActivityContext activity) {
BaseDragLayer dragLayer = activity.getDragLayer();
// Iterate in reverse order. DragView is added later to the dragLayer,
// and will be one of the last views.
for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {
View child = dragLayer.getChildAt(i);
if (child instanceof DragView) {
dragLayer.removeView(child);
}
}
}
}
@@ -111,7 +111,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
* 3) Place appropriate elements like icons and first-page qsb
* 4) Measure and draw the view on a canvas
*/
@TargetApi(Build.VERSION_CODES.O)
@TargetApi(Build.VERSION_CODES.R)
public class LauncherPreviewRenderer extends ContextWrapper
implements ActivityContext, WorkspaceLayoutManager, LayoutInflater.Factory2 {
@@ -186,19 +186,13 @@ public class LauncherPreviewRenderer extends ContextWrapper
mIdp = idp;
mDp = idp.getDeviceProfile(context).copy(context);
if (Utilities.ATLEAST_R) {
WindowInsets currentWindowInsets = context.getSystemService(WindowManager.class)
.getCurrentWindowMetrics().getWindowInsets();
mInsets = new Rect(
currentWindowInsets.getSystemWindowInsetLeft(),
currentWindowInsets.getSystemWindowInsetTop(),
currentWindowInsets.getSystemWindowInsetRight(),
currentWindowInsets.getSystemWindowInsetBottom());
} else {
mInsets = new Rect();
mInsets.left = mInsets.right = (mDp.widthPx - mDp.availableWidthPx) / 2;
mInsets.top = mInsets.bottom = (mDp.heightPx - mDp.availableHeightPx) / 2;
}
WindowInsets currentWindowInsets = context.getSystemService(WindowManager.class)
.getCurrentWindowMetrics().getWindowInsets();
mInsets = new Rect(
currentWindowInsets.getSystemWindowInsetLeft(),
currentWindowInsets.getSystemWindowInsetTop(),
currentWindowInsets.getSystemWindowInsetRight(),
mDp.isTaskbarPresent ? 0 : currentWindowInsets.getSystemWindowInsetBottom());
mDp.updateInsets(mInsets);
BaseIconFactory iconFactory =
@@ -420,12 +420,12 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
List<SplitPositionOption> options = new ArrayList<>(1);
// Add both left and right options if we're in tablet mode
if (dp.isTablet && dp.isLandscape) {
options.add(new SplitPositionOption(
R.drawable.ic_split_right, R.string.split_screen_position_right,
STAGE_POSITION_BOTTOM_OR_RIGHT, STAGE_TYPE_MAIN));
options.add(new SplitPositionOption(
R.drawable.ic_split_left, R.string.split_screen_position_left,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
options.add(new SplitPositionOption(
R.drawable.ic_split_right, R.string.split_screen_position_right,
STAGE_POSITION_BOTTOM_OR_RIGHT, STAGE_TYPE_MAIN));
} else {
if (dp.isSeascape()) {
// Add left/right options
@@ -164,7 +164,7 @@ public class SeascapePagedViewHandler extends LandscapePagedViewHandler {
// Add "right" option which is actually the top
return Collections.singletonList(new SplitPositionOption(
R.drawable.ic_split_right, R.string.split_screen_position_right,
STAGE_POSITION_TOP_OR_LEFT, STAGE_TYPE_MAIN));
STAGE_POSITION_BOTTOM_OR_RIGHT, STAGE_TYPE_MAIN));
}
@Override
@@ -64,8 +64,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testDragIconToRightPanel() {
Workspace workspace = mLauncher.getWorkspace();
@@ -79,8 +78,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testSinglePageDragIconWhenMultiplePageScrollingIsPossible() {
Workspace workspace = mLauncher.getWorkspace();
@@ -134,8 +132,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testDragIconToPage2() {
Workspace workspace = mLauncher.getWorkspace();
@@ -151,8 +148,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testDragIconToPage3() {
Workspace workspace = mLauncher.getWorkspace();
@@ -168,8 +164,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testMultiplePageDragIcon() {
Workspace workspace = mLauncher.getWorkspace();
@@ -215,8 +210,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testEmptyPageDoesNotGetRemovedIfPagePairIsNotEmpty() {
Workspace workspace = mLauncher.getWorkspace();
@@ -256,8 +250,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testEmptyPagesGetRemovedIfBothPagesAreEmpty() {
Workspace workspace = mLauncher.getWorkspace();
@@ -284,8 +277,7 @@ public class TwoPanelWorkspaceTest extends AbstractLauncherUiTest {
}
@Test
// TODO(b/197631877) Enable in portrait.
// @PortraitLandscape
@PortraitLandscape
public void testMiddleEmptyPagesGetRemoved() {
Workspace workspace = mLauncher.getWorkspace();
@@ -385,7 +385,8 @@ public final class Workspace extends Home {
// Since the destination can be on another page, we need to drag to the edge first
// until we reach the target page
while (targetDest.x > displayX || targetDest.x < 0) {
int edgeX = targetDest.x > 0 ? displayX : 0;
// TODO: b/219919285
int edgeX = targetDest.x > 0 ? displayX - 1 : 1;
Point screenEdge = new Point(edgeX, targetDest.y);
Point finalDragStart = dragStart;
executeAndWaitForPageScroll(launcher,