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

Commit 522868a0 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...

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

Change-Id: I4ce6d1e143caa5f07887ea678e1fd33ef4798ca2
parents 77f0b448 ca52d83a
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) {