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

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

Merge "Only allow BROWSABLE && DEFAULT Intents to be always opened" into oc-mr1-dev

parents e3f76444 2565d0b3
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,8 @@ import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.REQUEST_DELETE_PACKAGES;
import static android.Manifest.permission.REQUEST_DELETE_PACKAGES;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
import static android.Manifest.permission.WRITE_MEDIA_STORAGE;
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_DEFAULT;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
@@ -7881,6 +7883,13 @@ public class PackageManagerService extends IPackageManager.Stub
                            Slog.i(TAG, "  + always: " + info.activityInfo.packageName
                            Slog.i(TAG, "  + always: " + info.activityInfo.packageName
                                    + " : linkgen=" + linkGeneration);
                                    + " : linkgen=" + linkGeneration);
                        }
                        }
                        if (!intent.hasCategory(CATEGORY_BROWSABLE)
                                || !intent.hasCategory(CATEGORY_DEFAULT)) {
                            undefinedList.add(info);
                            continue;
                        }
                        // Use link-enabled generation as preferredOrder, i.e.
                        // Use link-enabled generation as preferredOrder, i.e.
                        // prefer newly-enabled over earlier-enabled.
                        // prefer newly-enabled over earlier-enabled.
                        info.preferredOrder = linkGeneration;
                        info.preferredOrder = linkGeneration;