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

Commit 1c46c2d7 authored by Justin Koh's avatar Justin Koh
Browse files

If there is only 1 simple global action, autolaunch it

Requested by UX. Also made settings available before provisioning
Bug: 14683740
Bug: 14886954

Change-Id: If62ccc6472a72b7adb4d309ee89e51069f8e0413
parent c5df4d0e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -21,9 +21,8 @@
     for watch products.  Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- Only show power and settings items due to smaller real estate. -->
    <!-- Only show settings item due to smaller real estate. -->
    <string-array translatable="false" name="config_globalActionsList">
        <item>power</item>
        <item>settings</item>
    </string-array>

+13 −6
Original line number Diff line number Diff line
@@ -182,12 +182,18 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
        mDialog = createDialog();
        prepareDialog();

        // If we only have 1 item and it's a simple press action, just do this action.
        if (mAdapter.getCount() == 1
                && mAdapter.getItem(0) instanceof SinglePressAction) {
            ((SinglePressAction) mAdapter.getItem(0)).onPress();
        } else {
            WindowManager.LayoutParams attrs = mDialog.getWindow().getAttributes();
            attrs.setTitle("GlobalActions");
            mDialog.getWindow().setAttributes(attrs);
            mDialog.show();
            mDialog.getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_DISABLE_EXPAND);
        }
    }

    /**
     * Create the global actions dialog.
@@ -397,7 +403,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac

            @Override
            public boolean showBeforeProvisioning() {
                return false;
                return true;
            }
        };
    }
@@ -1021,6 +1027,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
                mEnableAccessibilityController = null;
                super.setCanceledOnTouchOutside(true);
            }

            super.onStart();
        }