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

Commit ca52d83a authored by ilbeom.kim's avatar ilbeom.kim Committed by android-build-merger
Browse files

Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen" am: 33010258

am: b1e2e1ed

Change-Id: I63864e350825764cc633e2807abd042c8413fa07
parents c0f9fafe b1e2e1ed
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
@@ -118,11 +119,12 @@ public class BluetoothOppTransferHistory extends Activity implements

        final String sortOrder = BluetoothShare.TIMESTAMP + " DESC";

        mTransferCursor = managedQuery(BluetoothShare.CONTENT_URI, new String[] {
                "_id", BluetoothShare.FILENAME_HINT, BluetoothShare.STATUS,
        mTransferCursor = getContentResolver().query(BluetoothShare.CONTENT_URI,
                new String[] {"_id", BluetoothShare.FILENAME_HINT, BluetoothShare.STATUS,
                        BluetoothShare.TOTAL_BYTES, BluetoothShare._DATA, BluetoothShare.TIMESTAMP,
                BluetoothShare.VISIBILITY, BluetoothShare.DESTINATION, BluetoothShare.DIRECTION
        }, selection, sortOrder);
                        BluetoothShare.VISIBILITY, BluetoothShare.DESTINATION,
                        BluetoothShare.DIRECTION},
                selection, null, sortOrder);

        // only attach everything to the listbox if we can access
        // the transfer database. Otherwise, just show it empty
@@ -192,6 +194,14 @@ public class BluetoothOppTransferHistory extends Activity implements
        return false;
    }

    @Override
    protected void onDestroy() {
        if (mTransferCursor != null) {
            mTransferCursor.close();
        }
        super.onDestroy();
    }

    @Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
        if (mTransferCursor != null) {