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

Commit ca10a37a authored by Vladislav Koldobskiy's avatar Vladislav Koldobskiy
Browse files

Camera button support: make it actually work

Previous commits were merged so fast that I didn't even
added the code that actually DOES launch the camera.
Let me fix that.

Change-Id: I4fcb3c46e5fd50e273dcf19fd3eb35a3f9d979e0
parent 118aefcf
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -3156,6 +3156,7 @@ public final class Settings {
          * 3 - Search
          * 4 - Voice search
          * 5 - In-app search
          * 6 - Launch Camera
          * @hide
          */
         public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action";
@@ -3225,6 +3226,21 @@ public final class Settings {
          */
         public static final String KEY_APP_SWITCH_LONG_PRESS_ACTION = "key_app_switch_long_press_action";

         /**
          * Action to perform when the Camera key is pressed. (Default is 0)
          * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
          * @hide
          */
         public static final String KEY_CAMERA_ACTION = "key_camera_action";

         /**
          * Action to perform when the Camera key is long-pressed. (Default is 6)
          * (See KEY_HOME_LONG_PRESS_ACTION for valid values)
          * @hide
          */
         public static final String KEY_CAMERA_LONG_PRESS_ACTION = "key_camera_long_press_action";


        /**
         * Control the display of the action overflow button within app UI.
         * 0 = use system default
+4 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private static final int KEY_ACTION_SEARCH = 3;
    private static final int KEY_ACTION_VOICE_SEARCH = 4;
    private static final int KEY_ACTION_IN_APP_SEARCH = 5;
    private static final int KEY_ACTION_LAUNCH_CAMERA = 6;

    // Masks for checking presence of hardware keys.
    // Must match values in core/res/res/values/config.xml
@@ -972,6 +973,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KEY_ACTION_IN_APP_SEARCH:
                triggerVirtualKeypress(KeyEvent.KEYCODE_SEARCH);
                break;
            case KEY_ACTION_LAUNCH_CAMERA:
                triggerVirtualKeypress(KeyEvent.KEYCODE_CAMERA);
                break;
            default:
                break;
        }