From 169c4e88cd203d80756ea8108c5a1daf59279cc5 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Fri, 13 Aug 2021 21:55:29 +0000 Subject: [PATCH 1/2] Revert "Not using shell command to enable test provider" This reverts commit 5f80e92bda9f658e149d38a4e6ee4db270677784. Reason for revert: We need to see if this has caused b/196586808 Bug: 196586808 Test: presubmit Change-Id: I078f0d4e83f5f1db19e9e0a5afec4f3058156745 --- .../launcher3/tapl/LauncherInstrumentation.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 065af003ab..8b9ae6964c 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -66,6 +66,7 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.ResourceUtils; import com.android.launcher3.testing.TestProtocol; +import com.android.systemui.shared.system.ContextUtils; import com.android.systemui.shared.system.QuickStepContract; import org.junit.Assert; @@ -245,12 +246,16 @@ public final class LauncherInstrumentation { ComponentName cn = new ComponentName(pi.packageName, pi.name); if (pm.getComponentEnabledSetting(cn) != COMPONENT_ENABLED_STATE_ENABLED) { - mInstrumentation.getUiAutomation().adoptShellPermissionIdentity( - android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE); - try { + if (TestHelpers.isInLauncherProcess()) { pm.setComponentEnabledSetting(cn, COMPONENT_ENABLED_STATE_ENABLED, DONT_KILL_APP); - } finally { - mInstrumentation.getUiAutomation().dropShellPermissionIdentity(); + } else { + try { + final int userId = ContextUtils.getUserId(getContext()); + mDevice.executeShellCommand( + "pm enable --user " + userId + " " + cn.flattenToString()); + } catch (IOException e) { + fail(e.toString()); + } } } } @@ -300,7 +305,7 @@ public final class LauncherInstrumentation { public boolean isTwoPanels() { return getTestInfo(TestProtocol.REQUEST_IS_TWO_PANELS) - .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); + .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD); } private void setForcePauseTimeout(long timeout) { From b259a896f5e4280fce236061d6f12a28b9ba6355 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Fri, 13 Aug 2021 15:57:41 -0700 Subject: [PATCH 2/2] Constrain scroll amount Test: scroll vertically and horizontally Fixes: 196309367 Change-Id: Ibf16fb72cf95e29ed820d5f511e764a388c93bb0 --- .../com/android/launcher3/statehandlers/DepthController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 85daefff40..5777fb9a7f 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -274,7 +274,7 @@ public class DepthController implements StateHandler, public void onOverlayScrollChanged(float progress) { // Round out the progress to dedupe frequent, non-perceptable updates int progressI = (int) (progress * 256); - float progressF = progressI / 256f; + float progressF = Utilities.boundToRange(progressI / 256f, 0f, 1f); if (Float.compare(mOverlayScrollProgress, progressF) == 0) { return; }