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

Commit 4a883a60 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Open app details for the correct user depending on the profile." into...

Merge "Open app details for the correct user depending on the profile." into rvc-dev am: fbf401e3 am: e60c6ba3 am: 4eb49cc9 am: 251bcd0b

Change-Id: I7eecdd176276d8ff73f1a0f1f3daf104426609d8
parents 8359fb6f 251bcd0b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1536,10 +1536,12 @@ public class ChooserActivity extends ResolverActivity implements
                labels.add(innerInfo.getResolveInfo().loadLabel(getPackageManager()));
            }
            f = new ResolverTargetActionsDialogFragment(mti.getDisplayLabel(), name,
                    mti.getTargets(), labels);
                    mti.getTargets(), labels,
                    mChooserMultiProfilePagerAdapter.getCurrentUserHandle());
        } else {
            f = new ResolverTargetActionsDialogFragment(
                    ti.getResolveInfo().loadLabel(getPackageManager()), name, pinned);
                    ti.getResolveInfo().loadLabel(getPackageManager()), name, pinned,
                    mChooserMultiProfilePagerAdapter.getCurrentUserHandle());
        }

        f.show(getFragmentManager(), TARGET_DETAILS_FRAGMENT_TAG);
+1 −1
Original line number Diff line number Diff line
@@ -1305,7 +1305,7 @@ public class ResolverActivity extends Activity implements
        Intent in = new Intent().setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
                .setData(Uri.fromParts("package", ri.activityInfo.packageName, null))
                .addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
        startActivity(in);
        startActivityAsUser(in, mMultiProfilePagerAdapter.getCurrentUserHandle());
    }

    @VisibleForTesting
+8 −3
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;

import com.android.internal.R;
@@ -43,6 +44,7 @@ public class ResolverTargetActionsDialogFragment extends DialogFragment
    private static final String NAME_KEY = "componentName";
    private static final String TITLE_KEY = "title";
    private static final String PINNED_KEY = "pinned";
    private static final String USER_ID_KEY = "userId";

    // Sync with R.array.resolver_target_actions_* resources
    private static final int TOGGLE_PIN_INDEX = 0;
@@ -56,19 +58,21 @@ public class ResolverTargetActionsDialogFragment extends DialogFragment
    }

    public ResolverTargetActionsDialogFragment(CharSequence title, ComponentName name,
            boolean pinned) {
            boolean pinned, UserHandle userHandle) {
        Bundle args = new Bundle();
        args.putCharSequence(TITLE_KEY, title);
        args.putParcelable(NAME_KEY, name);
        args.putBoolean(PINNED_KEY, pinned);
        args.putParcelable(USER_ID_KEY, userHandle);
        setArguments(args);
    }

    public ResolverTargetActionsDialogFragment(CharSequence title, ComponentName name,
            List<DisplayResolveInfo> targets, List<CharSequence> labels) {
            List<DisplayResolveInfo> targets, List<CharSequence> labels, UserHandle userHandle) {
        Bundle args = new Bundle();
        args.putCharSequence(TITLE_KEY, title);
        args.putParcelable(NAME_KEY, name);
        args.putParcelable(USER_ID_KEY, userHandle);
        mTargetInfos = targets;
        mLabels = labels;
        setArguments(args);
@@ -122,7 +126,8 @@ public class ResolverTargetActionsDialogFragment extends DialogFragment
            Intent in = new Intent().setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
                    .setData(Uri.fromParts("package", name.getPackageName(), null))
                    .addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT);
            startActivity(in);
            UserHandle userHandle = args.getParcelable(USER_ID_KEY);
            getActivity().startActivityAsUser(in, userHandle);
        }
        dismiss();
    }