From e85fa664ac1e7394a7e9e5d0c8dc61ba1e33ab1c Mon Sep 17 00:00:00 2001 From: sail Date: Tue, 27 Jun 2017 10:55:49 -0700 Subject: Automated g4 rollback of changelist 159993127. *** Reason for rollback *** This CL causes a crash when swapping SIMs. *** Original change description *** Adding voicemail transcription branding and progress UI screen shot showing branding (its harder to capture the progress UI): https://drive.google.com/open?id=0B9o_KvtLkcuIdkkycVo1RFhsaENYV3J2Yi1LWnJzR0FfSHJR *** Bug: 63059930 Test: N/A PiperOrigin-RevId: 160296762 Change-Id: Ib8d709d03d6d8a3fee4a0c384c15df00f55cb182 --- .../android/dialer/app/calllog/CallLogAdapter.java | 5 ---- .../app/calllog/CallLogListItemViewHolder.java | 16 +++------- .../dialer/app/calllog/PhoneCallDetailsHelper.java | 35 ++-------------------- .../dialer/app/calllog/PhoneCallDetailsViews.java | 5 ---- .../dialer/app/res/layout/call_log_list_item.xml | 34 +++++---------------- java/com/android/dialer/app/res/values/colors.xml | 2 -- java/com/android/dialer/app/res/values/strings.xml | 9 ------ 7 files changed, 14 insertions(+), 92 deletions(-) (limited to 'java/com/android/dialer/app') diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index f2db13480..216cae4a3 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -908,10 +908,6 @@ public class CallLogAdapter extends GroupingListAdapter (VERSION.SDK_INT >= VERSION_CODES.N) ? cursor.getString(CallLogQuery.VIA_NUMBER) : ""; final int numberPresentation = cursor.getInt(CallLogQuery.NUMBER_PRESENTATION); final ContactInfo cachedContactInfo = ContactInfoHelper.getContactInfo(cursor); - final int transcriptionState = - (VERSION.SDK_INT >= VERSION_CODES.O) - ? cursor.getInt(CallLogQuery.TRANSCRIPTION_STATE) - : PhoneCallDetailsHelper.TRANSCRIPTION_NOT_STARTED; final PhoneCallDetails details = new PhoneCallDetails(number, numberPresentation, postDialDigits); details.viaNumber = viaNumber; @@ -921,7 +917,6 @@ public class CallLogAdapter extends GroupingListAdapter details.features = getCallFeatures(cursor, count); details.geocode = cursor.getString(CallLogQuery.GEOCODED_LOCATION); details.transcription = cursor.getString(CallLogQuery.TRANSCRIPTION); - details.transcriptionState = transcriptionState; details.callTypes = getCallTypes(cursor, count); details.accountComponentName = cursor.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME); diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 213fde8cd..aaa56d453 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -772,20 +772,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder return; } - TextView transcriptView = phoneCallDetailsViews.voicemailTranscriptionView; - TextView transcriptBrandingView = phoneCallDetailsViews.voicemailTranscriptionBrandingView; - if (!isExpanded || TextUtils.isEmpty(transcriptView.getText())) { - Assert.checkArgument(TextUtils.isEmpty(transcriptBrandingView.getText())); - transcriptView.setVisibility(View.GONE); - transcriptBrandingView.setVisibility(View.GONE); + final TextView view = phoneCallDetailsViews.voicemailTranscriptionView; + if (!isExpanded || TextUtils.isEmpty(view.getText())) { + view.setVisibility(View.GONE); return; } - transcriptView.setVisibility(View.VISIBLE); - if (TextUtils.isEmpty(transcriptBrandingView.getText())) { - phoneCallDetailsViews.voicemailTranscriptionBrandingView.setVisibility(View.GONE); - } else { - phoneCallDetailsViews.voicemailTranscriptionBrandingView.setVisibility(View.VISIBLE); - } + view.setVisibility(View.VISIBLE); } public void updatePhoto() { diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java index 6ece95ccd..0c720775a 100644 --- a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java +++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java @@ -45,13 +45,6 @@ public class PhoneCallDetailsHelper { /** The maximum number of icons will be shown to represent the call types in a group. */ private static final int MAX_CALL_TYPE_ICONS = 3; - // TODO(mdooley): remove when these api's become public - // Copied from android.provider.VoicemailContract - static final int TRANSCRIPTION_NOT_STARTED = 0; - static final int TRANSCRIPTION_IN_PROGRESS = 1; - static final int TRANSCRIPTION_FAILED = 2; - static final int TRANSCRIPTION_AVALIABLE = 3; - private final Context mContext; private final Resources mResources; private final CallLogCache mCallLogCache; @@ -152,38 +145,14 @@ public class PhoneCallDetailsHelper { if (isVoicemail) { int relevantLinkTypes = Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS | Linkify.WEB_URLS; views.voicemailTranscriptionView.setAutoLinkMask(relevantLinkTypes); - boolean showTranscriptBranding = false; - if (!TextUtils.isEmpty(details.transcription)) { - views.voicemailTranscriptionView.setText(details.transcription); - - // Set the branding text if the voicemail was transcribed by google - // TODO(mdooley): the transcription state is only set by the google transcription code, - // but a better solution would be to check the SOURCE_PACKAGE - showTranscriptBranding = details.transcriptionState == TRANSCRIPTION_AVALIABLE; - } else { - if (details.transcriptionState == TRANSCRIPTION_IN_PROGRESS) { - views.voicemailTranscriptionView.setText( - mResources.getString(R.string.voicemail_transcription_in_progress)); - showTranscriptBranding = true; - } else if (details.transcriptionState == TRANSCRIPTION_FAILED) { - views.voicemailTranscriptionView.setText( - mResources.getString(R.string.voicemail_transcription_failed)); - } - } - - if (showTranscriptBranding) { - views.voicemailTranscriptionBrandingView.setText( - mResources.getString(R.string.voicemail_transcription_branding_text)); - } else { - views.voicemailTranscriptionBrandingView.setText(""); - } + views.voicemailTranscriptionView.setText( + TextUtils.isEmpty(details.transcription) ? null : details.transcription); } // Bold if not read Typeface typeface = details.isRead ? Typeface.SANS_SERIF : Typeface.DEFAULT_BOLD; views.nameView.setTypeface(typeface); views.voicemailTranscriptionView.setTypeface(typeface); - views.voicemailTranscriptionBrandingView.setTypeface(typeface); views.callLocationAndDate.setTypeface(typeface); views.callLocationAndDate.setTextColor( ContextCompat.getColor( diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsViews.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsViews.java index 283603170..e2e27a179 100644 --- a/java/com/android/dialer/app/calllog/PhoneCallDetailsViews.java +++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsViews.java @@ -30,7 +30,6 @@ public final class PhoneCallDetailsViews { public final CallTypeIconsView callTypeIcons; public final TextView callLocationAndDate; public final TextView voicemailTranscriptionView; - public final TextView voicemailTranscriptionBrandingView; public final TextView callAccountLabel; private PhoneCallDetailsViews( @@ -39,14 +38,12 @@ public final class PhoneCallDetailsViews { CallTypeIconsView callTypeIcons, TextView callLocationAndDate, TextView voicemailTranscriptionView, - TextView voicemailTranscriptionBrandingView, TextView callAccountLabel) { this.nameView = nameView; this.callTypeView = callTypeView; this.callTypeIcons = callTypeIcons; this.callLocationAndDate = callLocationAndDate; this.voicemailTranscriptionView = voicemailTranscriptionView; - this.voicemailTranscriptionBrandingView = voicemailTranscriptionBrandingView; this.callAccountLabel = callAccountLabel; } @@ -64,7 +61,6 @@ public final class PhoneCallDetailsViews { (CallTypeIconsView) view.findViewById(R.id.call_type_icons), (TextView) view.findViewById(R.id.call_location_and_date), (TextView) view.findViewById(R.id.voicemail_transcription), - (TextView) view.findViewById(R.id.voicemail_transcription_branding), (TextView) view.findViewById(R.id.call_account_label)); } @@ -75,7 +71,6 @@ public final class PhoneCallDetailsViews { new CallTypeIconsView(context), new TextView(context), new TextView(context), - new TextView(context), new TextView(context)); } } 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 fd31fc2fc..afb50ffba 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 @@ -148,35 +148,17 @@ android:visibility="gone" android:singleLine="true"/> - - - - - - - + android:textColor="@color/call_log_voicemail_transcript_color" + android:textSize="@dimen/call_log_voicemail_transcription_text_size" + android:ellipsize="marquee" + android:visibility="gone" + android:singleLine="false" + android:maxLines="10"/> diff --git a/java/com/android/dialer/app/res/values/colors.xml b/java/com/android/dialer/app/res/values/colors.xml index b13020ecd..2f6d87b49 100644 --- a/java/com/android/dialer/app/res/values/colors.xml +++ b/java/com/android/dialer/app/res/values/colors.xml @@ -36,8 +36,6 @@ #8a000000 #de000000 - - #8a000000 #b3000000 diff --git a/java/com/android/dialer/app/res/values/strings.xml b/java/com/android/dialer/app/res/values/strings.xml index e9c1d2427..5549881c3 100644 --- a/java/com/android/dialer/app/res/values/strings.xml +++ b/java/com/android/dialer/app/res/values/strings.xml @@ -930,15 +930,6 @@ About - - Transcribed by Google - - - Google is transcribing... - - - Transcript not available - View -- cgit v1.2.3