From 71ef80eaf4f65e6d22bf807e1d029e177b57db11 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 15 Dec 2014 17:09:50 +0000 Subject: Add an item to "Legal information" screen for WebView license Similar to how it is done for other legal information items -- if there is an activity that serves android.settings.WEBVIEW_LICENSE intent, the item is shown with the title set to the activity's title, otherwise the item is hidden. Bug: 18729447 Change-Id: Ic5bad40c91e35fa3c8235128628413929ef111d3 --- src/com/android/settings/DeviceInfoSettings.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index b6d8fefe8..f79707a95 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -64,6 +64,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In private static final String KEY_TERMS = "terms"; private static final String KEY_LICENSE = "license"; private static final String KEY_COPYRIGHT = "copyright"; + private static final String KEY_WEBVIEW_LICENSE = "webview_license"; private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings"; private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal"; private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux"; @@ -144,6 +145,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_COPYRIGHT, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_WEBVIEW_LICENSE, + Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); // These are contained by the root preference screen parentPreference = getPreferenceScreen(); @@ -448,6 +451,9 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In if (!checkIntentAction(context, "android.settings.COPYRIGHT")) { keys.add(KEY_COPYRIGHT); } + if (!checkIntentAction(context, "android.settings.WEBVIEW_LICENSE")) { + keys.add(KEY_WEBVIEW_LICENSE); + } if (UserHandle.myUserId() != UserHandle.USER_OWNER) { keys.add(KEY_SYSTEM_UPDATE_SETTINGS); } -- cgit v1.2.3