summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2013-06-10 12:03:34 -0700
committerJay Shrauner <shrauner@google.com>2013-06-13 11:08:54 -0700
commit9674eb043aeb1474aa23ddd0739e3b8f05432630 (patch)
tree7bc8aedd5d96e979f065e3ccabeeac0e90c6d989 /src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
parent7ae5a9d9e9f2db317f42ec1fc203c565fd437c51 (diff)
downloadandroid_packages_apps_Bluetooth-9674eb043aeb1474aa23ddd0739e3b8f05432630.tar.gz
android_packages_apps_Bluetooth-9674eb043aeb1474aa23ddd0739e3b8f05432630.tar.bz2
android_packages_apps_Bluetooth-9674eb043aeb1474aa23ddd0739e3b8f05432630.zip
Use new CallLog number presentation column
Switch to using new number presentation column in the CallLog table. Bug:6948882 Change-Id: I5df2969465c19f2357dbbc3266315e020e30476e
Diffstat (limited to 'src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java')
-rw-r--r--src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java b/src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
index fa0c8b2db..d91d9a2f6 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
@@ -16,7 +16,6 @@
package com.android.bluetooth.pbap;
import com.android.bluetooth.R;
-import com.android.internal.telephony.CallerInfo;
import android.content.ContentResolver;
import android.content.Context;
@@ -60,7 +59,7 @@ public class BluetoothPbapCallLogComposer {
/** The projection to use when querying the call log table */
private static final String[] sCallLogProjection = new String[] {
Calls.NUMBER, Calls.DATE, Calls.TYPE, Calls.CACHED_NAME, Calls.CACHED_NUMBER_TYPE,
- Calls.CACHED_NUMBER_LABEL
+ Calls.CACHED_NUMBER_LABEL, Calls.NUMBER_PRESENTATION
};
private static final int NUMBER_COLUMN_INDEX = 0;
private static final int DATE_COLUMN_INDEX = 1;
@@ -68,6 +67,7 @@ public class BluetoothPbapCallLogComposer {
private static final int CALLER_NAME_COLUMN_INDEX = 3;
private static final int CALLER_NUMBERTYPE_COLUMN_INDEX = 4;
private static final int CALLER_NUMBERLABEL_COLUMN_INDEX = 5;
+ private static final int NUMBER_PRESENTATION_COLUMN_INDEX = 6;
// Property for call log entry
private static final String VCARD_PROPERTY_X_TIMESTAMP = "X-IRMC-CALL-DATETIME";
@@ -139,24 +139,22 @@ public class BluetoothPbapCallLogComposer {
VCardConfig.FLAG_REFRAIN_PHONE_NUMBER_FORMATTING;
final VCardBuilder builder = new VCardBuilder(vcardType);
String name = mCursor.getString(CALLER_NAME_COLUMN_INDEX);
+ String number = mCursor.getString(NUMBER_COLUMN_INDEX);
+ final int numberPresentation = mCursor.getInt(NUMBER_PRESENTATION_COLUMN_INDEX);
if (TextUtils.isEmpty(name)) {
name = "";
}
- if (CallerInfo.UNKNOWN_NUMBER.equals(name) || CallerInfo.PRIVATE_NUMBER.equals(name) ||
- CallerInfo.PAYPHONE_NUMBER.equals(name)) {
+ if (numberPresentation != Calls.PRESENTATION_ALLOWED) {
// setting name to "" as FN/N must be empty fields in this case.
name = "";
+ // TODO: there are really 3 possible strings that could be set here:
+ // "unknown", "private", and "payphone".
+ number = mContext.getString(R.string.unknownNumber);
}
final boolean needCharset = !(VCardUtils.containsOnlyPrintableAscii(name));
builder.appendLine(VCardConstants.PROPERTY_FN, name, needCharset, false);
builder.appendLine(VCardConstants.PROPERTY_N, name, needCharset, false);
- String number = mCursor.getString(NUMBER_COLUMN_INDEX);
- if (CallerInfo.UNKNOWN_NUMBER.equals(number) ||
- CallerInfo.PRIVATE_NUMBER.equals(number) ||
- CallerInfo.PAYPHONE_NUMBER.equals(number)) {
- number = mContext.getString(R.string.unknownNumber);
- }
final int type = mCursor.getInt(CALLER_NUMBERTYPE_COLUMN_INDEX);
String label = mCursor.getString(CALLER_NUMBERLABEL_COLUMN_INDEX);
if (TextUtils.isEmpty(label)) {