diff options
author | twyen <twyen@google.com> | 2018-01-25 15:54:00 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-25 17:33:39 -0800 |
commit | c1623fe219f3229bf9191afdcf0667efd0f549b8 (patch) | |
tree | e49206da45a253224ee9f7b33ca441c7bb36dc8e /java/com/android/dialer/calllogutils | |
parent | 8392f80d96bf8e5b070429e53c674522a30f796c (diff) |
Remove non call log dependencies on PhoneAccountUtil
Methods moved to TelecomUtils
Test: Unit tests
PiperOrigin-RevId: 183305626
Change-Id: Idd6604e58c06a36066bd49870849dd71747969c6
Diffstat (limited to 'java/com/android/dialer/calllogutils')
-rw-r--r-- | java/com/android/dialer/calllogutils/CallLogIntents.java | 4 | ||||
-rw-r--r-- | java/com/android/dialer/calllogutils/PhoneAccountUtils.java | 32 |
2 files changed, 3 insertions, 33 deletions
diff --git a/java/com/android/dialer/calllogutils/CallLogIntents.java b/java/com/android/dialer/calllogutils/CallLogIntents.java index b06fe6e93..05af8bfc7 100644 --- a/java/com/android/dialer/calllogutils/CallLogIntents.java +++ b/java/com/android/dialer/calllogutils/CallLogIntents.java @@ -24,6 +24,7 @@ import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.precall.PreCall; +import com.android.dialer.telecom.TelecomUtil; /** Provides intents related to call log entries. */ public final class CallLogIntents { @@ -51,7 +52,8 @@ public final class CallLogIntents { context, new CallIntentBuilder(originalNumber, CallInitiationType.Type.CALL_LOG) .setPhoneAccountHandle( - PhoneAccountUtils.getAccount(row.phoneAccountComponentName(), row.phoneAccountId())) + TelecomUtil.composePhoneAccountHandle( + row.phoneAccountComponentName(), row.phoneAccountId())) .setIsVideoCall((row.features() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO)); } } diff --git a/java/com/android/dialer/calllogutils/PhoneAccountUtils.java b/java/com/android/dialer/calllogutils/PhoneAccountUtils.java index 153f29185..2ee50a134 100644 --- a/java/com/android/dialer/calllogutils/PhoneAccountUtils.java +++ b/java/com/android/dialer/calllogutils/PhoneAccountUtils.java @@ -16,47 +16,15 @@ package com.android.dialer.calllogutils; -import android.content.ComponentName; import android.content.Context; import android.support.annotation.Nullable; import android.telecom.PhoneAccount; import android.telecom.PhoneAccountHandle; -import android.text.TextUtils; import com.android.dialer.telecom.TelecomUtil; -import java.util.ArrayList; -import java.util.List; /** Methods to help extract {@code PhoneAccount} information from database and Telecomm sources. */ public class PhoneAccountUtils { - /** Return a list of phone accounts that are subscription/SIM accounts. */ - public static List<PhoneAccountHandle> getSubscriptionPhoneAccounts(Context context) { - List<PhoneAccountHandle> subscriptionAccountHandles = new ArrayList<>(); - final List<PhoneAccountHandle> accountHandles = - TelecomUtil.getCallCapablePhoneAccounts(context); - for (PhoneAccountHandle accountHandle : accountHandles) { - PhoneAccount account = TelecomUtil.getPhoneAccount(context, accountHandle); - if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { - subscriptionAccountHandles.add(accountHandle); - } - } - return subscriptionAccountHandles; - } - - /** Compose PhoneAccount object from component name and account id. */ - @Nullable - public static PhoneAccountHandle getAccount( - @Nullable String componentString, @Nullable String accountId) { - if (TextUtils.isEmpty(componentString) || TextUtils.isEmpty(accountId)) { - return null; - } - final ComponentName componentName = ComponentName.unflattenFromString(componentString); - if (componentName == null) { - return null; - } - return new PhoneAccountHandle(componentName, accountId); - } - /** Extract account label from PhoneAccount object. */ @Nullable public static String getAccountLabel( |