summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-10-10 11:03:33 -0700
committerEric Erfanian <erfanian@google.com>2017-10-11 07:05:36 -0700
commit7b96fb1690255f13591edba01770d2d82c197194 (patch)
tree33ed22a93d7386784698a412df081687292066bd /java/com/android/dialer/app
parent5a0a312336fad7761f942d6934825cd6701ec009 (diff)
Set an appropriate icon for the call detail UI's callback button.
cl/170943038 groups calls in the call log according to their corresponding actions (Lightbringer, IMS, and voice). This way calls in the call detail UI are in the same category and an appropriate icon can be set. Bug: 66026167 Test: CallDetailsActivityTest.callbackButtonLoggedForLightbringerCall, CallDetailsActivityTest.callbackButtonLoggedForVideoCall, CallDetailsActivityTest.callbackButtonLoggedForVoiceCall PiperOrigin-RevId: 171703514 Change-Id: I534e1d22f1355f261105a6bde74285403fc9ed87
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r--java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java10
-rw-r--r--java/com/android/dialer/app/calllog/IntentProvider.java9
2 files changed, 14 insertions, 5 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
index adf7f1b4e..6067c4239 100644
--- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
+++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java
@@ -551,7 +551,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
if (mCallLogCache.isVoicemailNumber(accountHandle, number)) {
// Call to generic voicemail number, in case there are multiple accounts
primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider());
- } else if (this.info != null && this.info.lookupKey != null) {
+ } else if (canSupportAssistedDialing()) {
primaryActionButtonView.setTag(
IntentProvider.getAssistedDialIntentProvider(
number + postDialDigits,
@@ -618,7 +618,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
((TextView) callButtonView.findViewById(R.id.call_type_or_location_text));
if (canPlaceCallToNumber) {
- if (this.info != null && this.info.lookupKey != null) {
+ if (canSupportAssistedDialing()) {
callButtonView.setTag(
IntentProvider.getAssistedDialIntentProvider(
number, mContext, mContext.getSystemService(TelephonyManager.class)));
@@ -685,7 +685,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
&& mCachedNumberLookupService.canReportAsInvalid(info.sourceType, info.objectId);
detailsButtonView.setTag(
IntentProvider.getCallDetailIntentProvider(
- callDetailsEntries, buildContact(), canReportCallerId));
+ callDetailsEntries, buildContact(), canReportCallerId, canSupportAssistedDialing()));
}
boolean isBlockedOrSpam = blockId != null || (isSpamFeatureEnabled && isSpam);
@@ -764,6 +764,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
return accountHandle.getComponentName().equals(mDefaultPhoneAccountHandle.getComponentName());
}
+ private boolean canSupportAssistedDialing() {
+ return info != null && info.lookupKey != null;
+ }
+
private boolean canSupportCarrierVideoCall() {
return mCallLogCache.canRelyOnVideoPresence()
&& info != null
diff --git a/java/com/android/dialer/app/calllog/IntentProvider.java b/java/com/android/dialer/app/calllog/IntentProvider.java
index 52a7b0faf..5030de5f5 100644
--- a/java/com/android/dialer/app/calllog/IntentProvider.java
+++ b/java/com/android/dialer/app/calllog/IntentProvider.java
@@ -124,15 +124,20 @@ public abstract class IntentProvider {
*
* @param callDetailsEntries The call details of the other calls grouped together with the call.
* @param contact The contact with which this call details intent pertains to.
+ * @param canReportCallerId Whether reporting a caller ID is supported.
+ * @param canSupportAssistedDialing Whether assisted dialing is supported.
* @return The call details intent provider.
*/
public static IntentProvider getCallDetailIntentProvider(
- CallDetailsEntries callDetailsEntries, DialerContact contact, boolean canReportCallerId) {
+ CallDetailsEntries callDetailsEntries,
+ DialerContact contact,
+ boolean canReportCallerId,
+ boolean canSupportAssistedDialing) {
return new IntentProvider() {
@Override
public Intent getIntent(Context context) {
return CallDetailsActivity.newInstance(
- context, callDetailsEntries, contact, canReportCallerId);
+ context, callDetailsEntries, contact, canReportCallerId, canSupportAssistedDialing);
}
};
}