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

Commit 4150198a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Only allow BROWSABLE && DEFAULT Intents to be always opened" into rvc-qpr-dev am: 2884b150

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13307476

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8114629e431bafd2fba9235e78a2e037afdb7165
parents 8f89673b 2884b150
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ import static android.content.Intent.EXTRA_PACKAGE_NAME;
import static android.content.Intent.EXTRA_VERSION_CODE;
import static android.content.pm.PackageManager.CERT_INPUT_RAW_X509;
import static android.content.pm.PackageManager.CERT_INPUT_SHA256;
import static android.content.Intent.CATEGORY_BROWSABLE;
import static android.content.Intent.CATEGORY_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
@@ -7714,6 +7716,13 @@ public class PackageManagerService extends IPackageManager.Stub
                            Slog.i(TAG, "  + always: " + info.activityInfo.packageName
                                    + " : linkgen=" + linkGeneration);
                        }
                        if (!intent.hasCategory(CATEGORY_BROWSABLE)
                                || !intent.hasCategory(CATEGORY_DEFAULT)) {
                            undefinedList.add(info);
                            continue;
                        }
                        // Use link-enabled generation as preferredOrder, i.e.
                        // prefer newly-enabled over earlier-enabled.
                        info.preferredOrder = linkGeneration;