From 30f778eacd62b541c5aa7f15f0f0931dd7df96af Mon Sep 17 00:00:00 2001 From: Ido Ben-Hur Date: Wed, 1 May 2024 12:21:19 +0300 Subject: [PATCH] Settings: Fix regulatory info availability check queryIntentActivities will return something even if the activity is disabled directly check the flag that controls the enablement Signed-off-by: Pranav Vashi --- .../deviceinfo/RegulatoryInfoPreferenceController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceController.java b/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceController.java index c925c27c411..ac5e2430c2b 100644 --- a/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceController.java +++ b/src/com/android/settings/deviceinfo/RegulatoryInfoPreferenceController.java @@ -16,9 +16,8 @@ package com.android.settings.deviceinfo; import android.content.Context; -import android.content.Intent; -import android.provider.Settings; +import com.android.settings.R; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; @@ -26,7 +25,6 @@ public class RegulatoryInfoPreferenceController extends AbstractPreferenceContro PreferenceControllerMixin { private static final String KEY_REGULATORY_INFO = "regulatory_info"; - private static final Intent INTENT_PROBE = new Intent(Settings.ACTION_SHOW_REGULATORY_INFO); public RegulatoryInfoPreferenceController(Context context) { super(context); @@ -34,7 +32,7 @@ public class RegulatoryInfoPreferenceController extends AbstractPreferenceContro @Override public boolean isAvailable() { - return !mContext.getPackageManager().queryIntentActivities(INTENT_PROBE, 0).isEmpty(); + return mContext.getResources().getBoolean(R.bool.config_show_regulatory_info); } @Override