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

Commit cb7fc581 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

Bluetooth-OPP: Handle HID mouse right click event

This change will handle mouse right click event to display only
context menu with options Open and Clear. Otherwise, during HID mouse
right click two popup will be displayed context menu and Open option
while selecting context menu, option app crash is observed.

Change-Id: I8328f87f9c4bc007cd46a5567268621499e35343
parent ce02971a
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ public class BluetoothOppTransferHistory extends Activity implements

    private boolean mShowAllIncoming;

    private boolean mContextMenu = false;

    /** Class to handle Notification Manager updates */
    private BluetoothOppNotification mNotifier;

@@ -136,6 +138,7 @@ public class BluetoothOppTransferHistory extends Activity implements
        }

        mNotifier = new BluetoothOppNotification(this);
        mContextMenu = false;
    }

    @Override
@@ -188,6 +191,7 @@ public class BluetoothOppTransferHistory extends Activity implements
    @Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
        if (mTransferCursor != null) {
            mContextMenu = true;
            AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;
            mTransferCursor.moveToPosition(info.position);
            mContextMenuPosition = info.position;
@@ -263,10 +267,14 @@ public class BluetoothOppTransferHistory extends Activity implements
     */
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        // Open the selected item
        if (V) Log.v(TAG, "onItemClick: ContextMenu = " + mContextMenu);
        if (!mContextMenu) {
            mTransferCursor.moveToPosition(position);
            openCompleteTransfer();
            updateNotificationWhenBtDisabled();
        }
        mContextMenu = false;
    }

    /**
     * Open the selected finished transfer. mDownloadCursor must be moved to