diff options
author | Jay Shrauner <shrauner@google.com> | 2014-12-16 13:44:15 -0800 |
---|---|---|
committer | Natiq Ahmed <mnatiq@codeaurora.org> | 2015-03-13 15:00:39 +0530 |
commit | 437bf13281e745b765f7ae35e8b8a83e3ed7bee9 (patch) | |
tree | 5d4ac83e949960ebdb244c3a66fafec9f46c5168 | |
parent | 2fbc9855c3845486d4488a8f20cb1566610fadf8 (diff) | |
download | android_packages_apps_Dialer-437bf13281e745b765f7ae35e8b8a83e3ed7bee9.tar.gz android_packages_apps_Dialer-437bf13281e745b765f7ae35e8b8a83e3ed7bee9.tar.bz2 android_packages_apps_Dialer-437bf13281e745b765f7ae35e8b8a83e3ed7bee9.zip |
Handle SQLiteFullExceptions
Don't crash if unable to update the call log contact info cache because
the disk is full.
Bug:18770948
Change-Id: I4156581df0742d58ed28eeb0c767923e0bc78507
-rwxr-xr-x | 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 f7ca9ca54..b75461059 100755 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -23,6 +23,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.provider.CallLog.Calls; import android.provider.ContactsContract; @@ -31,6 +32,7 @@ import android.telecom.PhoneAccountHandle; import android.telephony.PhoneNumberUtils; import android.telephony.SubscriptionManager; import android.text.TextUtils; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.AccessibilityDelegate; @@ -70,6 +72,7 @@ import java.util.LinkedList; public class CallLogAdapter extends GroupingListAdapter implements CallLogAdapterHelper.Callback, CallLogGroupBuilder.GroupCreator { + private static final String TAG = CallLogAdapter.class.getSimpleName(); private static final int VOICEMAIL_TRANSCRIPTION_MAX_LINES = 10; /** The enumeration of {@link android.os.AsyncTask} objects used in this class. */ @@ -855,14 +858,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); } } |