From 549fd00bfa7de12530beff678f8c0542d321a881 Mon Sep 17 00:00:00 2001 From: mdooley Date: Fri, 6 Oct 2017 11:12:55 -0700 Subject: Allow for multi-line transcription error messages QA noticed that the error message 'Transcription not available. Unsupported language' didnt fit on one line and got truncated. This cl removes the single line constraint for that text field. Bug: 67384287 Test: manual PiperOrigin-RevId: 171316291 Change-Id: I41f98fe207ebeca900bf4fd51cd4e95e20981a9a --- java/com/android/dialer/app/res/layout/call_log_list_item.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/app/res/layout/call_log_list_item.xml b/java/com/android/dialer/app/res/layout/call_log_list_item.xml index 39dcbacf5..4382008d4 100644 --- a/java/com/android/dialer/app/res/layout/call_log_list_item.xml +++ b/java/com/android/dialer/app/res/layout/call_log_list_item.xml @@ -170,8 +170,7 @@ android:layout_height="wrap_content" android:textColor="@color/call_log_voicemail_transcript_branding_color" android:textSize="@dimen/call_log_voicemail_transcription_text_size" - android:paddingTop="2dp" - android:maxLines="1"/> + android:paddingTop="2dp"/> -- cgit v1.2.3 From 265089a047d575666a7c9fe325bf46d28b0342d1 Mon Sep 17 00:00:00 2001 From: yueg Date: Fri, 6 Oct 2017 14:35:15 -0700 Subject: Show on hold in management screen for conference call. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do the following when a participant is on hold: - Add "On hold • " in front of the number - Gray out avatar and text (contact name & number) Notice: We only have the on hold state information for VoLTE conference call and IMS conference call. So the change only works for them (not for GSM/CDMA conference call). Test: ConferenceManagerPresenterTest PiperOrigin-RevId: 171345423 Change-Id: Ie5fe2fc1097f4858604283989dcb916c2ac21972 --- .../com/android/dialer/theme/res/values/colors.xml | 2 + .../com/android/dialer/theme/res/values/dimens.xml | 3 ++ .../incallui/ConferenceParticipantListAdapter.java | 56 +++++++++++++++++++++- java/com/android/incallui/call/DialerCall.java | 4 ++ .../incallui/res/layout/caller_in_conference.xml | 9 ++++ 5 files changed, 72 insertions(+), 2 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/theme/res/values/colors.xml b/java/com/android/dialer/theme/res/values/colors.xml index 0e6f54fb6..3c8cabbc5 100644 --- a/java/com/android/dialer/theme/res/values/colors.xml +++ b/java/com/android/dialer/theme/res/values/colors.xml @@ -42,6 +42,8 @@ #636363 + + #61000000 @color/dialer_theme_color diff --git a/java/com/android/dialer/theme/res/values/dimens.xml b/java/com/android/dialer/theme/res/values/dimens.xml index ee52c97e6..972cb535c 100644 --- a/java/com/android/dialer/theme/res/values/dimens.xml +++ b/java/com/android/dialer/theme/res/values/dimens.xml @@ -38,4 +38,7 @@ 72dp 2dp + + 1.0 + 0.54 diff --git a/java/com/android/incallui/ConferenceParticipantListAdapter.java b/java/com/android/incallui/ConferenceParticipantListAdapter.java index 70cdf245f..d0f488501 100644 --- a/java/com/android/incallui/ConferenceParticipantListAdapter.java +++ b/java/com/android/incallui/ConferenceParticipantListAdapter.java @@ -24,6 +24,7 @@ import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; import android.text.TextUtils; import android.util.ArraySet; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -245,7 +246,8 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { contactCache.lookupKey, contactCache.displayPhotoUri, thisRowCanSeparate, - thisRowCanDisconnect); + thisRowCanDisconnect, + call.getNonConferenceState()); // Tag the row in the conference participant list with the call id to make it easier to // find calls when contact cache information is loaded. @@ -290,9 +292,11 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { String lookupKey, Uri photoUri, boolean thisRowCanSeparate, - boolean thisRowCanDisconnect) { + boolean thisRowCanDisconnect, + int callState) { final ImageView photoView = (ImageView) view.findViewById(R.id.callerPhoto); + final TextView statusTextView = (TextView) view.findViewById(R.id.conferenceCallerStatus); final TextView nameTextView = (TextView) view.findViewById(R.id.conferenceCallerName); final TextView numberTextView = (TextView) view.findViewById(R.id.conferenceCallerNumber); final TextView numberTypeTextView = @@ -300,6 +304,13 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { final View endButton = view.findViewById(R.id.conferenceCallerDisconnect); final View separateButton = view.findViewById(R.id.conferenceCallerSeparate); + if (callState == DialerCall.State.ONHOLD) { + setViewsOnHold(photoView, statusTextView, nameTextView, numberTextView, numberTypeTextView); + } else { + setViewsNotOnHold( + photoView, statusTextView, nameTextView, numberTextView, numberTypeTextView); + } + endButton.setVisibility(thisRowCanDisconnect ? View.VISIBLE : View.GONE); if (thisRowCanDisconnect) { endButton.setOnClickListener(mDisconnectListener); @@ -338,6 +349,47 @@ public class ConferenceParticipantListAdapter extends BaseAdapter { } } + private void setViewsOnHold( + ImageView photoView, + TextView statusTextView, + TextView nameTextView, + TextView numberTextView, + TextView numberTypeTextView) { + CharSequence onHoldText = + TextUtils.concat(getContext().getText(R.string.notification_on_hold).toString(), " • "); + statusTextView.setText(onHoldText); + statusTextView.setVisibility(View.VISIBLE); + + int onHoldColor = getContext().getColor(R.color.dialer_secondary_text_color_hiden); + nameTextView.setTextColor(onHoldColor); + numberTextView.setTextColor(onHoldColor); + numberTypeTextView.setTextColor(onHoldColor); + + TypedValue alpha = new TypedValue(); + getContext().getResources().getValue(R.dimen.alpha_hiden, alpha, true); + photoView.setAlpha(alpha.getFloat()); + } + + private void setViewsNotOnHold( + ImageView photoView, + TextView statusTextView, + TextView nameTextView, + TextView numberTextView, + TextView numberTypeTextView) { + statusTextView.setVisibility(View.GONE); + + nameTextView.setTextColor( + getContext().getColor(R.color.conference_call_manager_caller_name_text_color)); + numberTextView.setTextColor( + getContext().getColor(R.color.conference_call_manager_secondary_text_color)); + numberTypeTextView.setTextColor( + getContext().getColor(R.color.conference_call_manager_secondary_text_color)); + + TypedValue alpha = new TypedValue(); + getContext().getResources().getValue(R.dimen.alpha_enabled, alpha, true); + photoView.setAlpha(alpha.getFloat()); + } + /** * Updates the participant info list which is bound to the ListView. Stores the call and contact * info for all entries. The list is sorted alphabetically by participant name. diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 82a29ee84..d393b4211 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -706,6 +706,10 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } } + public int getNonConferenceState() { + return mState; + } + public void setState(int state) { if (state == State.INCOMING) { mLogState.isIncoming = true; diff --git a/java/com/android/incallui/res/layout/caller_in_conference.xml b/java/com/android/incallui/res/layout/caller_in_conference.xml index 4f4b2f043..37918188f 100644 --- a/java/com/android/incallui/res/layout/caller_in_conference.xml +++ b/java/com/android/incallui/res/layout/caller_in_conference.xml @@ -62,6 +62,15 @@ android:gravity="bottom" android:orientation="horizontal"> + + + Date: Fri, 6 Oct 2017 14:51:18 -0700 Subject: Adding Future method for DialerPhoneNumberUtil This CL adds a method to DialerPhoneNumberUtil which returns a Future holding the result of parsing a number into the DialerPhoneNumber proto. This will be used in the APDL integration as it will use Futures as well. The CL also changes DialerExecutors.lowPriorityThreadPool to be an ExecutorService instead of an Executor (the super type) so it can be used in MoreExecutors.listeningDecorator. Test: TAP PiperOrigin-RevId: 171347542 Change-Id: I620aacf3304d625f57af6d2b89a36f11b44008dd --- .../dialer/common/concurrent/DialerExecutors.java | 6 +++--- .../phonenumberproto/DialerPhoneNumberUtil.java | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'java') diff --git a/java/com/android/dialer/common/concurrent/DialerExecutors.java b/java/com/android/dialer/common/concurrent/DialerExecutors.java index 81b3c5cb3..850c28cdd 100644 --- a/java/com/android/dialer/common/concurrent/DialerExecutors.java +++ b/java/com/android/dialer/common/concurrent/DialerExecutors.java @@ -21,7 +21,7 @@ import android.support.annotation.NonNull; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.Worker; -import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -136,7 +136,7 @@ public final class DialerExecutors { return new DefaultDialerExecutorFactory().createNonUiTaskBuilder(Assert.isNotNull(worker)); } - private static final Executor lowPriorityThreadPool = + private static final ExecutorService lowPriorityThreadPool = Executors.newFixedThreadPool( 5, new ThreadFactory() { @@ -155,7 +155,7 @@ public final class DialerExecutors { *

