From 3daa259d8042b614539cc307c79ef07b526adb0d Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 18 Apr 2014 15:30:15 -0700 Subject: [PATCH] Disable regulatory info directly, not priority. Instead of using priority, offer to launch anyone handling the action, and use the boolean to control if Settings offers the UI. Bug: 13340779 Change-Id: Idb3f85c434414911f8911b7511b3a7a8029a8e06 --- AndroidManifest.xml | 5 +++-- src/com/android/settings/DeviceInfoSettings.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index df7d7ad6929..faa20b4c087 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1727,8 +1727,9 @@ - + android:excludeFromRecents="true" + android:enabled="@bool/config_show_regulatory_info"> + diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index 7e947415bc1..1e3b9a8f288 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -28,6 +28,7 @@ import android.os.UserHandle; import android.preference.Preference; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; +import android.provider.Settings; import android.util.Log; import android.widget.Toast; @@ -152,9 +153,14 @@ public class DeviceInfoSettings extends RestrictedSettingsFragment { removePreferenceIfBoolFalse(KEY_UPDATE_SETTING, R.bool.config_additional_system_update_setting_enable); - // Remove regulatory information if not enabled. - removePreferenceIfBoolFalse(KEY_REGULATORY_INFO, - R.bool.config_show_regulatory_info); + // Remove regulatory information if none present. + final Intent intent = new Intent(Settings.ACTION_SHOW_REGULATORY_INFO); + if (getPackageManager().queryIntentActivities(intent, 0).isEmpty()) { + Preference pref = findPreference(KEY_REGULATORY_INFO); + if (pref != null) { + getPreferenceScreen().removePreference(pref); + } + } } @Override