AppSearch

AppSearch, an on-device indexing and structured search engine, was shipped as an APEX in Android 12. In Android 13, AppSearch is shipped as a Mainline module.

Motivation

To ensure a consistent implementation of AppSearch across the Android ecosystem and support updateability.

Benefits:

  • Allow updating AppSearch via Play Store
  • Ensure compliance with the AppSearch CDD requirements

Details

  • Data collected through AppSearch APIs remains on the user's device (except aggregated metrics data, which is used for performance optimization purposes).
  • A fast, mobile-first storage implementation with low I/O use
  • Highly efficient indexing and querying over large data sets
  • Multi-language support, such as English, Spanish and CJKT
  • Relevance ranking and usage scoring

AppSearch architecture

Figure 1 highlights AppSearch concepts as well as the system service process boundary.

AppSearch module architecture

Figure 1. AppSearch module architecture

Module boundary

  • AppSearch Mainline Apex - com.android.appsearch

    • AppSearch API surface (Java)
      • Code Location: frameworks/base/apex/appsearch/framework
      • Process: BOOT_CLASS_PATH
    • AppSearchManagerService (Java)
      • Code Location: frameworks/base/apex/appsearch/service
      • Process: system_server
    • Icing Native library (C++)
      • Code Location: external/icing
      • Process: system_server
  • HAL Interface/Implementations (C++)

    • N/A

Refer to the module architecture diagram in Figure 1.

Package format

The main functions of this module are included in the APEX package com.android.appsearch.

Dependencies

  • libicu
  • libprotobuf-cpp-lite
  • ndk

Customization

This module is not customizable.