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 <neobuddy89@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user