Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.settings; |
| 18 | |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 19 | import android.content.Context; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 20 | import android.provider.SearchIndexableResource; |
| 21 | |
Tamas Berghammer | 265d3c2 | 2016-06-22 15:34:45 +0100 | [diff] [blame] | 22 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent; |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 23 | import com.android.settings.dashboard.DashboardFragment; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 24 | import com.android.settings.search.BaseSearchIndexProvider; |
| 25 | import com.android.settings.search.Indexable; |
Tony Mantler | 0fcd6cb | 2018-03-26 15:17:25 -0700 | [diff] [blame] | 26 | import com.android.settingslib.search.SearchIndexable; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 27 | |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 28 | import java.util.Arrays; |
| 29 | import java.util.List; |
| 30 | |
Tony Mantler | 0fcd6cb | 2018-03-26 15:17:25 -0700 | [diff] [blame] | 31 | @SearchIndexable |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 32 | public class LegalSettings extends DashboardFragment { |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 33 | |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 34 | private static final String TAG = "LegalSettings"; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 35 | |
| 36 | @Override |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 37 | public int getMetricsCategory() { |
Chris Wren | 9d1bfd1 | 2016-01-26 18:04:01 -0500 | [diff] [blame] | 38 | return MetricsEvent.ABOUT_LEGAL_SETTINGS; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 39 | } |
| 40 | |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 41 | @Override |
| 42 | protected String getLogTag() { |
| 43 | return TAG; |
Ben Lin | e4ca92a | 2017-12-12 16:44:53 -0800 | [diff] [blame] | 44 | } |
| 45 | |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 46 | @Override |
| 47 | protected int getPreferenceScreenResId() { |
| 48 | return R.xml.about_legal; |
| 49 | } |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 50 | |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 51 | public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = |
| 52 | new BaseSearchIndexProvider() { |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 53 | |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 54 | @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 Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 60 | } |
Yanting_Yang | 42513af | 2018-04-11 21:21:17 +0800 | [diff] [blame^] | 61 | }; |
Jason Monk | f940232 | 2015-06-10 10:02:59 -0400 | [diff] [blame] | 62 | } |