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

Commit ebbaa23c authored by Sally Yuen's avatar Sally Yuen Committed by Automerger Merge Worker
Browse files

Merge "Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service" into...

Merge "Support sending KEYCODE_HEADSETHOOK KeyEvent from an a11y service" into rvc-dev am: fdea8712 am: 2e4c2910 am: 319cee50 am: 8b724cd5

Change-Id: I10c4cdd229c45b9e02963af7b657585c198ec3ac
parents b320b87f 8b724cd5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -496,6 +496,13 @@ public abstract class AccessibilityService extends Service {
     */
    public static final int GLOBAL_ACTION_TAKE_SCREENSHOT = 9;

    /**
     * Action to send the KEYCODE_HEADSETHOOK KeyEvent, which is used to answer/hang up calls and
     * play/stop media
     * @hide
     */
    public static final int GLOBAL_ACTION_KEYCODE_HEADSETHOOK = 10;

    private static final String LOG_TAG = "AccessibilityService";

    /**
+3 −0
Original line number Diff line number Diff line
@@ -301,6 +301,9 @@ public class SystemActionPerformer {
                    return lockScreen();
                case AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT:
                    return takeScreenshot();
                case AccessibilityService.GLOBAL_ACTION_KEYCODE_HEADSETHOOK :
                    sendDownAndUpKeyEvents(KeyEvent.KEYCODE_HEADSETHOOK);
                    return true;
                default:
                    return false;
            }