diff --git a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java
index c7eb68240c5b3..aaa6dd53a7d0e 100644
--- a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java
+++ b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXml.java
@@ -361,10 +361,15 @@ class LicenseHtmlGeneratorFromXml {
writer.println(HTML_MIDDLE_STRING);
- count = 0;
// Prints all contents of the license files in order of id.
for (ContentIdAndFileNames contentIdAndFileNames : contentIdAndFileNamesList) {
- writer.format("
\n", id);
for (Map.Entry> libraryFiles :
contentIdAndFileNames.mLibraryToFileNameMap.entrySet()) {
String libraryName = libraryFiles.getKey();
@@ -379,7 +384,6 @@ class LicenseHtmlGeneratorFromXml {
writer.format("%s \n", fileName);
}
writer.println("");
- count++;
}
writer.println("");
writer.println(contentIdToFileContentMap.get(
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
index 09b0d7f56e18c..7ce04f91458c0 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
@@ -116,6 +116,7 @@ public class LicenseHtmlGeneratorFromXmlTest {
+ "/file0 - libA\n"
+ "/file0 - libB\n"
+ "/file1 - libA\n"
+ + "/file2 - libC\n"
+ "\n"
+ "\n"
+ "\n"
@@ -125,6 +126,10 @@ public class LicenseHtmlGeneratorFromXmlTest {
+ "/file0 \n"
+ "/file1 \n"
+ "\n"
+ + "libC used by: \n"
+ + "\n"
+ + "/file2 \n"
+ + " \n"
+ "\n"
+ "license content #0\n"
+ "\n"
@@ -224,13 +229,16 @@ public class LicenseHtmlGeneratorFromXmlTest {
Map contentIdToFileContentMap = new HashMap<>();
Map> toBoth = new HashMap<>();
Map> toOne = new HashMap<>();
+ Map> toOther = new HashMap<>();
toBoth.put("libA", new HashSet(Arrays.asList("0")));
toBoth.put("libB", new HashSet(Arrays.asList("1")));
toOne.put("libA", new HashSet(Arrays.asList("0")));
+ toOther.put("libC", new HashSet(Arrays.asList("0")));
fileNameToLibraryToContentIdMap.put("/file0", toBoth);
fileNameToLibraryToContentIdMap.put("/file1", toOne);
+ fileNameToLibraryToContentIdMap.put("/file2", toOther);
contentIdToFileContentMap.put("0", "license content #0");
contentIdToFileContentMap.put("1", "license content #1");
@@ -249,7 +257,7 @@ public class LicenseHtmlGeneratorFromXmlTest {
Map> toOne = new HashMap<>();
toBoth.put("", new HashSet(Arrays.asList("0", "1")));
- toOne.put("", new HashSet(Arrays.asList("0")));
+ toOne.put("", new HashSet(Arrays.asList("0", "1")));
fileNameToLibraryToContentIdMap.put("/file0", toBoth);
fileNameToLibraryToContentIdMap.put("/file1", toOne);
@@ -269,13 +277,16 @@ public class LicenseHtmlGeneratorFromXmlTest {
Map contentIdToFileContentMap = new HashMap<>();
Map> toBoth = new HashMap<>();
Map> toOne = new HashMap<>();
+ Map> toOther = new HashMap<>();
toBoth.put("libA", new HashSet(Arrays.asList("0")));
toBoth.put("libB", new HashSet(Arrays.asList("1")));
toOne.put("libA", new HashSet(Arrays.asList("0")));
+ toOther.put("libC", new HashSet(Arrays.asList("0")));
fileNameToLibraryToContentIdMap.put("/file0", toBoth);
fileNameToLibraryToContentIdMap.put("/file1", toOne);
+ fileNameToLibraryToContentIdMap.put("/file2", toOther);
contentIdToFileContentMap.put("0", "license content #0");
contentIdToFileContentMap.put("1", "license content #1");
|