ExtServices

The ExtServices module updates framework components for core OS functionality such as notification ranking, autofill text-matching strategies, storage cache, package watchdog, and other services that run continually. This module is updatable, meaning it can receive updates to functionality outside of the normal Android release cycle.

Service components

The ExtServices module contains the following services.

DisplayHashingService

In Android 12, DisplayHashingService is used to generate an instance of DisplayHash for the specified buffer. It's also used to verify that a specific display hash was generated by the system. When generating a display hash, the caller can specify which of the supported hashing algorithms it wishes to use.

TextClassifierService

The TextClassifierService service component backs TextClassifier APIs and Android features such as smart text selection and smart suggestions in notifications. The ExtServices module contains the default text classifier, which is verified by the CTS test TextClassifierPolicyTest.java.

If needed, you can configure a custom text classifier service by specifying config_defaultTextClassifierPackage in config.xml. Custom text classifiers can depend on the default text classifier by calling TextClassifierService.getDefaultTextClassifierImplementation(Context) to get an instance of it.

InlineSuggestionRenderService

The InlineSuggestionRenderService service component enables Inline Suggestions to be shown in the keyboard suggestion strip. This service is called to render a View object holding the Inline Suggestion for the new Inline Autofill flow. The default implementation for this renderer service calls into androidx.autofill.inline.Renderer to render the suggestion. This behavior is verified by CTS tests in /autofillservice/cts/inline/.

Package name

Devices running Android 11 must set config_servicesExtensionPackage (in frameworks/base/core/res/res/values/config.xml) to the ExtServices package name (com.android.ext.services). This configuration change is verified by the CTS test cts/tests/tests/os/src/android/os/cts/RequiredComponentsTest.java.

Module boundary

In Android 12, the ExtServices module code is moved from frameworks/base/apex/extservices (this is a subdirectory of the frameworks/base project) and packages/modules/ExtServices.

The new project structure for packages/modules/ExtServices is as follows:

  • apex/ (files from frameworks/base/apex/extservices)
  • java/ (files from packages/modules/ExtServices/res, packages/modules/ExtServices/src, packages/modules/ExtServices/tests, and files for new feature)
  • jni/ (files for new feature)
  • native/ (files for new feature)

The ExtServices module boundary is in packages/modules/ExtServices. Android 11 also moves several TextClassifier implementation classes out of frameworks/base/core/.

Module format

In Android 11, the ExtServices module (com.android.ext.services) is in APEX format. In Android 10, this module is in APK format.

Customizing

In Android 11, you can configure a custom text classifier service that calls the default text classifier (however, this isn't recommended). In Android 10, the ExtServices module doesn't provide customization options.

Testing

The Android Compatibility Test Suite (CTS) verifies ExtServices module functionality by running a comprehensive set of CTS tests on every module release. In addition, the Mainline Test Suite (MTS) also contains several ExtServices tests. The full list of ExtServices tests is as follows: