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

Commit 118aefcf authored by Vladislav Koldobskiy's avatar Vladislav Koldobskiy Committed by Gerrit Code Review
Browse files

Camera button support (1/2)

Add new bitmask for Camera button and "hasCamera" boolean.
For those devices that have dedicated Camera key
(like Sony ZL/ZR/Z1/...)

Change-Id: I1a6681664f9f3fd3f30221ba10b082cb5f8cafca
parent b6f13b6e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1235,6 +1235,7 @@
             4 - Menu
             8 - Assistant (search)
            16 - App switch
            32 - Camera
         For example, a device with Home, Back and Menu keys would set this
         config to 7. -->
    <integer name="config_deviceHardwareKeys">15</integer>
+2 −0
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private static final int KEY_MASK_MENU = 0x04;
    private static final int KEY_MASK_ASSIST = 0x08;
    private static final int KEY_MASK_APP_SWITCH = 0x10;
    private static final int KEY_MASK_CAMERA = 0x20;

    /**
     * These are the system UI flags that, when changing, can cause the layout
@@ -1163,6 +1164,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        final boolean hasHome = (mDeviceHardwareKeys & KEY_MASK_HOME) != 0;
        final boolean hasAssist = (mDeviceHardwareKeys & KEY_MASK_ASSIST) != 0;
        final boolean hasAppSwitch = (mDeviceHardwareKeys & KEY_MASK_APP_SWITCH) != 0;
        final boolean hasCamera = (mDeviceHardwareKeys & KEY_MASK_CAMERA) != 0;
        final ContentResolver resolver = mContext.getContentResolver();

        // initialize all assignments to sane defaults