Sometimes its a non-sql exception that gets thrown in the phone state receiver

pull/14/head
Sam Bosley 13 years ago
parent 2c081f043f
commit 2b1cc31f1b

@ -11,7 +11,6 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.net.Uri; import android.net.Uri;
import android.provider.CallLog.Calls; import android.provider.CallLog.Calls;
import android.provider.ContactsContract; import android.provider.ContactsContract;
@ -66,7 +65,7 @@ public class PhoneStateChangedReceiver extends BroadcastReceiver {
new String[] { Integer.toString(Calls.MISSED_TYPE), "1" }, new String[] { Integer.toString(Calls.MISSED_TYPE), "1" },
Calls.DATE + " DESC" Calls.DATE + " DESC"
); );
} catch (SQLiteException e) { // Sometimes database is locked, retry once } catch (Exception e) { // Sometimes database is locked, retry once
AndroidUtilities.sleepDeep(300L); AndroidUtilities.sleepDeep(300L);
try { try {
calls = context.getContentResolver().query( calls = context.getContentResolver().query(
@ -76,7 +75,7 @@ public class PhoneStateChangedReceiver extends BroadcastReceiver {
new String[] { Integer.toString(Calls.MISSED_TYPE), "1" }, new String[] { Integer.toString(Calls.MISSED_TYPE), "1" },
Calls.DATE + " DESC" Calls.DATE + " DESC"
); );
} catch (SQLiteException e2) { } catch (Exception e2) {
calls = null; calls = null;
} }
} }

Loading…
Cancel
Save