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

Commit 8d63521c authored by Danesh M's avatar Danesh M Committed by Jorge Ruesga
Browse files

CMFileManager : Dismiss shortcutActivity before proceeding

Issue reproduction steps :

Create shortcut to a file
Launch it
Press back

The shortcut activity never gets dismissed under certain conditions,
this takes care of those.

Change-Id: Ieca832fbb9f70ec54e1dbe22e9b1eac83f633baf
parent 8db689f8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -314,6 +314,9 @@ public final class IntentsActionPolicy extends ActionsPolicy {
        // No registered application
        if (info.size() == 0) {
            DialogHelper.showToast(ctx, R.string.msgs_not_registered_app, Toast.LENGTH_SHORT);
            if (onDismissListener != null) {
                onDismissListener.onDismiss(null);
            }
            return;
        }

@@ -327,12 +330,18 @@ public final class IntentsActionPolicy extends ActionsPolicy {
        // If we have a preferred application, then use it
        if (!choose && (mPreferredInfo  != null && mPreferredInfo.match != 0)) {
            ctx.startActivity(getIntentFromResolveInfo(mPreferredInfo, intent));
            if (onDismissListener != null) {
                onDismissListener.onDismiss(null);
            }
            return;
        }
        // If there are only one activity (app or internal editor), then use it
        if (!choose && info.size() == 1) {
            ResolveInfo ri = info.get(0);
            ctx.startActivity(getIntentFromResolveInfo(ri, intent));
            if (onDismissListener != null) {
                onDismissListener.onDismiss(null);
            }
            return;
        }