OSDN Git Service

Add UI for mainline modules licenses.
authorAndrew Sapperstein <asapperstein@google.com>
Tue, 18 Jun 2019 16:44:18 +0000 (09:44 -0700)
committerAndrew Sapperstein <asapperstein@google.com>
Tue, 25 Jun 2019 23:01:38 +0000 (16:01 -0700)
commit56a8c33c1bf4a834bbcf09400869dd3cd9170998
treecd14c5dfdad6bd9cfa1eff3c23f6b00f23e62405
parent242ff568d10b4816576fd1c1cf909649754ff06f
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
15 files changed:
AndroidManifest.xml
res/xml/about_legal.xml
res/xml/module_licenses.xml [new file with mode: 0644]
src/com/android/settings/Settings.java
src/com/android/settings/core/gateway/SettingsGateway.java
src/com/android/settings/deviceinfo/legal/ModuleLicensePreference.java [new file with mode: 0644]
src/com/android/settings/deviceinfo/legal/ModuleLicenseProvider.java [new file with mode: 0644]
src/com/android/settings/deviceinfo/legal/ModuleLicensesDashboard.java [new file with mode: 0644]
src/com/android/settings/deviceinfo/legal/ModuleLicensesListPreferenceController.java [new file with mode: 0644]
src/com/android/settings/deviceinfo/legal/ModuleLicensesPreferenceController.java [new file with mode: 0644]
tests/robotests/assets/grandfather_not_implementing_index_provider
tests/robotests/src/com/android/settings/deviceinfo/legal/ModuleLicensePreferenceTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/deviceinfo/legal/ModuleLicenseProviderTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/deviceinfo/legal/ModuleLicensesListPreferenceControllerTest.java [new file with mode: 0644]
tests/robotests/src/com/android/settings/deviceinfo/legal/ModuleLicensesPreferenceControllerTest.java [new file with mode: 0644]