Introduce an IconsContentProvider.

Because of the new app visibility constraints introduced in Android R,
apps may be unable to load icons from the TextClassifierService (TCS).
This is because the TCS returns "Icons" based on resources to the apps.
These resources were globally available until this new constraint.

The IconsContentProvider (IconsCP) provides access to the icons
returned by the TCS. For each icon the TCS intends to return to a
client app, the IconsCP creates a proxy content URI for that icon
"resource" and forwards an Icon object based on that URI. If/when
rendering of the icon is requested from this URI, the IconsCP loads the
icon and returns a PNG representation of the icon.

Bug: 151847511
Test: atest services/tests/servicestests/src/com/android/server/textclassifier
Change-Id: I25219138c81e8978fc4af9f8c61821c487bd7b77
5 files changed