Loading InCallUI/src/com/android/incallui/CallCardFragment.java +13 −4 Original line number Diff line number Diff line Loading @@ -1124,10 +1124,19 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_ANNOUNCEMENT) { // Indicate this call is in active if no label is provided. The label is empty when // the call is in active, not in other status such as onhold or dialing etc. if (!mCallStateLabel.isShown() || TextUtils.isEmpty(mCallStateLabel.getText())) { event.getText().add( TextUtils.expandTemplate( getResources().getText(R.string.accessibility_call_is_active), mPrimaryName.getText())); } else { dispatchPopulateAccessibilityEvent(event, mCallStateLabel); dispatchPopulateAccessibilityEvent(event, mPrimaryName); dispatchPopulateAccessibilityEvent(event, mCallTypeLabel); dispatchPopulateAccessibilityEvent(event, mPhoneNumber); } return; } dispatchPopulateAccessibilityEvent(event, mCallStateLabel); Loading InCallUI/src/com/android/incallui/CallCardPresenter.java +7 −3 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getUi().setEndCallButtonEnabled(shouldShowEndCallButton(mPrimary, callState), callState != Call.State.INCOMING /* animate */); maybeSendAccessibilityEvent(oldState, newState); maybeSendAccessibilityEvent(oldState, newState, primaryChanged); } @Override Loading Loading @@ -1062,7 +1062,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return true; } private void maybeSendAccessibilityEvent(InCallState oldState, InCallState newState) { private void maybeSendAccessibilityEvent(InCallState oldState, InCallState newState, boolean primaryChanged) { if (mContext == null) { return; } Loading @@ -1071,8 +1072,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> if (!am.isEnabled()) { return; } // Announce the current call if it's new incoming/outgoing call or primary call is changed // due to switching calls between two ongoing calls (one is on hold). if ((oldState != InCallState.OUTGOING && newState == InCallState.OUTGOING) || (oldState != InCallState.INCOMING && newState == InCallState.INCOMING)) { || (oldState != InCallState.INCOMING && newState == InCallState.INCOMING) || primaryChanged) { if (getUi() != null) { getUi().sendAccessibilityAnnouncement(); } Loading res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1025,4 +1025,7 @@ <!-- Label under the name of a blocked number in the call log. [CHAR LIMIT=15] --> <string name="blocked_number_call_log_label">Blocked</string> <!-- Accessibility announcement to indicate which call is active --> <string name="accessibility_call_is_active"><xliff:g id="nameOrNumber">^1</xliff:g> is active</string> </resources> Loading
InCallUI/src/com/android/incallui/CallCardFragment.java +13 −4 Original line number Diff line number Diff line Loading @@ -1124,10 +1124,19 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr public void dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_ANNOUNCEMENT) { // Indicate this call is in active if no label is provided. The label is empty when // the call is in active, not in other status such as onhold or dialing etc. if (!mCallStateLabel.isShown() || TextUtils.isEmpty(mCallStateLabel.getText())) { event.getText().add( TextUtils.expandTemplate( getResources().getText(R.string.accessibility_call_is_active), mPrimaryName.getText())); } else { dispatchPopulateAccessibilityEvent(event, mCallStateLabel); dispatchPopulateAccessibilityEvent(event, mPrimaryName); dispatchPopulateAccessibilityEvent(event, mCallTypeLabel); dispatchPopulateAccessibilityEvent(event, mPhoneNumber); } return; } dispatchPopulateAccessibilityEvent(event, mCallStateLabel); Loading
InCallUI/src/com/android/incallui/CallCardPresenter.java +7 −3 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> getUi().setEndCallButtonEnabled(shouldShowEndCallButton(mPrimary, callState), callState != Call.State.INCOMING /* animate */); maybeSendAccessibilityEvent(oldState, newState); maybeSendAccessibilityEvent(oldState, newState, primaryChanged); } @Override Loading Loading @@ -1062,7 +1062,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return true; } private void maybeSendAccessibilityEvent(InCallState oldState, InCallState newState) { private void maybeSendAccessibilityEvent(InCallState oldState, InCallState newState, boolean primaryChanged) { if (mContext == null) { return; } Loading @@ -1071,8 +1072,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> if (!am.isEnabled()) { return; } // Announce the current call if it's new incoming/outgoing call or primary call is changed // due to switching calls between two ongoing calls (one is on hold). if ((oldState != InCallState.OUTGOING && newState == InCallState.OUTGOING) || (oldState != InCallState.INCOMING && newState == InCallState.INCOMING)) { || (oldState != InCallState.INCOMING && newState == InCallState.INCOMING) || primaryChanged) { if (getUi() != null) { getUi().sendAccessibilityAnnouncement(); } Loading
res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1025,4 +1025,7 @@ <!-- Label under the name of a blocked number in the call log. [CHAR LIMIT=15] --> <string name="blocked_number_call_log_label">Blocked</string> <!-- Accessibility announcement to indicate which call is active --> <string name="accessibility_call_is_active"><xliff:g id="nameOrNumber">^1</xliff:g> is active</string> </resources>