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

Commit fc9c4cd5 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Polish user selector accessibility.

1. The current user was not announced as such.

2. The event for a user switch was not sent.

Change-Id: Ib3caf1f9e93ea1f0b5450246601bc37f416be6da
parent febea58c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -167,6 +167,17 @@ public class AccessibilityRecord {
                mSourceNodeId, GET_SOURCE_PREFETCH_FLAGS);
    }

    /**
     * Sets the window id.
     *
     * @param windowId The window id.
     *
     * @hide
     */
    public void setWindowId(int windowId) {
        mSourceWindowId = windowId;
    }

    /**
     * Gets the id of the window from which the event comes from.
     *
+5 −0
Original line number Diff line number Diff line
@@ -150,6 +150,11 @@ class KeyguardMultiUserAvatar extends FrameLayout {
            if (active) {
                KeyguardLinearLayout parent = (KeyguardLinearLayout) getParent();
                parent.setTopChild(this);
                // TODO: Create an appropriate asset when string changes are possible.
                setContentDescription(mUserName.getText()
                        + ". " + mContext.getString(R.string.user_switched, ""));
            } else {
                setContentDescription(mUserName.getText());
            }
        }
        updateVisualsForActive(mActive, animate, SWITCH_ANIMATION_DURATION, onComplete);
+1 −0
Original line number Diff line number Diff line
@@ -1330,6 +1330,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                    AccessibilityEvent event = AccessibilityEvent.obtain(
                            AccessibilityEvent.TYPE_ANNOUNCEMENT);
                    event.getText().add(message);
                    event.setWindowId(mSecurityPolicy.getRetrievalAllowingWindowLocked());
                    sendAccessibilityEvent(event, mCurrentUserId);
                }
            }