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 android.app.appsearch.testutil;
18 
19 import com.android.server.appsearch.contactsindexer.ContactsIndexerConfig;
20 
21 /**
22  * Contacts Indexer configuration for testing.
23  *
24  * <p>It simply returns default values.
25  */
26 public class TestContactsIndexerConfig implements ContactsIndexerConfig {
27     @Override
isContactsIndexerEnabled()28     public boolean isContactsIndexerEnabled() {
29         return DEFAULT_CONTACTS_INDEXER_ENABLED;
30     }
31 
32     @Override
getContactsFirstRunIndexingLimit()33     public int getContactsFirstRunIndexingLimit() {
34         return DEFAULT_CONTACTS_FIRST_RUN_INDEXING_LIMIT;
35     }
36 
37     @Override
getContactsFullUpdateIntervalMillis()38     public long getContactsFullUpdateIntervalMillis() {
39         return DEFAULT_CONTACTS_FULL_UPDATE_INTERVAL_MILLIS;
40     }
41 
42     @Override
getContactsFullUpdateLimit()43     public int getContactsFullUpdateLimit() {
44         return DEFAULT_CONTACTS_FULL_UPDATE_INDEXING_LIMIT;
45     }
46 
47     @Override
getContactsDeltaUpdateLimit()48     public int getContactsDeltaUpdateLimit() {
49         return DEFAULT_CONTACTS_DELTA_UPDATE_INDEXING_LIMIT;
50     }
51 
52     @Override
shouldIndexFirstMiddleAndLastNames()53     public boolean shouldIndexFirstMiddleAndLastNames() {
54         return DEFAULT_CONTACTS_INDEX_FIRST_MIDDLE_AND_LAST_NAMES;
55     }
56 
57     @Override
shouldKeepUpdatingOnError()58     public boolean shouldKeepUpdatingOnError() {
59         return DEFAULT_CONTACTS_KEEP_UPDATING_ON_ERROR;
60     }
61 }
62