diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-05-31 14:33:09 -0700 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2018-08-03 10:29:36 -0700 |
commit | 7acde489553d3edb213908dcce93e465a07e9032 (patch) | |
tree | 7d60056419d9137d1a5b49506882ab9d35f1b333 /src | |
parent | e98aab058ed566fe94530d3e3bd118ec00bc52e4 (diff) | |
download | android_packages_apps_Trebuchet-7acde489553d3edb213908dcce93e465a07e9032.tar.gz android_packages_apps_Trebuchet-7acde489553d3edb213908dcce93e465a07e9032.tar.bz2 android_packages_apps_Trebuchet-7acde489553d3edb213908dcce93e465a07e9032.zip |
Enabling more checks in TAPL tests.
Hiding workspace from tests when in AllApps or Overview.
Also, we don’t need workspace_page_container.
Bug: 110103162
Test: Running TaplTests suite
Change-Id: I10875a1ce5d41a015c63034160676578f52d2e98
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index a9979a218..5cca2fb6f 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -54,6 +54,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.Toast; import com.android.launcher3.Launcher.LauncherOverlay; @@ -549,7 +550,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // created CellLayout. CellLayout newScreen = (CellLayout) LayoutInflater.from(getContext()).inflate( R.layout.workspace_screen, this, false /* attachToRoot */); - newScreen.getShortcutsAndWidgets().setId(R.id.workspace_page_container); int paddingLeftRight = mLauncher.getDeviceProfile().cellLayoutPaddingLeftRightPx; int paddingBottom = mLauncher.getDeviceProfile().cellLayoutBottomPaddingPx; newScreen.setPadding(paddingLeftRight, 0, paddingLeftRight, paddingBottom); @@ -1495,6 +1495,18 @@ public class Workspace extends PagedView<WorkspacePageIndicator> } } + @Override + public AccessibilityNodeInfo createAccessibilityNodeInfo() { + if (getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS) { + // TAPL tests verify that workspace is not present in Overview and AllApps states. + // TAPL can work only if UIDevice is set up as setCompressedLayoutHeirarchy(false). + // Hiding workspace from the tests when it's + // IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS. + return null; + } + return super.createAccessibilityNodeInfo(); + } + private void updateAccessibilityFlags(int accessibilityFlag, CellLayout page) { page.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); page.getShortcutsAndWidgets().setImportantForAccessibility(accessibilityFlag); |