summaryrefslogtreecommitdiffstats
path: root/telephony/java/com/android
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2015-07-13 12:57:40 -0700
committerRoshan Pius <rpius@google.com>2015-07-14 11:20:42 -0700
commit93018a4d983f0c7063fd0b243436364cd191e0a9 (patch)
tree50f3a7acb3bda98e843adf0631985fc77daaa0ca /telephony/java/com/android
parent7e9cb0d094043bd8bdb7544c2356abd5479b7aee (diff)
downloadframeworks_base-93018a4d983f0c7063fd0b243436364cd191e0a9.zip
frameworks_base-93018a4d983f0c7063fd0b243436364cd191e0a9.tar.gz
frameworks_base-93018a4d983f0c7063fd0b243436364cd191e0a9.tar.bz2
Handle exceptions when accessing Content providers.
BUG: 21638129 Change-Id: I88f7dcf67e395f49136a1f434fbd9c75e15cddad
Diffstat (limited to 'telephony/java/com/android')
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfo.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java
index 5cd5d4e..be7e702 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfo.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfo.java
@@ -16,6 +16,7 @@
package com.android.internal.telephony;
+import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
@@ -282,10 +283,17 @@ public class CallerInfo {
* number. The returned CallerInfo is null if no number is supplied.
*/
public static CallerInfo getCallerInfo(Context context, Uri contactRef) {
-
- return getCallerInfo(context, contactRef,
- CallerInfoAsyncQuery.getCurrentProfileContentResolver(context)
- .query(contactRef, null, null, null, null));
+ CallerInfo info = null;
+ ContentResolver cr = CallerInfoAsyncQuery.getCurrentProfileContentResolver(context);
+ if (cr != null) {
+ try {
+ info = getCallerInfo(context, contactRef,
+ cr.query(contactRef, null, null, null, null));
+ } catch (RuntimeException re) {
+ Rlog.e(TAG, "Error getting caller info.", re);
+ }
+ }
+ return info;
}
/**