Merge "[Predictive Back] Turn on feature for udc" into udc-dev am: 0785970ae6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21618259 Change-Id: I479587d3952a45888c366f5c9ca4e566a3257b1d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -559,6 +559,9 @@ public class QuickstepLauncher extends Launcher {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
if (Utilities.ATLEAST_U && FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get()) {
|
||||||
|
getApplicationInfo().setEnableOnBackInvokedCallback(true);
|
||||||
|
}
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
mPendingSplitSelectInfo = ObjectWrapper.unwrap(
|
mPendingSplitSelectInfo = ObjectWrapper.unwrap(
|
||||||
savedInstanceState.getIBinder(PENDING_SPLIT_SELECT_INFO));
|
savedInstanceState.getIBinder(PENDING_SPLIT_SELECT_INFO));
|
||||||
|
|||||||
@@ -27,12 +27,14 @@ import static org.junit.Assume.assumeTrue;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
import androidx.test.uiautomator.By;
|
import androidx.test.uiautomator.By;
|
||||||
import androidx.test.uiautomator.Until;
|
import androidx.test.uiautomator.Until;
|
||||||
|
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
|
import com.android.launcher3.config.FeatureFlags;
|
||||||
import com.android.launcher3.tapl.LaunchedAppState;
|
import com.android.launcher3.tapl.LaunchedAppState;
|
||||||
import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel;
|
import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel;
|
||||||
import com.android.launcher3.tapl.Overview;
|
import com.android.launcher3.tapl.Overview;
|
||||||
@@ -57,6 +59,8 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
|||||||
private static final String APP_NAME = "LauncherTestApp";
|
private static final String APP_NAME = "LauncherTestApp";
|
||||||
private static final String CALCULATOR_APP_PACKAGE =
|
private static final String CALCULATOR_APP_PACKAGE =
|
||||||
resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR);
|
resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR);
|
||||||
|
private static final String READ_DEVICE_CONFIG_PERMISSION =
|
||||||
|
"android.permission.READ_DEVICE_CONFIG";
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
@@ -370,6 +374,9 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
|
|||||||
@PortraitLandscape
|
@PortraitLandscape
|
||||||
@NavigationModeSwitch
|
@NavigationModeSwitch
|
||||||
public void testPressBack() throws Exception {
|
public void testPressBack() throws Exception {
|
||||||
|
InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity(
|
||||||
|
READ_DEVICE_CONFIG_PERMISSION);
|
||||||
|
assumeFalse(FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get());
|
||||||
mLauncher.getWorkspace().switchToAllApps();
|
mLauncher.getWorkspace().switchToAllApps();
|
||||||
mLauncher.pressBack();
|
mLauncher.pressBack();
|
||||||
mLauncher.getWorkspace();
|
mLauncher.getWorkspace();
|
||||||
|
|||||||
@@ -204,6 +204,10 @@ public final class FeatureFlags {
|
|||||||
"ENABLE_BACK_SWIPE_HOME_ANIMATION", true,
|
"ENABLE_BACK_SWIPE_HOME_ANIMATION", true,
|
||||||
"Enables home animation to icon when user swipes back.");
|
"Enables home animation to icon when user swipes back.");
|
||||||
|
|
||||||
|
public static final BooleanFlag ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION = getDebugFlag(270614790,
|
||||||
|
"ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION", false,
|
||||||
|
"Enables predictive back aniamtion from all apps and widgets to home");
|
||||||
|
|
||||||
public static final BooleanFlag ENABLE_ICON_LABEL_AUTO_SCALING = getDebugFlag(270393294,
|
public static final BooleanFlag ENABLE_ICON_LABEL_AUTO_SCALING = getDebugFlag(270393294,
|
||||||
"ENABLE_ICON_LABEL_AUTO_SCALING", true,
|
"ENABLE_ICON_LABEL_AUTO_SCALING", true,
|
||||||
"Enables scaling/spacing for icon labels to make more characters visible");
|
"Enables scaling/spacing for icon labels to make more characters visible");
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertFalse;
|
|||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assume.assumeFalse;
|
||||||
import static org.junit.Assume.assumeTrue;
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -33,10 +34,12 @@ import android.platform.test.annotations.IwTest;
|
|||||||
|
|
||||||
import androidx.test.filters.FlakyTest;
|
import androidx.test.filters.FlakyTest;
|
||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.launcher3.Launcher;
|
import com.android.launcher3.Launcher;
|
||||||
import com.android.launcher3.LauncherState;
|
import com.android.launcher3.LauncherState;
|
||||||
|
import com.android.launcher3.config.FeatureFlags;
|
||||||
import com.android.launcher3.popup.ArrowPopup;
|
import com.android.launcher3.popup.ArrowPopup;
|
||||||
import com.android.launcher3.tapl.AllApps;
|
import com.android.launcher3.tapl.AllApps;
|
||||||
import com.android.launcher3.tapl.AppIcon;
|
import com.android.launcher3.tapl.AppIcon;
|
||||||
@@ -73,6 +76,8 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
|||||||
private static final String MAPS_APP_NAME = "Maps";
|
private static final String MAPS_APP_NAME = "Maps";
|
||||||
private static final String STORE_APP_NAME = "Play Store";
|
private static final String STORE_APP_NAME = "Play Store";
|
||||||
private static final String GMAIL_APP_NAME = "Gmail";
|
private static final String GMAIL_APP_NAME = "Gmail";
|
||||||
|
private static final String READ_DEVICE_CONFIG_PERMISSION =
|
||||||
|
"android.permission.READ_DEVICE_CONFIG";
|
||||||
|
|
||||||
@Rule
|
@Rule
|
||||||
public TISBindRule mTISBindRule = new TISBindRule();
|
public TISBindRule mTISBindRule = new TISBindRule();
|
||||||
@@ -440,11 +445,13 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
|
|||||||
@Test
|
@Test
|
||||||
@PortraitLandscape
|
@PortraitLandscape
|
||||||
public void testPressBack() throws Exception {
|
public void testPressBack() throws Exception {
|
||||||
|
InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity(
|
||||||
|
READ_DEVICE_CONFIG_PERMISSION);
|
||||||
|
assumeFalse(FeatureFlags.ENABLE_BACK_SWIPE_LAUNCHER_ANIMATION.get());
|
||||||
mLauncher.getWorkspace().switchToAllApps();
|
mLauncher.getWorkspace().switchToAllApps();
|
||||||
mLauncher.pressBack();
|
mLauncher.pressBack();
|
||||||
mLauncher.getWorkspace();
|
mLauncher.getWorkspace();
|
||||||
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
|
waitForState("Launcher internal state didn't switch to Home", () -> LauncherState.NORMAL);
|
||||||
|
|
||||||
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
|
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
|
||||||
mLauncher.pressBack();
|
mLauncher.pressBack();
|
||||||
mLauncher.getWorkspace();
|
mLauncher.getWorkspace();
|
||||||
|
|||||||
Reference in New Issue
Block a user