diff options
author | Jay Shrauner <shrauner@google.com> | 2014-12-19 17:40:37 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-19 17:40:37 +0000 |
commit | 3977d4d124c3823b39d561c6a9e53ad88ccdcd90 (patch) | |
tree | ffdc0b44ea1d1831e4add053847253443f3c4f3c | |
parent | b6f6bbf4de119badbcf155956703e206faab5e7d (diff) | |
parent | 6d8c5edbab7a641558c233aa0df1259d2ab883b9 (diff) |
am 6d8c5edb: am 5413fd74: Merge "Handle SQLiteFullExceptions" into lmp-mr1-dev
* commit '6d8c5edbab7a641558c233aa0df1259d2ab883b9':
Handle SQLiteFullExceptions
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index aba00b036..bb20a1306 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.Loader; import android.content.res.Resources; import android.database.Cursor; +import android.database.sqlite.SQLiteFullException; import android.net.Uri; import android.os.Handler; import android.os.Message; @@ -31,6 +32,7 @@ import android.provider.ContactsContract.PhoneLookup; import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.AccessibilityDelegate; @@ -69,6 +71,7 @@ import java.util.LinkedList; */ public class CallLogAdapter extends GroupingListAdapter implements ViewTreeObserver.OnPreDrawListener, CallLogGroupBuilder.GroupCreator { + private static final String TAG = CallLogAdapter.class.getSimpleName(); private static final int VOICEMAIL_TRANSCRIPTION_MAX_LINES = 10; @@ -1183,14 +1186,18 @@ public class CallLogAdapter extends GroupingListAdapter if (!needsUpdate) return; - if (countryIso == null) { - mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, - Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL", - new String[]{ number }); - } else { - mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, - Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?", - new String[]{ number, countryIso }); + try { + if (countryIso == null) { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " IS NULL", + new String[]{ number }); + } else { + mContext.getContentResolver().update(Calls.CONTENT_URI_WITH_VOICEMAIL, values, + Calls.NUMBER + " = ? AND " + Calls.COUNTRY_ISO + " = ?", + new String[]{ number, countryIso }); + } + } catch (SQLiteFullException e) { + Log.e(TAG, "Unable to update contact info in call log db", e); } } |