1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.appsearch.appsindexer; 18 19 import android.app.appsearch.AppSearchSession; 20 21 /** 22 * The package contains the implementation of the AppsIndexer used to index metadata about apps and 23 * app functions exposed by apps into AppSearch. 24 * 25 * <p>App function documents are indexed into AppSearch via {@link AppsIndexerImpl#doIncrementalUpdate} in a 26 * single {@link AppSearchHelper#APP_DATABASE} database. Within the database, each schema type is 27 * named dynamically to be unique to the app package name to control the schema visibility by the 28 * result of {@link android.content.pm.PackageManager#canPackageQuery}. This was preferred over 29 * defining one database per app because {@link AppSearchSession#setSchema} was a bottleneck for the 30 * inserting schemas into per app database. 31 */ 32