Loading core/java/android/view/accessibility/AccessibilityEvent.java +4 −1 Original line number Diff line number Diff line Loading @@ -605,7 +605,10 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: * state description of the node as returned by * {@link AccessibilityNodeInfo#getStateDescription} changed. * {@link AccessibilityNodeInfo#getStateDescription} changed. If part of the state description * changes, the changed part can be put into event text. For example, if state description * changed from "on, wifi signal full" to "on, wifi three bars", "wifi three bars" can be put * into the event text. */ public static final int CONTENT_CHANGE_TYPE_STATE_DESCRIPTION = 0x00000040; Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java +17 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ */ package com.android.systemui.qs.tileimpl; import static android.view.accessibility.AccessibilityEvent.CONTENT_CHANGE_TYPE_STATE_DESCRIPTION; import static com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH; import android.animation.ValueAnimator; Loading Loading @@ -73,6 +75,10 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { private int mCircleColor; private int mBgSize; private static final int INVALID = -1; private CharSequence mStateDescriptionDeltas = null; private CharSequence mLastStateDescription; private int mLastState = INVALID; public QSTileBaseView(Context context, QSIconView icon) { this(context, icon, false); Loading Loading @@ -250,8 +256,14 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { if (!TextUtils.isEmpty(state.stateDescription)) { stateDescription.append(", "); stateDescription.append(state.stateDescription); if (mLastState != INVALID && state.state == mLastState && !state.stateDescription.equals(mLastStateDescription)) { mStateDescriptionDeltas = state.stateDescription; } } setStateDescription(stateDescription.toString()); mLastState = state.state; mLastStateDescription = state.stateDescription; mAccessibilityClass = state.state == Tile.STATE_UNAVAILABLE ? null : state.expandedAccessibilityClassName; Loading Loading @@ -314,6 +326,11 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { if (!TextUtils.isEmpty(mAccessibilityClass)) { event.setClassName(mAccessibilityClass); } if (event.getContentChangeTypes() == CONTENT_CHANGE_TYPE_STATE_DESCRIPTION && mStateDescriptionDeltas != null) { event.getText().add(mStateDescriptionDeltas); mStateDescriptionDeltas = null; } } @Override Loading packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +2 −5 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { state.label = mContext.getString(R.string.quick_settings_bluetooth_label); state.secondaryLabel = TextUtils.emptyIfNull( getSecondaryLabel(enabled, connecting, connected, state.isTransient)); state.contentDescription = state.label; state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.stateDescription = ""; if (enabled) { if (connected) { Loading @@ -148,15 +149,11 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { } else { state.icon = ResourceIcon.get(com.android.internal.R.drawable.ic_qs_bluetooth); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.stateDescription = mContext.getString(R.string.accessibility_not_connected); } state.state = Tile.STATE_ACTIVE; } else { state.icon = ResourceIcon.get(com.android.internal.R.drawable.ic_qs_bluetooth); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.state = Tile.STATE_INACTIVE; } Loading Loading
core/java/android/view/accessibility/AccessibilityEvent.java +4 −1 Original line number Diff line number Diff line Loading @@ -605,7 +605,10 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par /** * Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event: * state description of the node as returned by * {@link AccessibilityNodeInfo#getStateDescription} changed. * {@link AccessibilityNodeInfo#getStateDescription} changed. If part of the state description * changes, the changed part can be put into event text. For example, if state description * changed from "on, wifi signal full" to "on, wifi three bars", "wifi three bars" can be put * into the event text. */ public static final int CONTENT_CHANGE_TYPE_STATE_DESCRIPTION = 0x00000040; Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java +17 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,8 @@ */ package com.android.systemui.qs.tileimpl; import static android.view.accessibility.AccessibilityEvent.CONTENT_CHANGE_TYPE_STATE_DESCRIPTION; import static com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH; import android.animation.ValueAnimator; Loading Loading @@ -73,6 +75,10 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { private int mCircleColor; private int mBgSize; private static final int INVALID = -1; private CharSequence mStateDescriptionDeltas = null; private CharSequence mLastStateDescription; private int mLastState = INVALID; public QSTileBaseView(Context context, QSIconView icon) { this(context, icon, false); Loading Loading @@ -250,8 +256,14 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { if (!TextUtils.isEmpty(state.stateDescription)) { stateDescription.append(", "); stateDescription.append(state.stateDescription); if (mLastState != INVALID && state.state == mLastState && !state.stateDescription.equals(mLastStateDescription)) { mStateDescriptionDeltas = state.stateDescription; } } setStateDescription(stateDescription.toString()); mLastState = state.state; mLastStateDescription = state.stateDescription; mAccessibilityClass = state.state == Tile.STATE_UNAVAILABLE ? null : state.expandedAccessibilityClassName; Loading Loading @@ -314,6 +326,11 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { if (!TextUtils.isEmpty(mAccessibilityClass)) { event.setClassName(mAccessibilityClass); } if (event.getContentChangeTypes() == CONTENT_CHANGE_TYPE_STATE_DESCRIPTION && mStateDescriptionDeltas != null) { event.getText().add(mStateDescriptionDeltas); mStateDescriptionDeltas = null; } } @Override Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +2 −5 Original line number Diff line number Diff line Loading @@ -130,7 +130,8 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { state.label = mContext.getString(R.string.quick_settings_bluetooth_label); state.secondaryLabel = TextUtils.emptyIfNull( getSecondaryLabel(enabled, connecting, connected, state.isTransient)); state.contentDescription = state.label; state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.stateDescription = ""; if (enabled) { if (connected) { Loading @@ -148,15 +149,11 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { } else { state.icon = ResourceIcon.get(com.android.internal.R.drawable.ic_qs_bluetooth); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.stateDescription = mContext.getString(R.string.accessibility_not_connected); } state.state = Tile.STATE_ACTIVE; } else { state.icon = ResourceIcon.get(com.android.internal.R.drawable.ic_qs_bluetooth); state.contentDescription = mContext.getString( R.string.accessibility_quick_settings_bluetooth); state.state = Tile.STATE_INACTIVE; } Loading