diff options
Diffstat (limited to 'java/com/android')
9 files changed, 41 insertions, 26 deletions
diff --git a/java/com/android/dialer/assisteddialing/TransformationInfo.java b/java/com/android/dialer/assisteddialing/TransformationInfo.java index 03e565c51..de8f27d01 100644 --- a/java/com/android/dialer/assisteddialing/TransformationInfo.java +++ b/java/com/android/dialer/assisteddialing/TransformationInfo.java @@ -57,19 +57,20 @@ public abstract class TransformationInfo { return new AutoValue_TransformationInfo.Builder(); } + /** A builder for TransformationInfo. */ @AutoValue.Builder - abstract static class Builder { - abstract Builder setOriginalNumber(String value); + public abstract static class Builder { + public abstract Builder setOriginalNumber(String value); - abstract Builder setTransformedNumber(String value); + public abstract Builder setTransformedNumber(String value); - abstract Builder setUserHomeCountryCode(String value); + public abstract Builder setUserHomeCountryCode(String value); - abstract Builder setUserRoamingCountryCode(String value); + public abstract Builder setUserRoamingCountryCode(String value); - abstract Builder setTransformedNumberCountryCallingCode(int value); + public abstract Builder setTransformedNumberCountryCallingCode(int value); - abstract TransformationInfo build(); + public abstract TransformationInfo build(); } public static TransformationInfo newInstanceFromBundle(@NonNull Bundle transformationInfoBundle) { diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index d49d556a6..c9fc4a72c 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -484,7 +484,8 @@ public class CallCardPresenter supports2ndCallOnHold(), getSwapToSecondaryButtonState(), mPrimary.isAssistedDialed(), - null)); + null, + mPrimary.getAssistedDialingExtras())); InCallActivity activity = (InCallActivity) (mInCallScreen.getInCallScreenFragment().getActivity()); diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 2511bb8ca..621ad21f8 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -42,6 +42,7 @@ import android.telecom.VideoProfile; import android.text.TextUtils; import com.android.contacts.common.compat.CallCompat; import com.android.contacts.common.compat.telecom.TelecomManagerCompat; +import com.android.dialer.assisteddialing.TransformationInfo; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentParser; import com.android.dialer.callintent.CallSpecificAppData; @@ -1036,6 +1037,14 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa return false; } + public TransformationInfo getAssistedDialingExtras() { + if (isAssistedDialed()) { + return TransformationInfo.newInstanceFromBundle( + getIntentExtras().getBundle(TelephonyManagerCompat.ASSISTED_DIALING_EXTRAS)); + } + return null; + } + public LatencyReport getLatencyReport() { return mLatencyReport; } diff --git a/java/com/android/incallui/contactgrid/BottomRow.java b/java/com/android/incallui/contactgrid/BottomRow.java index 91f08ef3e..a0d118552 100644 --- a/java/com/android/incallui/contactgrid/BottomRow.java +++ b/java/com/android/incallui/contactgrid/BottomRow.java @@ -49,7 +49,6 @@ public class BottomRow { public final boolean isForwardIconVisible; public final boolean isSpamIconVisible; public final boolean shouldPopulateAccessibilityEvent; - public final boolean isAssistedDialedVisisble; public Info( @Nullable CharSequence label, @@ -59,8 +58,7 @@ public class BottomRow { boolean isHdIconVisible, boolean isForwardIconVisible, boolean isSpamIconVisible, - boolean shouldPopulateAccessibilityEvent, - boolean isAssistedDialedVisisble) { + boolean shouldPopulateAccessibilityEvent) { this.label = label; this.isTimerVisible = isTimerVisible; this.isWorkIconVisible = isWorkIconVisible; @@ -69,7 +67,6 @@ public class BottomRow { this.isForwardIconVisible = isForwardIconVisible; this.isSpamIconVisible = isSpamIconVisible; this.shouldPopulateAccessibilityEvent = shouldPopulateAccessibilityEvent; - this.isAssistedDialedVisisble = isAssistedDialedVisisble; } } @@ -84,7 +81,6 @@ public class BottomRow { boolean isHdAttemptingIconVisible = state.isHdAttempting; boolean isSpamIconVisible = false; boolean shouldPopulateAccessibilityEvent = true; - boolean isAssistedDialedVisisble = state.isAssistedDialed; if (isIncoming(state) && primaryInfo.isSpam) { label = context.getString(R.string.contact_grid_incoming_suspected_spam); @@ -118,8 +114,7 @@ public class BottomRow { isHdIconVisible, isForwardIconVisible, isSpamIconVisible, - shouldPopulateAccessibilityEvent, - isAssistedDialedVisisble); + shouldPopulateAccessibilityEvent); } private static CharSequence getLabelForPhoneNumber(PrimaryInfo primaryInfo) { diff --git a/java/com/android/incallui/contactgrid/ContactGridManager.java b/java/com/android/incallui/contactgrid/ContactGridManager.java index c0ab9609f..8deee8263 100644 --- a/java/com/android/incallui/contactgrid/ContactGridManager.java +++ b/java/com/android/incallui/contactgrid/ContactGridManager.java @@ -61,7 +61,7 @@ public class ContactGridManager { @Nullable private ImageView avatarImageView; // Row 2: Mobile +1 (650) 253-0000 - // Row 2: [HD attempting icon]/[HD icon] [Assisted Dialing Icon] 00:15 + // Row 2: [HD attempting icon]/[HD icon] 00:15 // Row 2: Call ended // Row 2: Hanging up // Row 2: [Alert sign] Suspected spam caller @@ -69,7 +69,6 @@ public class ContactGridManager { private final ImageView workIconImageView; private final ImageView hdIconImageView; private final ImageView forwardIconImageView; - private final ImageView assistedDialingImageView; private final TextView forwardedNumberView; private final ImageView spamIconImageView; private final ViewAnimator bottomTextSwitcher; @@ -101,7 +100,6 @@ public class ContactGridManager { hdIconImageView = view.findViewById(R.id.contactgrid_hdIcon); forwardIconImageView = view.findViewById(R.id.contactgrid_forwardIcon); forwardedNumberView = view.findViewById(R.id.contactgrid_forwardNumber); - assistedDialingImageView = view.findViewById(R.id.contactgrid_assistedDialingIcon); spamIconImageView = view.findViewById(R.id.contactgrid_spamIcon); bottomTextSwitcher = view.findViewById(R.id.contactgrid_bottom_text_switcher); bottomTextView = view.findViewById(R.id.contactgrid_bottom_text); @@ -321,8 +319,6 @@ public class ContactGridManager { bottomTextView.setText(info.label); bottomTextView.setAllCaps(info.isSpamIconVisible); workIconImageView.setVisibility(info.isWorkIconVisible ? View.VISIBLE : View.GONE); - assistedDialingImageView.setVisibility( - info.isAssistedDialedVisisble ? View.VISIBLE : View.GONE); if (hdIconImageView.getVisibility() == View.GONE) { if (info.isHdAttemptingIconVisible) { hdIconImageView.setImageResource(R.drawable.asd_hd_icon); diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java index 3593c991d..cfa7e1b86 100644 --- a/java/com/android/incallui/contactgrid/TopRow.java +++ b/java/com/android/incallui/contactgrid/TopRow.java @@ -173,6 +173,15 @@ public class TopRow { return context.getString(R.string.incall_video_call_requesting); } } + + if (state.isAssistedDialed) { + String countryCode = + String.valueOf(state.assistedDialingExtras.transformedNumberCountryCallingCode()); + return context.getString( + R.string.incall_connecting_assited_dialed, + countryCode, + state.assistedDialingExtras.userHomeCountryCode()); + } return context.getString(R.string.incall_connecting); } } diff --git a/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_bottom_row.xml b/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_bottom_row.xml index c545c25cd..ce355ea2d 100644 --- a/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_bottom_row.xml +++ b/java/com/android/incallui/contactgrid/res/layout/incall_contactgrid_bottom_row.xml @@ -31,10 +31,6 @@ style="@style/BottomRowIcon" android:visibility="gone"/> <ImageView - android:id="@+id/contactgrid_assistedDialingIcon" - style="@style/BottomRowIcon" - android:src="@drawable/quantum_ic_language_vd_theme_24"/> - <ImageView android:id="@id/contactgrid_forwardIcon" style="@style/BottomRowIcon" android:src="@drawable/quantum_ic_forward_vd_theme_24"/> diff --git a/java/com/android/incallui/contactgrid/res/values/strings.xml b/java/com/android/incallui/contactgrid/res/values/strings.xml index eba4abf30..c6bdb11ba 100644 --- a/java/com/android/incallui/contactgrid/res/values/strings.xml +++ b/java/com/android/incallui/contactgrid/res/values/strings.xml @@ -24,6 +24,9 @@ in the connecting stage. --> <string name="incall_connecting">Calling…</string> + <!-- Display information related to assisted dialing, for example Calling using +1 (US)… --> + <string name="incall_connecting_assited_dialed">Calling using +<xliff:g example="1" id="ad_country_code">%1$s</xliff:g> (<xliff:g example="1" id="ad_user_home_locale">%2$s</xliff:g>)\u2026</string> + <!-- Displayed above the contact name when an external call is being pulled to the local device. --> <string name="incall_transferring">Transferring…</string> diff --git a/java/com/android/incallui/incall/protocol/PrimaryCallState.java b/java/com/android/incallui/incall/protocol/PrimaryCallState.java index fe80276c9..4a50fbeaf 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryCallState.java +++ b/java/com/android/incallui/incall/protocol/PrimaryCallState.java @@ -21,6 +21,7 @@ import android.support.annotation.IntDef; import android.support.annotation.Nullable; import android.telecom.DisconnectCause; import android.text.TextUtils; +import com.android.dialer.assisteddialing.TransformationInfo; import com.android.dialer.common.Assert; import com.android.incallui.call.DialerCall; import com.android.incallui.call.DialerCall.State; @@ -68,6 +69,7 @@ public class PrimaryCallState { public final @ButtonState int swapToSecondaryButtonState; public final boolean isAssistedDialed; @Nullable public final String customLabel; + @Nullable public final TransformationInfo assistedDialingExtras; // TODO: Convert to autovalue. b/34502119 public static PrimaryCallState createEmptyPrimaryCallState() { @@ -100,7 +102,8 @@ public class PrimaryCallState { true /* supportsCallOnHold */, ButtonState.NOT_SUPPORT /* swapToSecondaryButtonState */, false /* isAssistedDialed */, - customLabel); + customLabel, + null /* assistedDialingExtras */); } public PrimaryCallState( @@ -127,7 +130,8 @@ public class PrimaryCallState { boolean supportsCallOnHold, @ButtonState int swapToSecondaryButtonState, boolean isAssistedDialed, - @Nullable String customLabel) { + @Nullable String customLabel, + @Nullable TransformationInfo assistedDialingExtras) { this.state = state; this.isVideoCall = isVideoCall; this.sessionModificationState = sessionModificationState; @@ -155,6 +159,7 @@ public class PrimaryCallState { Assert.checkArgument(state == State.CALL_PENDING); } this.customLabel = customLabel; + this.assistedDialingExtras = assistedDialingExtras; } @Override |