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

Commit dce675c1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add intent fields when launching instant app." into pi-dev

parents 83d9047e c08984be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -147,7 +147,10 @@ public class InstantAppButtonsPreferenceController extends BasePreferenceControl
        if (!TextUtils.isEmpty(mLaunchUri)) {
            installButton.setVisibility(View.GONE);
            final Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.addCategory(Intent.CATEGORY_BROWSABLE);
            intent.setPackage(mPackageName);
            intent.setData(Uri.parse(mLaunchUri));
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            launchButton.setOnClickListener(v -> mParent.startActivity(intent));
        } else {
            launchButton.setVisibility(View.GONE);
+3 −0
Original line number Diff line number Diff line
@@ -262,6 +262,9 @@ public class InstantAppButtonsPreferenceControllerTest {

        verify(mFragment).startActivity(argThat(intent-> intent != null
            && intent.getAction().equals(Intent.ACTION_VIEW)
            && intent.hasCategory(Intent.CATEGORY_BROWSABLE)
            && (intent.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK) != 0
            && TextUtils.equals(intent.getPackage(), TEST_AIA_PACKAGE_NAME)
            && TextUtils.equals(intent.getDataString(), launchUri)));
    }