Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Bluetooth
Commits
4f97a7a9
Commit
4f97a7a9
authored
14 years ago
by
Conley Owens
Committed by
Android Code Review
14 years ago
Browse files
Options
Download
Plain Diff
Merge "pullVcard of unknown phone number"
parents
c50dbb00
0fdf5a12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
.../android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
+10
-2
src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
...com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
+7
-1
No files found.
src/com/android/bluetooth/pbap/BluetoothPbapCallLogComposer.java
View file @
4f97a7a9
...
...
@@ -16,6 +16,7 @@
package
com.android.bluetooth.pbap
;
import
com.android.bluetooth.R
;
import
com.android.internal.telephony.CallerInfo
;
import
android.content.ContentResolver
;
import
android.content.Context
;
...
...
@@ -191,14 +192,21 @@ public class BluetoothPbapCallLogComposer {
final
VCardBuilder
builder
=
new
VCardBuilder
(
vcardType
);
String
name
=
mCursor
.
getString
(
CALLER_NAME_COLUMN_INDEX
);
if
(
TextUtils
.
isEmpty
(
name
))
{
name
=
mCursor
.
getString
(
NUMBER_COLUMN_INDEX
);
name
=
""
;
}
if
(
CallerInfo
.
UNKNOWN_NUMBER
.
equals
(
name
)
||
CallerInfo
.
PRIVATE_NUMBER
.
equals
(
name
)
||
CallerInfo
.
PAYPHONE_NUMBER
.
equals
(
name
))
{
// setting name to "" as FN/N must be empty fields in this case.
name
=
""
;
}
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
(
number
.
equals
(
"-1"
))
{
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
);
...
...
This diff is collapsed.
Click to expand it.
src/com/android/bluetooth/pbap/BluetoothPbapVcardManager.java
View file @
4f97a7a9
...
...
@@ -50,6 +50,7 @@ import android.text.TextUtils;
import
android.util.Log
;
import
com.android.bluetooth.R
;
import
com.android.internal.telephony.CallerInfo
;
import
java.io.IOException
;
import
java.io.OutputStream
;
...
...
@@ -182,8 +183,13 @@ public class BluetoothPbapVcardManager {
callCursor
.
moveToNext
())
{
String
name
=
callCursor
.
getString
(
CALLS_NAME_COLUMN_INDEX
);
if
(
TextUtils
.
isEmpty
(
name
))
{
// name not found,use number instead
// name not found,
use number instead
name
=
callCursor
.
getString
(
CALLS_NUMBER_COLUMN_INDEX
);
if
(
CallerInfo
.
UNKNOWN_NUMBER
.
equals
(
name
)
||
CallerInfo
.
PRIVATE_NUMBER
.
equals
(
name
)
||
CallerInfo
.
PAYPHONE_NUMBER
.
equals
(
name
))
{
name
=
mContext
.
getString
(
R
.
string
.
unknownNumber
);
}
}
list
.
add
(
name
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment