diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-16 00:09:31 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-16 00:09:31 +0000 |
commit | c57430a61eab62e88372f386c75989dab6332608 (patch) | |
tree | b606f1899f80fcd0ea3ee753ce799883d5a673ab /java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | |
parent | 9842b4a7fd1d852b1353af806da4913b4298d516 (diff) | |
parent | 0c9dbf507b53a12bdf577ff3e55c1686a2e089de (diff) |
Merge "Update Dialer to v10 RC32" into oc-dev
am: 0c9dbf507b
Change-Id: I5f90090090c6e430d83fcdd294082c1f5237ade8
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 278caba92..1daccd1a4 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -17,7 +17,6 @@ package com.android.dialer.app.calllog; import android.app.Activity; -import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.res.Resources; @@ -45,7 +44,6 @@ import android.widget.ImageButton; import android.widget.ImageView; import android.widget.QuickContactBadge; import android.widget.TextView; -import android.widget.Toast; import com.android.contacts.common.ClipboardUtils; import com.android.contacts.common.ContactPhotoManager; import com.android.contacts.common.compat.PhoneNumberUtilsCompat; @@ -62,6 +60,7 @@ import com.android.dialer.blocking.FilteredNumbersUtil; import com.android.dialer.callcomposer.CallComposerActivity; import com.android.dialer.callcomposer.CallComposerContact; import com.android.dialer.calldetails.CallDetailsEntries; +import com.android.dialer.common.ConfigProviderBindings; import com.android.dialer.common.LogUtil; import com.android.dialer.compat.CompatUtils; import com.android.dialer.lightbringer.Lightbringer; @@ -258,7 +257,11 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } primaryActionButtonView.setOnClickListener(this); primaryActionView.setOnClickListener(mExpandCollapseListener); - if (mVoicemailPlaybackPresenter != null) { + if (mVoicemailPlaybackPresenter != null + && ConfigProviderBindings.get(mContext) + .getBoolean( + CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT, + CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT_FLAG)) { primaryActionView.setOnLongClickListener(longPressListener); quickContactView.setOnLongClickListener(longPressListener); } else { @@ -792,38 +795,17 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder mVoicemailPlaybackPresenter.shareVoicemail(); } else { logCallLogAction(view.getId()); - final IntentProvider intentProvider = (IntentProvider) view.getTag(); - if (intentProvider == null) { - return; - } - - final Intent intent = intentProvider.getIntent(mContext); - // See IntentProvider.getCallDetailIntentProvider() for why this may be null. - if (intent == null) { - return; - } - - // We check to see if we are starting a Lightbringer intent. The reason is Lightbringer - // intents need to be started using startActivityForResult instead of the usual startActivity - String packageName = intent.getPackage(); - if (packageName != null && packageName.equals(getLightbringer().getPackageName(mContext))) { - startLightbringerActivity(intent); - } else { - DialerUtils.startActivityWithErrorToast(mContext, intent); + if (intentProvider != null) { + final Intent intent = intentProvider.getIntent(mContext); + // See IntentProvider.getCallDetailIntentProvider() for why this may be null. + if (intent != null) { + DialerUtils.startActivityWithErrorToast(mContext, intent); + } } } } - private void startLightbringerActivity(Intent intent) { - try { - Activity activity = (Activity) mContext; - activity.startActivityForResult(intent, DialtactsActivity.ACTIVITY_REQUEST_CODE_LIGHTBRINGER); - } catch (ActivityNotFoundException e) { - Toast.makeText(mContext, R.string.activity_not_available, Toast.LENGTH_SHORT).show(); - } - } - private CallComposerContact buildContact() { CallComposerContact.Builder contact = CallComposerContact.newBuilder(); contact.setPhotoId(info.photoId); |