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

Commit b199e20a authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Enable unpausing apps from the workspace.

Fixes: 188675002
Test: manual
Change-Id: I02715450016e9b91fff774525b5e32c337c74547
parent 81f5ff3b
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -271,9 +271,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
            });
        } else if (tag instanceof WorkspaceItemInfo) {
            WorkspaceItemInfo info = (WorkspaceItemInfo) tag;
            if (info.isDisabled()) {
                ItemClickHandler.handleDisabledItemClicked(info, this);
            } else {
            if (!(info.isDisabled() && ItemClickHandler.handleDisabledItemClicked(info, this))) {
                Intent intent = new Intent(info.getIntent())
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                try {
+7 −4
Original line number Diff line number Diff line
@@ -196,8 +196,10 @@ public class ItemClickHandler {

    /**
     * Handles clicking on a disabled shortcut
     *
     * @return true iff the disabled item click has been handled.
     */
    public static void handleDisabledItemClicked(WorkspaceItemInfo shortcut, Context context) {
    public static boolean handleDisabledItemClicked(WorkspaceItemInfo shortcut, Context context) {
        final int disabledFlags = shortcut.runtimeStatusFlags
                & WorkspaceItemInfo.FLAG_DISABLED_MASK;
        if ((disabledFlags
@@ -205,11 +207,12 @@ public class ItemClickHandler {
                & ~FLAG_DISABLED_QUIET_USER) == 0) {
            // If the app is only disabled because of the above flags, launch activity anyway.
            // Framework will tell the user why the app is suspended.
            return false;
        } else {
            if (!TextUtils.isEmpty(shortcut.disabledMessage)) {
                // Use a message specific to this shortcut, if it has one.
                Toast.makeText(context, shortcut.disabledMessage, Toast.LENGTH_SHORT).show();
                return;
                return true;
            }
            // Otherwise just use a generic error message.
            int error = R.string.activity_not_available;
@@ -220,6 +223,7 @@ public class ItemClickHandler {
                error = R.string.shortcut_not_available;
            }
            Toast.makeText(context, error, Toast.LENGTH_SHORT).show();
            return true;
        }
    }

@@ -229,8 +233,7 @@ public class ItemClickHandler {
     * @param v The view that was clicked. Must be a tagged with a {@link WorkspaceItemInfo}.
     */
    public static void onClickAppShortcut(View v, WorkspaceItemInfo shortcut, Launcher launcher) {
        if (shortcut.isDisabled()) {
            handleDisabledItemClicked(shortcut, launcher);
        if (shortcut.isDisabled() && handleDisabledItemClicked(shortcut, launcher)) {
            return;
        }