Add UI for mainline modules licenses.

Added a module licenses option that lives in Legal information settings.
Clicking that option opens module licenses page, which displays every
module by name, filtered to exclude modules without license files.
Clicking a module in the list opens HTMLViewer.

Created ModuleLicensesProvider, a new ContentProvider that serves as a
redirect for the Uris sent to HTMLViewer so that they open asset files.
In order to provide the redirect, the provider will write the license file
to a file in Settings' cache directory when the license does not exist
in the cache or is outdated. The provider then opens that cached file.

Fixes: 135183006
Test: robotests
Change-Id: I7d69da34780c8c4efb150d0c0411078c12bc80d8
This commit is contained in:
Andrew Sapperstein
2019-06-18 09:44:18 -07:00
parent 242ff568d1
commit 56a8c33c1b
15 changed files with 1239 additions and 0 deletions

View File

@@ -72,6 +72,7 @@ import com.android.settings.deviceinfo.StorageDashboardFragment;
import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment;
import com.android.settings.deviceinfo.firmwareversion.FirmwareVersionSettings;
import com.android.settings.deviceinfo.legal.ModuleLicensesDashboard;
import com.android.settings.display.NightDisplaySettings;
import com.android.settings.dream.DreamSettings;
import com.android.settings.enterprise.EnterprisePrivacySettings;
@@ -175,6 +176,7 @@ public class SettingsGateway {
UserDictionarySettings.class.getName(),
DisplaySettings.class.getName(),
MyDeviceInfoFragment.class.getName(),
ModuleLicensesDashboard.class.getName(),
ManageApplications.class.getName(),
FirmwareVersionSettings.class.getName(),
ManageAssist.class.getName(),
@@ -318,6 +320,7 @@ public class SettingsGateway {
Settings.DateTimeSettingsActivity.class.getName(),
Settings.EnterprisePrivacySettingsActivity.class.getName(),
Settings.MyDeviceInfoActivity.class.getName(),
Settings.ModuleLicensesActivity.class.getName(),
UserBackupSettingsActivity.class.getName(),
};
}