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

Commit 09289058 authored by Jacky Wang's avatar Jacky Wang Committed by Android (Google) Code Review
Browse files

Merge "Avoid potential ActivityNotFoundException" into main

parents 28d15518 1c486036
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -249,6 +249,15 @@ public abstract class DashboardFragment extends SettingsPreferenceFragment

    @Override
    public boolean onPreferenceTreeClick(Preference preference) {
        if (isCatalystEnabled()) {
            Intent intent = preference.getIntent();
            if (intent != null && preference.getContext().getPackageManager().queryIntentActivities(
                    intent, 0).isEmpty()) {
                Log.w(TAG, "No activity to start for " + intent);
                return true;
            }
        }

        final Collection<List<AbstractPreferenceController>> controllers =
                mPreferenceControllers.values();
        for (List<AbstractPreferenceController> controllerList : controllers) {