• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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.annotation.IntDef;
20 
21 /** Defines constants and annotations for managing App Indexer versions. */
22 public class AppIndexerVersions {
23 
24     /** Default value when the version is not specified or can not be determined. */
25     public static final int APP_INDEXER_VERSION_UNKNOWN = 0;
26 
27     /** Represents the App Indexer version where dynamic schema support is enabled. */
28     private static final int APP_INDEXER_DYNAMIC_SCHEMA_ENABLED_VERSION = 1;
29 
30     /** Annotation to restrict values to valid App Indexer versions. */
31     @IntDef(value = {APP_INDEXER_VERSION_UNKNOWN, APP_INDEXER_DYNAMIC_SCHEMA_ENABLED_VERSION})
32     public @interface AppIndexerVersion {}
33 
34     /**
35      * Stores the current version of App Indexer. If this differs from the {@link
36      * AppsIndexerSettings#getPreviousIndexerVersionCode()} all apps will be re-indexed irrespective
37      * of whether there was a corresponding package update or not.
38      */
39     @AppIndexerVersion
40     public static final int CURR_APP_INDEXER_VERSION = APP_INDEXER_DYNAMIC_SCHEMA_ENABLED_VERSION;
41 }
42