Loading quickstep/src/com/android/quickstep/ActivityControlHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListener; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.TestProtocol; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimationSuccessListener; Loading Loading @@ -233,7 +234,8 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { // Optimization, hide the all apps view to prevent layout while initializing activity.getAppsView().getContentView().setVisibility(View.GONE); AccessibilityManagerCompat.sendEventToTest(activity, "TAPL_WENT_TO_STATE"); AccessibilityManagerCompat.sendEventToTest( activity, TestProtocol.SWITCHED_TO_STATE_MESSAGE); } return new AnimationFactory() { Loading src/com/android/launcher3/TestProtocol.java 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3; /** * Protocol for custom accessibility events for communication with UI Automation tests. */ public final class TestProtocol { public static final String GET_SCROLL_MESSAGE = "TAPL_GET_SCROLL"; public static final String SCROLL_Y_FIELD = "scrollY"; public static final String SWITCHED_TO_STATE_MESSAGE = "TAPL_SWITCHED_TO_STATE"; public static final String RESPONSE_MESSAGE_POSTFIX = "_RESPONSE"; } src/com/android/launcher3/allapps/AllAppsContainerView.java +4 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; Loading Loading @@ -576,9 +577,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo @Override public boolean performAccessibilityAction(int action, Bundle arguments) { if (AccessibilityManagerCompat.processTestRequest( mLauncher, "TAPL_GET_SCROLL", action, arguments, mLauncher, TestProtocol.GET_SCROLL_MESSAGE, action, arguments, response -> response.putInt("scrollY", getActiveRecyclerView().getCurrentScrollY()))) { response.putInt(TestProtocol.SCROLL_Y_FIELD, getActiveRecyclerView().getCurrentScrollY()))) { return true; } Loading src/com/android/launcher3/compat/AccessibilityManagerCompat.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; public class AccessibilityManagerCompat { Loading Loading @@ -95,7 +96,7 @@ public class AccessibilityManagerCompat { final Bundle response = new Bundle(); responseFiller.accept(response); AccessibilityManagerCompat.sendEventToTest( accessibilityManager, eventTag + "_RESPONSE", response); accessibilityManager, eventTag + TestProtocol.RESPONSE_MESSAGE_POSTFIX, response); return true; } return false; Loading src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +3 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager.AnimationComponents; import com.android.launcher3.LauncherStateManager.AnimationConfig; import com.android.launcher3.LauncherStateManager.StateHandler; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; Loading Loading @@ -517,7 +518,8 @@ public abstract class AbstractStateChangeTouchController } mLauncher.getStateManager().goToState(targetState, false /* animated */); AccessibilityManagerCompat.sendEventToTest(mLauncher, "TAPL_WENT_TO_STATE"); AccessibilityManagerCompat.sendEventToTest( mLauncher, TestProtocol.SWITCHED_TO_STATE_MESSAGE); } } Loading Loading
quickstep/src/com/android/quickstep/ActivityControlHelper.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListener; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.TestProtocol; import com.android.launcher3.allapps.AllAppsTransitionController; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.anim.AnimationSuccessListener; Loading Loading @@ -233,7 +234,8 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { // Optimization, hide the all apps view to prevent layout while initializing activity.getAppsView().getContentView().setVisibility(View.GONE); AccessibilityManagerCompat.sendEventToTest(activity, "TAPL_WENT_TO_STATE"); AccessibilityManagerCompat.sendEventToTest( activity, TestProtocol.SWITCHED_TO_STATE_MESSAGE); } return new AnimationFactory() { Loading
src/com/android/launcher3/TestProtocol.java 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3; /** * Protocol for custom accessibility events for communication with UI Automation tests. */ public final class TestProtocol { public static final String GET_SCROLL_MESSAGE = "TAPL_GET_SCROLL"; public static final String SCROLL_Y_FIELD = "scrollY"; public static final String SWITCHED_TO_STATE_MESSAGE = "TAPL_SWITCHED_TO_STATE"; public static final String RESPONSE_MESSAGE_POSTFIX = "_RESPONSE"; }
src/com/android/launcher3/allapps/AllAppsContainerView.java +4 −2 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import com.android.launcher3.InsettableFrameLayout; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; Loading Loading @@ -576,9 +577,10 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo @Override public boolean performAccessibilityAction(int action, Bundle arguments) { if (AccessibilityManagerCompat.processTestRequest( mLauncher, "TAPL_GET_SCROLL", action, arguments, mLauncher, TestProtocol.GET_SCROLL_MESSAGE, action, arguments, response -> response.putInt("scrollY", getActiveRecyclerView().getCurrentScrollY()))) { response.putInt(TestProtocol.SCROLL_Y_FIELD, getActiveRecyclerView().getCurrentScrollY()))) { return true; } Loading
src/com/android/launcher3/compat/AccessibilityManagerCompat.java +2 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; public class AccessibilityManagerCompat { Loading Loading @@ -95,7 +96,7 @@ public class AccessibilityManagerCompat { final Bundle response = new Bundle(); responseFiller.accept(response); AccessibilityManagerCompat.sendEventToTest( accessibilityManager, eventTag + "_RESPONSE", response); accessibilityManager, eventTag + TestProtocol.RESPONSE_MESSAGE_POSTFIX, response); return true; } return false; Loading
src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +3 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager.AnimationComponents; import com.android.launcher3.LauncherStateManager.AnimationConfig; import com.android.launcher3.LauncherStateManager.StateHandler; import com.android.launcher3.TestProtocol; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; Loading Loading @@ -517,7 +518,8 @@ public abstract class AbstractStateChangeTouchController } mLauncher.getStateManager().goToState(targetState, false /* animated */); AccessibilityManagerCompat.sendEventToTest(mLauncher, "TAPL_WENT_TO_STATE"); AccessibilityManagerCompat.sendEventToTest( mLauncher, TestProtocol.SWITCHED_TO_STATE_MESSAGE); } } Loading