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

Commit 6f986a39 authored by Ivan Chiang's avatar Ivan Chiang
Browse files

[PM] Hide the button if there is no entry in Install Success

Flag: android.content.pm.use_pia_v2
Test: atest CtsPackageInstallTestCases
Bug: 433397018
Change-Id: I55a958a4e695172e79ceed99b70c00b58a938dec
parent 2fdf5019
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -363,12 +363,18 @@ public class InstallationFragment extends DialogFragment {

        // If there is an activity entry, show the positive button
        final Intent resultIntent = installStage.getResultIntent();
        boolean hasEntry = false;
        if (resultIntent != null) {
            final List<ResolveInfo> list =
                    requireContext().getPackageManager().queryIntentActivities(resultIntent, 0);
            if (!list.isEmpty()) {
                hasEntry = true;
            }
        }

        Button positiveButton = UiUtil.getAlertDialogPositiveButton(dialog);
        if (positiveButton != null) {
            if (hasEntry) {
                positiveButton.setVisibility(View.VISIBLE);
                UiUtil.applyFilledButtonStyle(requireContext(), positiveButton);
                positiveButton.setText(R.string.button_open);
@@ -377,7 +383,8 @@ public class InstallationFragment extends DialogFragment {
                            + installStage.getAppLabel());
                    mInstallActionListener.openInstalledApp(resultIntent);
                });
                }
            } else {
                positiveButton.setVisibility(View.GONE);
            }
        }