summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hall Liu <hallliu@google.com> 2018-11-21 14:40:19 -0800
committer Hall Liu <hallliu@google.com> 2018-12-10 18:46:07 -0800
commit7d02a835aefe81fb9af128dbb1eb31d3511d8dcc (patch)
tree9ab44aec8aa988d5eaa2ed888777a582164f3ef1
parentf3935f02680463289d783bb24687b9c2261281b8 (diff)
Add fields for PhoneAccount to CallerInfo
Add fields to specify which outgoing phone account is stored in the contacts db within the CallerInfo object. Bug: 111455117 Test: manual, unit Change-Id: Id402102e4605f6b414188a3eaf6442cf4282fcab
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfo.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index 0abe45ce448c..13539b855de2 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -17,6 +17,7 @@
package com.android.internal.telephony;
import android.annotation.UnsupportedAppUsage;
+import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
@@ -32,15 +33,15 @@ import android.provider.ContactsContract.PhoneLookup;
import android.provider.ContactsContract.RawContacts;
import android.telephony.PhoneNumberUtils;
import android.telephony.Rlog;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
-import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
import com.android.i18n.phonenumbers.NumberParseException;
import com.android.i18n.phonenumbers.PhoneNumberUtil;
import com.android.i18n.phonenumbers.Phonenumber.PhoneNumber;
-import android.telephony.SubscriptionManager;
+import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
import java.util.Locale;
@@ -112,6 +113,9 @@ public class CallerInfo {
public Uri contactRefUri;
public String lookupKey;
+ public ComponentName preferredPhoneAccountComponent;
+ public String preferredPhoneAccountId;
+
public long userType;
/**
@@ -264,6 +268,17 @@ public class CallerInfo {
info.contactDisplayPhotoUri = null;
}
+ columnIndex = cursor.getColumnIndex(Data.PREFERRED_PHONE_ACCOUNT_COMPONENT_NAME);
+ if ((columnIndex != -1) && (cursor.getString(columnIndex) != null)) {
+ info.preferredPhoneAccountComponent =
+ ComponentName.unflattenFromString(cursor.getString(columnIndex));
+ }
+
+ columnIndex = cursor.getColumnIndex(Data.PREFERRED_PHONE_ACCOUNT_ID);
+ if ((columnIndex != -1) && (cursor.getString(columnIndex) != null)) {
+ info.preferredPhoneAccountId = cursor.getString(columnIndex);
+ }
+
// look for the custom ringtone, create from the string stored
// in the database.
// An empty string ("") in the database indicates a silent ringtone,