blob: 3538cc9ef8f61bc03f25faf90c2cb86e5155c72b [file] [log] [blame]
Jason Monkf9402322015-06-10 10:02:59 -04001/*
2 * Copyright (C) 2015 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
17package com.android.settings;
18
Jason Monkf9402322015-06-10 10:02:59 -040019import android.content.Context;
Jason Monkf9402322015-06-10 10:02:59 -040020import android.provider.SearchIndexableResource;
21
Tamas Berghammer265d3c22016-06-22 15:34:45 +010022import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
Yanting_Yang42513af2018-04-11 21:21:17 +080023import com.android.settings.dashboard.DashboardFragment;
Jason Monkf9402322015-06-10 10:02:59 -040024import com.android.settings.search.BaseSearchIndexProvider;
25import com.android.settings.search.Indexable;
Tony Mantler0fcd6cb2018-03-26 15:17:25 -070026import com.android.settingslib.search.SearchIndexable;
Jason Monkf9402322015-06-10 10:02:59 -040027
Jason Monkf9402322015-06-10 10:02:59 -040028import java.util.Arrays;
29import java.util.List;
30
Tony Mantler0fcd6cb2018-03-26 15:17:25 -070031@SearchIndexable
Yanting_Yang42513af2018-04-11 21:21:17 +080032public class LegalSettings extends DashboardFragment {
Jason Monkf9402322015-06-10 10:02:59 -040033
Yanting_Yang42513af2018-04-11 21:21:17 +080034 private static final String TAG = "LegalSettings";
Jason Monkf9402322015-06-10 10:02:59 -040035
36 @Override
Fan Zhang65076132016-08-08 10:25:13 -070037 public int getMetricsCategory() {
Chris Wren9d1bfd12016-01-26 18:04:01 -050038 return MetricsEvent.ABOUT_LEGAL_SETTINGS;
Jason Monkf9402322015-06-10 10:02:59 -040039 }
40
Yanting_Yang42513af2018-04-11 21:21:17 +080041 @Override
42 protected String getLogTag() {
43 return TAG;
Ben Line4ca92a2017-12-12 16:44:53 -080044 }
45
Yanting_Yang42513af2018-04-11 21:21:17 +080046 @Override
47 protected int getPreferenceScreenResId() {
48 return R.xml.about_legal;
49 }
Jason Monkf9402322015-06-10 10:02:59 -040050
Yanting_Yang42513af2018-04-11 21:21:17 +080051 public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
52 new BaseSearchIndexProvider() {
Jason Monkf9402322015-06-10 10:02:59 -040053
Yanting_Yang42513af2018-04-11 21:21:17 +080054 @Override
55 public List<SearchIndexableResource> getXmlResourcesToIndex(
56 Context context, boolean enabled) {
57 final SearchIndexableResource sir = new SearchIndexableResource(context);
58 sir.xmlResId = R.xml.about_legal;
59 return Arrays.asList(sir);
Jason Monkf9402322015-06-10 10:02:59 -040060 }
Yanting_Yang42513af2018-04-11 21:21:17 +080061 };
Jason Monkf9402322015-06-10 10:02:59 -040062}