Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c189414d authored by Chienyuan's avatar Chienyuan
Browse files

MAP: catch IllegalStateException for handleMsgListChanges

Cursor.get* functions will throw IllegalStateException
if the stored data is not in bounds. Alothough we already
check cursor != null and c.getColumnIndex(Mms._ID) should
be exist but it still happen. Catch IllegalStateException
to prevent bluetooth crash and get more detail error log.

Bug: 144585524
Test: manual
Change-Id: I5b6421d582b00f08823e6aea630368f8f2d2aaa2
parent b331f871
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1526,6 +1526,8 @@ public class BluetoothMapContentObserver {
                        }
                    } while (c.moveToNext());
                }
            } catch (IllegalStateException e) {
                Log.w(TAG, e);
            } finally {
                if (c != null) {
                    c.close();
@@ -1695,6 +1697,8 @@ public class BluetoothMapContentObserver {
                    } while (c.moveToNext());

                }
            } catch (IllegalStateException e) {
                Log.w(TAG, e);
            } finally {
                if (c != null) {
                    c.close();