summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Pusz <szymon@pusz.net>2015-04-21 20:36:40 +0200
committerSzymon Pusz <szymon@pusz.net>2015-04-21 20:36:40 +0200
commit208cef99ca75cdeeba019f9c25d604e07c547f70 (patch)
treeea5821f222553b1b1d640348f9452ada8eabf4de
parent58a28f74114b67d24ce02222deb61e6eab047064 (diff)
downloadandroid_packages_apps_Bluetooth-208cef99ca75cdeeba019f9c25d604e07c547f70.tar.gz
android_packages_apps_Bluetooth-208cef99ca75cdeeba019f9c25d604e07c547f70.tar.bz2
android_packages_apps_Bluetooth-208cef99ca75cdeeba019f9c25d604e07c547f70.zip
Bluetooth: fix StaleDataException when pairing with other devicestable/cm-12.1-YOG3C
This fixes a crash when pairing for example with car audio that reads sms/mms FATAL EXCEPTION: BluetoothMnsObexClient Process: com.android.bluetooth, PID: 1944 android.database.StaleDataException: Attempted to access a cursor after it has been closed. at android.database.BulkCursorToCursorAdaptor.throwIfCursorIsClosed(BulkCursorToCursorAdaptor.java:64) at android.database.BulkCursorToCursorAdaptor.getCount(BulkCursorToCursorAdaptor.java:70) at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197) at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245) at android.database.CursorWrapper.moveToNext(CursorWrapper.java:166) at com.android.bluetooth.map.BluetoothMapContentObserver.initMsgList(BluetoothMapContentObserver.java:405) at com.android.bluetooth.map.BluetoothMapContentObserver.registerObserver(BluetoothMapContentObserver.java:334) at com.android.bluetooth.map.BluetoothMnsObexClient.handleRegistration(BluetoothMnsObexClient.java:238) at com.android.bluetooth.map.BluetoothMnsObexClient$MnsObexClientHandler.handleMessage(BluetoothMnsObexClient.java:107) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.os.HandlerThread.run(HandlerThread.java:61) Change-Id: Idea00c396c2512480befbf262571c8d8242e4af7
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapContentObserver.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
index f8f1c2bbf..c31564297 100644
--- a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
+++ b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
@@ -396,8 +396,8 @@ public class BluetoothMapContentObserver {
mMsgListSms = msgListSms;
}
-
-
+ c = mResolver.query(Mms.CONTENT_URI,
+ MMS_PROJECTION, null, null, null);
HashMap<Long, Msg> msgListMms = new HashMap<Long, Msg>();