1/*
2 * Copyright (C) 2009 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 */
16package android.content.cts;
17
18import android.content.SearchRecentSuggestionsProvider;
19
20public class MockSRSProvider extends SearchRecentSuggestionsProvider {
21    final static String AUTHORITY = "android.content.cts.MockSRSProvider";
22    final static int MODE = DATABASE_MODE_QUERIES + DATABASE_MODE_2LINES;
23
24    public static boolean setupSuggestCalled;
25    private boolean mOnCreateCalled;
26
27    public MockSRSProvider() {
28        super();
29        setupSuggestions(AUTHORITY, MODE);
30    }
31
32    public MockSRSProvider(String tag) {
33        super();
34    }
35
36    @Override
37    public void setupSuggestions(String authority, int mode) {
38        setupSuggestCalled = true;
39        super.setupSuggestions(authority, mode);
40    }
41
42    @Override
43    public boolean onCreate() {
44        mOnCreateCalled = true;
45        return super.onCreate();
46    }
47
48    public boolean isOnCreateCalled() {
49        return mOnCreateCalled;
50    }
51}
52