diff options
author | Roshan Pius <rpius@google.com> | 2015-07-15 22:26:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-15 22:26:55 +0000 |
commit | 06179c75c84476e96b99004fb677ef9d50dbcdfc (patch) | |
tree | a9686ead73eea8e3788e6b1b733c390cd342b078 /telephony/java/com/android | |
parent | d9ab0ca287a9ab1b5af19d70cb9b13e0e16cfcba (diff) | |
parent | 4e9c63cbe1712f750d5eaaa044e957c7f7696bf8 (diff) | |
download | frameworks_base-06179c75c84476e96b99004fb677ef9d50dbcdfc.zip frameworks_base-06179c75c84476e96b99004fb677ef9d50dbcdfc.tar.gz frameworks_base-06179c75c84476e96b99004fb677ef9d50dbcdfc.tar.bz2 |
am 4e9c63cb: Merge "Handle exceptions when accessing Content providers." into mnc-dev
* commit '4e9c63cbe1712f750d5eaaa044e957c7f7696bf8':
Handle exceptions when accessing Content providers.
Diffstat (limited to 'telephony/java/com/android')
-rw-r--r-- | telephony/java/com/android/internal/telephony/CallerInfo.java | 16 |
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; } /** |