summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllogutils
diff options
context:
space:
mode:
authorroldenburg <roldenburg@google.com>2017-10-16 17:00:00 -0700
committerEric Erfanian <erfanian@google.com>2017-10-17 08:10:39 -0700
commitc114cce52656e6ace2ffdfd075b0e8cd140cd498 (patch)
tree91fb2d0f5c065f024a7332ec664c794cdf30f413 /java/com/android/dialer/calllogutils
parente6706d676ebc8b91c96a8cc453e48f3f3ea0d205 (diff)
Move Duo related constants out of interface
Fixed notifying for Duo missed calls using the new constants to check if a call is a Duo call. Bug: 66946794 Test: existing tests, manual PiperOrigin-RevId: 172400311 Change-Id: I84ec0ac5c933cf1aec68b6d1f422c2effe6b69ec
Diffstat (limited to 'java/com/android/dialer/calllogutils')
-rw-r--r--java/com/android/dialer/calllogutils/CallbackActionHelper.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/java/com/android/dialer/calllogutils/CallbackActionHelper.java b/java/com/android/dialer/calllogutils/CallbackActionHelper.java
index 304994305..1e219f144 100644
--- a/java/com/android/dialer/calllogutils/CallbackActionHelper.java
+++ b/java/com/android/dialer/calllogutils/CallbackActionHelper.java
@@ -16,12 +16,10 @@
package com.android.dialer.calllogutils;
-import android.content.Context;
import android.provider.CallLog.Calls;
import android.support.annotation.IntDef;
import android.text.TextUtils;
-import com.android.dialer.duo.Duo;
-import com.android.dialer.duo.DuoComponent;
+import com.android.dialer.duo.DuoConstants;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -45,12 +43,11 @@ public class CallbackActionHelper {
* @param features Value of features in column {@link android.provider.CallLog.Calls#FEATURES}.
* @param phoneAccountComponentName Account name in column {@link
* android.provider.CallLog.Calls#PHONE_ACCOUNT_COMPONENT_NAME}.
- * @param context The context in which the method is called.
* @return One of the values in {@link CallbackAction}
*/
public static @CallbackAction int getCallbackAction(
- String number, int features, String phoneAccountComponentName, Context context) {
- return getCallbackAction(number, features, isDuoCall(phoneAccountComponentName, context));
+ String number, int features, String phoneAccountComponentName) {
+ return getCallbackAction(number, features, isDuoCall(phoneAccountComponentName));
}
/**
@@ -78,12 +75,9 @@ public class CallbackActionHelper {
return CallbackAction.VOICE;
}
- private static boolean isDuoCall(String phoneAccountComponentName, Context context) {
- Duo lightBringer = DuoComponent.get(context).getDuo();
- return lightBringer.getPhoneAccountComponentName() != null
- && lightBringer
- .getPhoneAccountComponentName()
- .flattenToString()
- .equals(phoneAccountComponentName);
+ private static boolean isDuoCall(String phoneAccountComponentName) {
+ return DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME
+ .flattenToString()
+ .equals(phoneAccountComponentName);
}
}