This exists to prevent each individual dialer component from having to create its own * threads/pools, which would result in the application having more threads than really necessary. */ - public static Executor getLowPriorityThreadPool() { + public static ExecutorService getLowPriorityThreadPool() { return lowPriorityThreadPool; } } diff --git a/java/com/android/dialer/phonenumberproto/DialerPhoneNumberUtil.java b/java/com/android/dialer/phonenumberproto/DialerPhoneNumberUtil.java index cc509f41b..a00ee75bf 100644 --- a/java/com/android/dialer/phonenumberproto/DialerPhoneNumberUtil.java +++ b/java/com/android/dialer/phonenumberproto/DialerPhoneNumberUtil.java @@ -16,6 +16,7 @@ package com.android.dialer.phonenumberproto; +import android.support.annotation.AnyThread; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; @@ -24,6 +25,8 @@ import com.android.dialer.DialerPhoneNumber; import com.android.dialer.DialerPhoneNumber.RawInput; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.ListeningExecutorService; import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.PhoneNumberUtil.MatchType; @@ -46,7 +49,7 @@ public class DialerPhoneNumberUtil { /** * Parses the provided raw phone number into a {@link DialerPhoneNumber}. * - * @see PhoneNumberUtil#parse(String, String) + * @see PhoneNumberUtil#parse(CharSequence, String) */ @WorkerThread public DialerPhoneNumber parse(@Nullable String numberToParse, @Nullable String defaultRegion) { @@ -72,6 +75,21 @@ public class DialerPhoneNumberUtil { return dialerPhoneNumber.build(); } + /** + * Parses the provided raw phone number into a Future result of {@link DialerPhoneNumber}. + * + *

Work is run on the provided {@link ListeningExecutorService}. + * + * @see PhoneNumberUtil#parse(CharSequence, String) + */ + @AnyThread + public ListenableFuture parse( + @Nullable String numberToParse, + @Nullable String defaultRegion, + @NonNull ListeningExecutorService service) { + return service.submit(() -> parse(numberToParse, defaultRegion)); + } + /** * Returns true if the two numbers were parseable by libphonenumber and are an {@link * MatchType#EXACT_MATCH} or if they have the same raw input. -- cgit v1.2.3