diff options
author | calderwoodra <calderwoodra@google.com> | 2017-08-23 14:39:05 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 21:28:47 +0000 |
commit | 5e0e4bde936dd71990188ebd480cc34979b021c7 (patch) | |
tree | 64ab44c92fb49f4c92dd4e4bb6f917d91bd329e6 | |
parent | 3be5b2f9c2ae5d8a5c2fd6c3a0ec1800c278d3a5 (diff) |
Updated string in incallui to say "Uploading image..."
screenshot: http://screen/hYXLFqJ47Wg
video: https://drive.google.com/open?id=0B2Hce9qilHmvVmx1Ym54akRUUm8
Bug: 38189742
Test: manual
PiperOrigin-RevId: 166256573
Change-Id: Iebe0da82b18b5bbe51d7a6409b68b6243dd23db6
7 files changed, 38 insertions, 9 deletions
diff --git a/java/com/android/dialer/callcomposer/CallComposerActivity.java b/java/com/android/dialer/callcomposer/CallComposerActivity.java index d470ad2d9..d785cf352 100644 --- a/java/com/android/dialer/callcomposer/CallComposerActivity.java +++ b/java/com/android/dialer/callcomposer/CallComposerActivity.java @@ -440,9 +440,10 @@ public class CallComposerActivity extends AppCompatActivity CallPendingActivity.getIntent( this, contact.getNameOrNumber(), - contact.getNumber(), + contact.getDisplayNumber(), contact.getNumberLabel(), UriUtils.getLookupKeyFromUri(Uri.parse(contact.getContactUri())), + getString(R.string.call_composer_image_uploading), Uri.parse(contact.getPhotoUri()), sessionId)); pendingCallStarted = true; diff --git a/java/com/android/dialer/callcomposer/res/values/strings.xml b/java/com/android/dialer/callcomposer/res/values/strings.xml index 15480cb89..f01e90811 100644 --- a/java/com/android/dialer/callcomposer/res/values/strings.xml +++ b/java/com/android/dialer/callcomposer/res/values/strings.xml @@ -51,4 +51,7 @@ <!-- When a user makes a call with text attached, we send the text through the app "Messages". This string is shown in a toast for privacy reasons. --> <string name="message_sent_messages">Message sent via Messages</string> + <!-- When a user places a call with an image attached, we show them the in call screen and + display this string "Image uploading..." to let them know why the call hasn't started. --> + <string name="call_composer_image_uploading">Sending image\u2026</string> </resources>
\ No newline at end of file diff --git a/java/com/android/incallui/CallCardPresenter.java b/java/com/android/incallui/CallCardPresenter.java index 5f9f879a8..06b59c042 100644 --- a/java/com/android/incallui/CallCardPresenter.java +++ b/java/com/android/incallui/CallCardPresenter.java @@ -481,7 +481,8 @@ public class CallCardPresenter isBusiness, supports2ndCallOnHold(), getSwapToSecondaryButtonState(), - mPrimary.isAssistedDialed())); + mPrimary.isAssistedDialed(), + null)); 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 378f920a8..1a998096a 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -1360,6 +1360,7 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa public static final int CONNECTING = 13; /* Waiting for Telecom broadcast to finish */ public static final int BLOCKED = 14; /* The number was found on the block list */ public static final int PULLING = 15; /* An external call being pulled to the device */ + public static final int CALL_PENDING = 16; /* A call is pending on a long process to finish */ public static boolean isConnectingOrConnected(int state) { switch (state) { diff --git a/java/com/android/incallui/callpending/CallPendingActivity.java b/java/com/android/incallui/callpending/CallPendingActivity.java index 554d02165..d08998bb3 100644 --- a/java/com/android/incallui/callpending/CallPendingActivity.java +++ b/java/com/android/incallui/callpending/CallPendingActivity.java @@ -68,8 +68,9 @@ public class CallPendingActivity extends FragmentActivity private static final String EXTRA_SESSION_ID = "extra_session_id"; private static final String EXTRA_NUMBER = "extra_number"; private static final String EXTRA_NAME = "extra_name"; - private static final String EXTRA_LABEL = "extra_LABEL"; - private static final String EXTRA_LOOKUP_KEY = "extra_LOOKUP_KEY"; + private static final String EXTRA_LABEL = "extra_label"; + private static final String EXTRA_LOOKUP_KEY = "extra_lookup_key"; + private static final String EXTRA_CALL_PENDING_LABEL = "extra_call_pending_label"; private static final String EXTRA_PHOTO_URI = "extra_photo_uri"; private final BroadcastReceiver finishReceiver = @@ -93,6 +94,7 @@ public class CallPendingActivity extends FragmentActivity String number, String label, String lookupKey, + String callPendingLabel, Uri photoUri, long sessionId) { Intent intent = new Intent(context, CallPendingActivity.class); @@ -100,6 +102,7 @@ public class CallPendingActivity extends FragmentActivity intent.putExtra(EXTRA_NUMBER, number); intent.putExtra(EXTRA_LABEL, label); intent.putExtra(EXTRA_LOOKUP_KEY, lookupKey); + intent.putExtra(EXTRA_CALL_PENDING_LABEL, callPendingLabel); intent.putExtra(EXTRA_PHOTO_URI, photoUri); intent.putExtra(EXTRA_SESSION_ID, sessionId); return intent; @@ -142,7 +145,9 @@ public class CallPendingActivity extends FragmentActivity InCallScreen inCallScreen = (InCallScreen) getSupportFragmentManager().findFragmentByTag(TAG_IN_CALL_SCREEN); inCallScreen.setPrimary(createPrimaryInfo()); - inCallScreen.setCallState(PrimaryCallState.createEmptyPrimaryCallStateWithState(State.DIALING)); + inCallScreen.setCallState( + PrimaryCallState.createEmptyPrimaryCallStateWithState( + State.CALL_PENDING, getCallPendingLabel())); inCallScreen.setEndCallButtonEnabled(true, true); } @@ -336,6 +341,10 @@ public class CallPendingActivity extends FragmentActivity return getIntent().getStringExtra(EXTRA_LOOKUP_KEY); } + private String getCallPendingLabel() { + return getIntent().getStringExtra(EXTRA_CALL_PENDING_LABEL); + } + private Uri getPhotoUri() { return getIntent().getParcelableExtra(EXTRA_PHOTO_URI); } diff --git a/java/com/android/incallui/contactgrid/TopRow.java b/java/com/android/incallui/contactgrid/TopRow.java index ab003570f..fa8b98573 100644 --- a/java/com/android/incallui/contactgrid/TopRow.java +++ b/java/com/android/incallui/contactgrid/TopRow.java @@ -96,6 +96,8 @@ public class TopRow { label = context.getString(R.string.incall_remotely_held); } else if (state.state == State.ACTIVE && shouldShowNumber(primaryInfo)) { label = spanDisplayNumber(primaryInfo.number); + } else if (state.state == State.CALL_PENDING && !TextUtils.isEmpty(state.customLabel)) { + label = state.customLabel; } else { // Video calling... // [Wi-Fi icon] Starbucks Wi-Fi diff --git a/java/com/android/incallui/incall/protocol/PrimaryCallState.java b/java/com/android/incallui/incall/protocol/PrimaryCallState.java index 1afa66a91..fe80276c9 100644 --- a/java/com/android/incallui/incall/protocol/PrimaryCallState.java +++ b/java/com/android/incallui/incall/protocol/PrimaryCallState.java @@ -18,8 +18,12 @@ package com.android.incallui.incall.protocol; import android.graphics.drawable.Drawable; import android.support.annotation.IntDef; +import android.support.annotation.Nullable; import android.telecom.DisconnectCause; +import android.text.TextUtils; +import com.android.dialer.common.Assert; import com.android.incallui.call.DialerCall; +import com.android.incallui.call.DialerCall.State; import com.android.incallui.videotech.utils.SessionModificationState; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -63,13 +67,15 @@ public class PrimaryCallState { public final boolean supportsCallOnHold; public final @ButtonState int swapToSecondaryButtonState; public final boolean isAssistedDialed; + @Nullable public final String customLabel; // TODO: Convert to autovalue. b/34502119 public static PrimaryCallState createEmptyPrimaryCallState() { - return createEmptyPrimaryCallStateWithState(DialerCall.State.IDLE); + return createEmptyPrimaryCallStateWithState(DialerCall.State.IDLE, null); } - public static PrimaryCallState createEmptyPrimaryCallStateWithState(int state) { + public static PrimaryCallState createEmptyPrimaryCallStateWithState( + int state, String customLabel) { return new PrimaryCallState( state, false, /* isVideoCall */ @@ -93,7 +99,8 @@ public class PrimaryCallState { false /* isBusinessNumber */, true /* supportsCallOnHold */, ButtonState.NOT_SUPPORT /* swapToSecondaryButtonState */, - false /* isAssistedDialed */); + false /* isAssistedDialed */, + customLabel); } public PrimaryCallState( @@ -119,7 +126,8 @@ public class PrimaryCallState { boolean isBusinessNumber, boolean supportsCallOnHold, @ButtonState int swapToSecondaryButtonState, - boolean isAssistedDialed) { + boolean isAssistedDialed, + @Nullable String customLabel) { this.state = state; this.isVideoCall = isVideoCall; this.sessionModificationState = sessionModificationState; @@ -143,6 +151,10 @@ public class PrimaryCallState { this.supportsCallOnHold = supportsCallOnHold; this.swapToSecondaryButtonState = swapToSecondaryButtonState; this.isAssistedDialed = isAssistedDialed; + if (!TextUtils.isEmpty(customLabel)) { + Assert.checkArgument(state == State.CALL_PENDING); + } + this.customLabel = customLabel; } @Override |