diff --git a/core/res/res/layout/keyguard_multi_user_selector.xml b/core/res/res/layout/keyguard_multi_user_selector.xml index c599fd5ddbfc6..5a6e9989c1400 100644 --- a/core/res/res/layout/keyguard_multi_user_selector.xml +++ b/core/res/res/layout/keyguard_multi_user_selector.xml @@ -21,7 +21,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center"> + android:layout_gravity="center" + android:contentDescription="@string/keyguard_accessibility_user_selector"> + android:gravity="center_horizontal" + android:contentDescription="@string/keyguard_accessibility_status"> + android:foreground="@drawable/ic_lockscreen_player_background" + android:contentDescription="@string/keygaurd_accessibility_media_controls"> Pattern completed + + %1$s. Widget %2$d of %3$d. + + User selector + + Status + + Media controls + \?123 diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index c081c57ef272b..8ac0ad5ea6522 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -549,6 +549,10 @@ + + + + diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java index 4af7a2588a118..a1603dcda961a 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetPager.java @@ -27,6 +27,8 @@ import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; +import com.android.internal.R; + public class KeyguardWidgetPager extends PagedView { ZInterpolator mZInterpolator = new ZInterpolator(0.5f); private static float CAMERA_DISTANCE = 10000; @@ -47,6 +49,9 @@ public class KeyguardWidgetPager extends PagedView { public KeyguardWidgetPager(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); + if (getImportantForAccessibility() == View.IMPORTANT_FOR_ACCESSIBILITY_AUTO) { + setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); + } } /* @@ -60,6 +65,7 @@ public class KeyguardWidgetPager extends PagedView { // The framework adds a default padding to AppWidgetHostView. We don't need this padding // for the Keyguard, so we override it to be 0. widget.setPadding(0, 0, 0, 0); + widget.setContentDescription(widget.getAppWidgetInfo().label); frame.addView(widget, lp); addView(frame); } @@ -89,6 +95,21 @@ public class KeyguardWidgetPager extends PagedView { } } + @Override + public String getCurrentPageDescription() { + final int nextPageIndex = getNextPage(); + if (nextPageIndex >= 0 && nextPageIndex < getChildCount()) { + KeyguardWidgetFrame frame = (KeyguardWidgetFrame) getChildAt(nextPageIndex); + CharSequence title = frame.getChildAt(0).getContentDescription(); + if (title == null) { + title = ""; + } + return mContext.getString(R.string.keyguard_accessibility_widget_changed, + title, nextPageIndex + 1, getChildCount()); + } + return super.getCurrentPageDescription(); + } + @Override protected void overScroll(float amount) { acceleratedOverScroll(amount);