diff options
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index e3509a964..0e8112caa 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -368,20 +368,30 @@ public class CallLogAdapter extends GroupingListAdapter } expandViewHolderActions(viewHolder); - if (viewHolder.videoCallButtonView != null - && viewHolder.videoCallButtonView.getVisibility() == View.VISIBLE - && LightbringerComponent.get(mActivity).getLightbringer().getPackageName() != null - && LightbringerComponent.get(mActivity) - .getLightbringer() - .getPackageName() - .equals( - ((IntentProvider) viewHolder.videoCallButtonView.getTag()) - .getIntent(mActivity) - .getPackage())) { + if (isLightbringerCallButtonVisible(viewHolder.videoCallButtonView)) { CallIntentBuilder.increaseLightbringerCallButtonAppearInExpandedCallLogItemCount(); } } } + + private boolean isLightbringerCallButtonVisible(View videoCallButtonView) { + if (videoCallButtonView == null) { + return false; + } + if (videoCallButtonView.getVisibility() != View.VISIBLE) { + return false; + } + IntentProvider intentProvider = (IntentProvider) videoCallButtonView.getTag(); + if (intentProvider == null) { + return false; + } + String packageName = + LightbringerComponent.get(mActivity).getLightbringer().getPackageName(); + if (packageName == null) { + return false; + } + return packageName.equals(intentProvider.getIntent(mActivity).getPackage()); + } }; private void checkMarkCallLogEntry(CallLogListItemViewHolder viewHolder) { |