summaryrefslogtreecommitdiffstats
path: root/core/java/android/provider/CallLog.java
diff options
context:
space:
mode:
authorPauyl l Berman <w35028@motoolarola.com>2009-07-10 18:27:36 -0400
committerWink Saville <wink@google.com>2009-07-14 12:05:26 -0700
commite1dc2baee7e3c5cfc03cc573567c3146da24dab0 (patch)
treeb65d4cca92d469e66473c487c4601e9dfc51f3b4 /core/java/android/provider/CallLog.java
parent8f779f3b70aa4d3cee0dfde57ed91886e5c5f1e5 (diff)
downloadframeworks_base-e1dc2baee7e3c5cfc03cc573567c3146da24dab0.zip
frameworks_base-e1dc2baee7e3c5cfc03cc573567c3146da24dab0.tar.gz
frameworks_base-e1dc2baee7e3c5cfc03cc573567c3146da24dab0.tar.bz2
Fix CNAP-related NullPointerException
This will fix a CNAP-related bug where missing a call from a party with an "Unknown" number presentation and then trying to log that call will cause a NullPointerException to be thrown
Diffstat (limited to 'core/java/android/provider/CallLog.java')
-rw-r--r--core/java/android/provider/CallLog.java30
1 files changed, 8 insertions, 22 deletions
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 3d14af7..b54ad5d 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -151,34 +151,20 @@ public class CallLog {
int presentation, int callType, long start, int duration) {
final ContentResolver resolver = context.getContentResolver();
- // TODO(Moto): Which is correct: original code, this only changes the
- // number if the number is empty and never changes the caller info name.
- if (false) {
- if (TextUtils.isEmpty(number)) {
- if (presentation == Connection.PRESENTATION_RESTRICTED) {
- number = CallerInfo.PRIVATE_NUMBER;
- } else if (presentation == Connection.PRESENTATION_PAYPHONE) {
- number = CallerInfo.PAYPHONE_NUMBER;
- } else {
- number = CallerInfo.UNKNOWN_NUMBER;
- }
- }
- } else {
- // NEWCODE: From Motorola
-
- //If this is a private number then set the number to Private, otherwise check
- //if the number field is empty and set the number to Unavailable
+ // If this is a private number then set the number to Private, otherwise check
+ // if the number field is empty and set the number to Unavailable
if (presentation == Connection.PRESENTATION_RESTRICTED) {
number = CallerInfo.PRIVATE_NUMBER;
- ci.name = "";
+ if (ci != null) ci.name = "";
} else if (presentation == Connection.PRESENTATION_PAYPHONE) {
number = CallerInfo.PAYPHONE_NUMBER;
- ci.name = "";
- } else if (TextUtils.isEmpty(number) || presentation == Connection.PRESENTATION_UNKNOWN) {
+ if (ci != null) ci.name = "";
+ } else if (TextUtils.isEmpty(number)
+ || presentation == Connection.PRESENTATION_UNKNOWN) {
number = CallerInfo.UNKNOWN_NUMBER;
- ci.name = "";
+ if (ci != null) ci.name = "";
}
- }
+
ContentValues values = new ContentValues(5);
values.put(NUMBER, number);