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

Commit 062c814a authored by Ashutosh Srivastava's avatar Ashutosh Srivastava Committed by Ashutosh Srivastva
Browse files

AVRCP: Stop Fast forward and fast rewind

In A2dpMediaBrowserService.java, fast forward and fast rewind
were not stopping after pressing fast forward or fast rewind
key again. The issue was coming due to the sending of "button pressed"
key event again after sending "button released". The fix
is done by adding a "return" after sending button released.

Test: Manual testing by pressing fast forward/fast rewind
and then pressing it again to stop the operation

Change-Id: I2dc9a4c83d150b5ab8cec1281444a911d372b819
parent 8e2a967b
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -508,7 +508,17 @@ public class BluetoothMediaBrowserService extends MediaBrowserService {
        if (mCurrentlyHeldKey != 0) {
            mAvrcpCtrlSrvc.sendPassThroughCmd(mA2dpDevice, mCurrentlyHeldKey,
                    AvrcpControllerService.KEY_STATE_RELEASED);

            if (mCurrentlyHeldKey == cmd) {
                // Return to prevent starting FF/FR operation again
                mCurrentlyHeldKey = 0;
                return;
            } else {
                // FF/FR is in progress and other operation is desired
                // so after stopping FF/FR, not returning so that command
                // can be sent for the desired operation.
                mCurrentlyHeldKey = 0;
            }
        }

        // Send the pass through.