From 4f02639a38aa0fe522cfeb4c316d5bdffdeca7cd Mon Sep 17 00:00:00 2001 From: roldenburg Date: Fri, 13 Oct 2017 18:42:20 -0700 Subject: Rename Lightbringer to Duo Now that our Duo integration is public, we no longer need a code name. To avoid any disruption, logging and config related names were not changed. Bug: 63753964 Test: manual, existing tests PiperOrigin-RevId: 172172738 Change-Id: Ib9d3d80761944d850c8c4886def9fef9a28539a4 --- .../dialer/calllogutils/CallTypeHelper.java | 34 +++++++++++----------- .../dialer/calllogutils/CallbackActionHelper.java | 28 +++++++----------- 2 files changed, 28 insertions(+), 34 deletions(-) (limited to 'java/com/android/dialer/calllogutils') diff --git a/java/com/android/dialer/calllogutils/CallTypeHelper.java b/java/com/android/dialer/calllogutils/CallTypeHelper.java index 783f799f3..e3c711d99 100644 --- a/java/com/android/dialer/calllogutils/CallTypeHelper.java +++ b/java/com/android/dialer/calllogutils/CallTypeHelper.java @@ -18,7 +18,7 @@ package com.android.dialer.calllogutils; import android.content.res.Resources; import com.android.dialer.compat.AppCompatConstants; -import com.android.dialer.lightbringer.Lightbringer; +import com.android.dialer.duo.Duo; /** Helper class to perform operations related to call types. */ public class CallTypeHelper { @@ -51,12 +51,12 @@ public class CallTypeHelper { private final CharSequence mBlockedName; /** Name used to identify calls which were answered on another device. */ private final CharSequence mAnsweredElsewhereName; - /** Name used to identify incoming lightbringer calls. */ - private final CharSequence mIncomingLightbringerCall; - /** Name used to identify outgoing lightbringer calls. */ - private final CharSequence mOutgoingLightbringerCall; + /** Name used to identify incoming Duo calls. */ + private final CharSequence mIncomingDuoCall; + /** Name used to identify outgoing Duo calls. */ + private final CharSequence mOutgoingDuoCall; - public CallTypeHelper(Resources resources, Lightbringer lightbringer) { + public CallTypeHelper(Resources resources, Duo duo) { // Cache these values so that we do not need to look them up each time. mIncomingName = resources.getString(R.string.type_incoming); mIncomingPulledName = resources.getString(R.string.type_incoming_pulled); @@ -73,16 +73,16 @@ public class CallTypeHelper { mBlockedName = resources.getString(R.string.type_blocked); mAnsweredElsewhereName = resources.getString(R.string.type_answered_elsewhere); - if (lightbringer.getIncomingCallTypeText() != -1) { - mIncomingLightbringerCall = resources.getString(lightbringer.getIncomingCallTypeText()); + if (duo.getIncomingCallTypeText() != -1) { + mIncomingDuoCall = resources.getString(duo.getIncomingCallTypeText()); } else { - mIncomingLightbringerCall = mIncomingVideoName; + mIncomingDuoCall = mIncomingVideoName; } - if (lightbringer.getOutgoingCallTypeText() != -1) { - mOutgoingLightbringerCall = resources.getString(lightbringer.getOutgoingCallTypeText()); + if (duo.getOutgoingCallTypeText() != -1) { + mOutgoingDuoCall = resources.getString(duo.getOutgoingCallTypeText()); } else { - mOutgoingLightbringerCall = mOutgoingVideoName; + mOutgoingDuoCall = mOutgoingVideoName; } } @@ -95,15 +95,15 @@ public class CallTypeHelper { /** Returns the text used to represent the given call type. */ public CharSequence getCallTypeText( - int callType, boolean isVideoCall, boolean isPulledCall, boolean isLightbringerCall) { + int callType, boolean isVideoCall, boolean isPulledCall, boolean isDuoCall) { switch (callType) { case AppCompatConstants.CALLS_INCOMING_TYPE: if (isVideoCall) { if (isPulledCall) { return mIncomingVideoPulledName; } else { - if (isLightbringerCall) { - return mIncomingLightbringerCall; + if (isDuoCall) { + return mIncomingDuoCall; } return mIncomingVideoName; } @@ -120,8 +120,8 @@ public class CallTypeHelper { if (isPulledCall) { return mOutgoingVideoPulledName; } else { - if (isLightbringerCall) { - return mOutgoingLightbringerCall; + if (isDuoCall) { + return mOutgoingDuoCall; } return mOutgoingVideoName; } diff --git a/java/com/android/dialer/calllogutils/CallbackActionHelper.java b/java/com/android/dialer/calllogutils/CallbackActionHelper.java index 297d5e649..304994305 100644 --- a/java/com/android/dialer/calllogutils/CallbackActionHelper.java +++ b/java/com/android/dialer/calllogutils/CallbackActionHelper.java @@ -20,8 +20,8 @@ import android.content.Context; import android.provider.CallLog.Calls; import android.support.annotation.IntDef; import android.text.TextUtils; -import com.android.dialer.lightbringer.Lightbringer; -import com.android.dialer.lightbringer.LightbringerComponent; +import com.android.dialer.duo.Duo; +import com.android.dialer.duo.DuoComponent; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -30,16 +30,11 @@ public class CallbackActionHelper { /** Specifies the action a user can take to make a callback. */ @Retention(RetentionPolicy.SOURCE) - @IntDef({ - CallbackAction.NONE, - CallbackAction.IMS_VIDEO, - CallbackAction.LIGHTBRINGER, - CallbackAction.VOICE - }) + @IntDef({CallbackAction.NONE, CallbackAction.IMS_VIDEO, CallbackAction.DUO, CallbackAction.VOICE}) public @interface CallbackAction { int NONE = 0; int IMS_VIDEO = 1; - int LIGHTBRINGER = 2; + int DUO = 2; int VOICE = 3; } @@ -55,8 +50,7 @@ public class CallbackActionHelper { */ public static @CallbackAction int getCallbackAction( String number, int features, String phoneAccountComponentName, Context context) { - return getCallbackAction( - number, features, isLightbringerCall(phoneAccountComponentName, context)); + return getCallbackAction(number, features, isDuoCall(phoneAccountComponentName, context)); } /** @@ -64,16 +58,16 @@ public class CallbackActionHelper { * * @param number The phone number in column {@link android.provider.CallLog.Calls#NUMBER}. * @param features Value of features in column {@link android.provider.CallLog.Calls#FEATURES}. - * @param isLightbringerCall Whether the call is a Lightbringer call. + * @param isDuoCall Whether the call is a Duo call. * @return One of the values in {@link CallbackAction} */ public static @CallbackAction int getCallbackAction( - String number, int features, boolean isLightbringerCall) { + String number, int features, boolean isDuoCall) { if (TextUtils.isEmpty(number)) { return CallbackAction.NONE; } - if (isLightbringerCall) { - return CallbackAction.LIGHTBRINGER; + if (isDuoCall) { + return CallbackAction.DUO; } boolean isVideoCall = (features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO; @@ -84,8 +78,8 @@ public class CallbackActionHelper { return CallbackAction.VOICE; } - private static boolean isLightbringerCall(String phoneAccountComponentName, Context context) { - Lightbringer lightBringer = LightbringerComponent.get(context).getLightbringer(); + private static boolean isDuoCall(String phoneAccountComponentName, Context context) { + Duo lightBringer = DuoComponent.get(context).getDuo(); return lightBringer.getPhoneAccountComponentName() != null && lightBringer .getPhoneAccountComponentName() -- cgit v1.2.3