Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d552c8b authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Disabling accessibility focus on all children when shortcuts is open

Bug: 30611791
Change-Id: Ibb1dec13b62add3799c215fea98e87e3fa89638d
parent e6fe1b59
Loading
Loading
Loading
Loading
+21 −11
Original line number Original line Diff line number Diff line
@@ -374,21 +374,31 @@ public class DragLayer extends InsettableFrameLayout {


    @Override
    @Override
    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
    public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) {
        Folder currentFolder = mLauncher.getWorkspace().getOpenFolder();
        // Shortcuts can appear above folder
        if (currentFolder != null) {
        View topView = mLauncher.getOpenShortcutsContainer();
            if (child == currentFolder) {
        if (topView != null) {
            return handleTopViewSendAccessibilityEvent(topView, child, event);
        }

        topView = mLauncher.getWorkspace().getOpenFolder();
        if (topView != null) {
            return handleTopViewSendAccessibilityEvent(topView, child, event);
        }
        return super.onRequestSendAccessibilityEvent(child, event);
        return super.onRequestSendAccessibilityEvent(child, event);
    }
    }


    private boolean handleTopViewSendAccessibilityEvent(
            View topView, View child, AccessibilityEvent event) {
        if (child == topView) {
            return super.onRequestSendAccessibilityEvent(child, event);
        }
        if (isInAccessibleDrag() && child instanceof DropTargetBar) {
        if (isInAccessibleDrag() && child instanceof DropTargetBar) {
            return super.onRequestSendAccessibilityEvent(child, event);
            return super.onRequestSendAccessibilityEvent(child, event);
        }
        }
            // Skip propagating onRequestSendAccessibilityEvent all for other children
        // Skip propagating onRequestSendAccessibilityEvent for all other children
            // when a folder is open
        // which are not topView
        return false;
        return false;
    }
    }
        return super.onRequestSendAccessibilityEvent(child, event);
    }


    @Override
    @Override
    public void addChildrenForAccessibility(ArrayList<View> childrenForAccessibility) {
    public void addChildrenForAccessibility(ArrayList<View> childrenForAccessibility) {