Show split screen action for each task

Remove previous condition:
1. `taskView.containsMultipleTasks()` - there is already a check to filter out "Split screen" item: https://googleplex-android.googlesource.com/platform/packages/apps/Launcher3/+/refs/heads/main/quickstep/src/com/android/quickstep/TaskOverlayFactory.java#68

Edit previous condition:
2. `notEnoughTasksToSplit` - condition saying if there is less than 2 recent tasks. We still should give the possibility to split the screen if Taskbar is not presented

Bug: 305958994
Flag: NONE
Test: manual - took a photo (https://screenshot.googleplex.com/7doU5z9AjxxETUo)

Change-Id: I3fdfea987c426d557a91b0a25af368069e8af3f8
This commit is contained in:
Sergey Pinkevich
2023-11-08 15:59:09 +00:00
parent 0ddc984353
commit ead5259f9a
3 changed files with 78 additions and 31 deletions

View File

@@ -29,6 +29,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.launcher3.tapl.Overview;
import com.android.launcher3.tapl.Taskbar;
import com.android.launcher3.tapl.TaskbarAppIcon;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.TestStabilityRule;
@@ -139,6 +142,31 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest {
.hasMenuItem("Save app pair"));
}
@Test
public void testSplitSingleTaskFromTaskbar() {
// Currently only tablets have Taskbar in Overview, so test is only active on tablets
assumeTrue(mLauncher.isTablet());
if (!mLauncher.getRecentTasks().isEmpty()) {
// Clear all recent tasks
mLauncher.goHome().switchToOverview().dismissAllTasks();
}
startAppFast(getAppPackageName());
Overview overview = mLauncher.goHome().switchToOverview();
if (mLauncher.isGridOnlyOverviewEnabled()) {
overview.getCurrentTask().tapMenu().tapSplitMenuItem();
} else {
overview.getOverviewActions().clickSplit();
}
Taskbar taskbar = overview.getTaskbar();
String firstAppName = taskbar.getIconNames().get(0);
TaskbarAppIcon firstApp = taskbar.getAppIcon(firstAppName);
firstApp.launchIntoSplitScreen();
}
private void createAndLaunchASplitPair() {
startTestActivity(2);
startTestActivity(3);