diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 6d990b7d5a3..f72aa8ecdda 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2665,7 +2665,7 @@ diff --git a/res/values/strings.xml b/res/values/strings.xml index 7c1314689e9..06cc4040130 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3011,8 +3011,10 @@ Contributors Manual - - Regulatory information + + Regulatory labels + + Safety & regulatory information Copyright diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml index e52712d1940..7ec8a4db770 100644 --- a/res/xml/device_info_settings.xml +++ b/res/xml/device_info_settings.xml @@ -56,10 +56,16 @@ + android:title="@string/regulatory_labels"> + + + + diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index ff7334bc344..19c4a3f74b9 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -175,14 +175,12 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In // Remove manual entry if none present. removePreferenceIfBoolFalse(KEY_MANUAL, R.bool.config_show_manual); - // 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); - } - } + // Remove regulatory labels if no activity present to handle intent. + removePreferenceIfActivityMissing( + KEY_REGULATORY_INFO, Settings.ACTION_SHOW_REGULATORY_INFO); + + removePreferenceIfActivityMissing( + "safety_info", "android.settings.SHOW_SAFETY_AND_REGULATORY_INFO"); } @Override @@ -327,6 +325,16 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In } } + private void removePreferenceIfActivityMissing(String preferenceKey, String action) { + final Intent intent = new Intent(action); + if (getPackageManager().queryIntentActivities(intent, 0).isEmpty()) { + Preference pref = findPreference(preferenceKey); + if (pref != null) { + getPreferenceScreen().removePreference(pref); + } + } + } + private void removePreferenceIfBoolFalse(String preference, int resId) { if (!getResources().getBoolean(resId)) { Preference pref = findPreference(preference); diff --git a/src/com/android/settings/RegulatoryInfoDisplayActivity.java b/src/com/android/settings/RegulatoryInfoDisplayActivity.java index c674f13f1a1..fd94b677f98 100644 --- a/src/com/android/settings/RegulatoryInfoDisplayActivity.java +++ b/src/com/android/settings/RegulatoryInfoDisplayActivity.java @@ -56,7 +56,7 @@ public class RegulatoryInfoDisplayActivity extends Activity implements } AlertDialog.Builder builder = new AlertDialog.Builder(this) - .setTitle(R.string.regulatory_information) + .setTitle(R.string.regulatory_labels) .setOnDismissListener(this); boolean regulatoryInfoDrawableExists = false;