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

Commit 72a73ea1 authored by Chad Brubaker's avatar Chad Brubaker
Browse files

Fix lockdown button placement

Test: Visually verified new placement
Change-Id: Ib57c8504d341bf07ef982000f714e2966d370336
Fixes: 72555245
parent 5fd1c97e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2482,9 +2482,9 @@
        <item>power</item>
        <item>restart</item>
        <item>logout</item>
        <item>lockdown</item>
        <item>bugreport</item>
        <item>users</item>
        <item>lockdown</item>
    </string-array>

    <!-- Number of milliseconds to hold a wake lock to ensure that drawing is fully
+6 −4
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
    private boolean mHasTelephony;
    private boolean mHasVibrator;
    private boolean mHasLogoutButton;
    private boolean mHasLockdownButton;
    private final boolean mShowSilentToggle;
    private final EmergencyAffordanceManager mEmergencyAffordanceManager;

@@ -303,6 +304,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,

        ArraySet<String> addedKeys = new ArraySet<String>();
        mHasLogoutButton = false;
        mHasLockdownButton = false;
        for (int i = 0; i < defaultActions.length; i++) {
            String actionKey = defaultActions[i];
            if (addedKeys.contains(actionKey)) {
@@ -333,6 +335,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                            Settings.Secure.LOCKDOWN_IN_POWER_MENU, 0) != 0
                        && shouldDisplayLockdown()) {
                    mItems.add(getLockdownAction());
                    mHasLockdownButton = true;
                }
            } else if (GLOBAL_ACTION_KEY_VOICEASSIST.equals(actionKey)) {
                mItems.add(getVoiceAssistAction());
@@ -829,10 +832,9 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        public View getView(int position, View convertView, ViewGroup parent) {
            Action action = getItem(position);
            View view = action.create(mContext, convertView, parent, LayoutInflater.from(mContext));
            // When there is no logout button, only power off and restart should be in white
            // background, thus setting division view at third item; with logout button being the
            // third item, set the division view at fourth item instead.
            if (position == (mHasLogoutButton ? 3 : 2)) {
            // Power off, restart, logout (if present) and lockdown (if present) should be in white
            // background. Set the division based on which buttons are currently being displayed.
            if (position == 2 + (mHasLogoutButton ? 1 : 0) + (mHasLockdownButton ? 1 : 0)) {
                HardwareUiLayout.get(parent).setDivisionView(view);
            }
            return view;