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

Commit 30ede28d authored by Juffin Alex Varghese's avatar Juffin Alex Varghese
Browse files

Bluetooth-OPP: Avoid displaying two pop-ups in Tranfer History

This change will ensure that if context menu is created then no
need to execute onclick keyevent automatically. Otherwise, if user
selects options from context menu crash is observed in Bluetooth
app.

CRs-Fixed: 611782
Change-Id: I8328f87f9c4bc007cd46a5567268621499e35343
parent 479e909c
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;

@@ -182,12 +184,14 @@ public class BluetoothOppTransferHistory extends Activity implements
                updateNotificationWhenBtDisabled();
                return true;
        }
        mContextMenu = false;
        return false;
    }

    @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