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

Commit 343fb83d authored by Sara Ting's avatar Sara Ting
Browse files

Fix a Cursor leak.

Bug:6516932
Change-Id: I493e5c84a58c9582b7e47530f80b2860fe4f3459
parent 585cbcad
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -200,10 +200,17 @@ public class AllInOneActivity extends Activity implements EventHandler,
        @Override
        @Override
        protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
        protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
            mCheckForAccounts = false;
            mCheckForAccounts = false;
            try {
                // If the query didn't return a cursor for some reason return
                // If the query didn't return a cursor for some reason return
                if (cursor == null || cursor.getCount() > 0 || isFinishing()) {
                if (cursor == null || cursor.getCount() > 0 || isFinishing()) {
                    return;
                    return;
                }
                }
            } finally {
                if (cursor != null) {
                    cursor.close();
                }
            }

            Bundle options = new Bundle();
            Bundle options = new Bundle();
            options.putCharSequence("introMessage",
            options.putCharSequence("introMessage",
                    getResources().getString(R.string.create_an_account_desc));
                    getResources().getString(R.string.create_an_account_desc));