From cd5953fad0144ec19e54a286b1331cea2df5df30 Mon Sep 17 00:00:00 2001 From: Bob Badour Date: Tue, 1 Feb 2022 15:37:07 -0800 Subject: [PATCH] Add support for library names. The new xmlnotice utility includes library names in the xml notice. Supports both the new and the old schema and allows mixing new and old. Bug: 151177513 Bug: 210912771 Test: m all dist Test: flash; About Phone -> Legal Information -> Third-party licenses Change-Id: I69c294a62d1653e9a0ff487e25b1d2eda0b777d3 --- .../license/LicenseHtmlGeneratorFromXml.java | 159 +++++++++++---- .../LicenseHtmlGeneratorFromXmlTest.java | 181 +++++++++++++++--- 2 files changed, 271 insertions(+), 69 deletions(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java index b4c95e6ee2dfa..2c2be0394b6e4 100644 --- a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java +++ b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java @@ -39,6 +39,8 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; import java.util.zip.GZIPInputStream; /** @@ -54,6 +56,7 @@ class LicenseHtmlGeneratorFromXml { private static final String TAG_FILE_NAME = "file-name"; private static final String TAG_FILE_CONTENT = "file-content"; private static final String ATTR_CONTENT_ID = "contentId"; + private static final String ATTR_LIBRARY_NAME = "lib"; private static final String HTML_HEAD_STRING = "\n" @@ -67,8 +70,12 @@ class LicenseHtmlGeneratorFromXml { + "\n" + "" + "\n" - + "
\n" - + "