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

Commit aeafcb20 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Fix Bluetooth crash when open the opp transfer history on the...

Merge "Merge "Fix Bluetooth crash when open the opp transfer history on the lock screen" am: 33010258 am: b1e2e1ed am: ca52d83a" into oc-mr1-dev-plus-aosp
parents 64f14b6b 522868a0
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) {