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
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user