Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | |
Fan Zhang | ca6d86c | 2018-06-14 12:52:06 -0700 | [diff] [blame] | 17 | package com.android.settings.applications.specialaccess.deviceadmin; |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 18 | |
Fan Zhang | 31b2100 | 2019-01-16 13:49:47 -0800 | [diff] [blame] | 19 | import android.app.settings.SettingsEnums; |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 20 | import android.content.Context; |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 21 | import android.provider.SearchIndexableResource; |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 22 | |
Fan Zhang | ca6d86c | 2018-06-14 12:52:06 -0700 | [diff] [blame] | 23 | import com.android.settings.R; |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 24 | import com.android.settings.dashboard.DashboardFragment; |
| 25 | import com.android.settings.search.BaseSearchIndexProvider; |
| 26 | import com.android.settings.search.Indexable; |
| 27 | import com.android.settingslib.search.SearchIndexable; |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 28 | |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 29 | import java.util.ArrayList; |
| 30 | import java.util.List; |
| 31 | |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 32 | @SearchIndexable |
| 33 | public class DeviceAdminSettings extends DashboardFragment { |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 34 | static final String TAG = "DeviceAdminSettings"; |
Amith Yamasani | b8e0f60 | 2014-07-28 16:28:36 -0700 | [diff] [blame] | 35 | |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 36 | public int getMetricsCategory() { |
Fan Zhang | 31b2100 | 2019-01-16 13:49:47 -0800 | [diff] [blame] | 37 | return SettingsEnums.DEVICE_ADMIN_SETTINGS; |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | @Override |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 41 | public void onAttach(Context context) { |
| 42 | super.onAttach(context); |
| 43 | use(DeviceAdminListPreferenceController.class).setFooterPreferenceMixin( |
| 44 | mFooterPreferenceMixin); |
Amith Yamasani | a1d0184 | 2011-01-24 16:02:11 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | @Override |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 48 | protected int getPreferenceScreenResId() { |
| 49 | return R.xml.device_admin_settings; |
Amith Yamasani | a1d0184 | 2011-01-24 16:02:11 -0800 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | @Override |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 53 | protected String getLogTag() { |
| 54 | return TAG; |
Fabrice Di Meglio | 402c451 | 2014-07-28 18:55:29 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 57 | public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = |
| 58 | new BaseSearchIndexProvider() { |
| 59 | @Override |
| 60 | public List<SearchIndexableResource> getXmlResourcesToIndex(Context context, |
| 61 | boolean enabled) { |
| 62 | final ArrayList<SearchIndexableResource> result = new ArrayList<>(); |
Makoto Onuki | 4cfe39f | 2015-11-19 13:47:55 -0800 | [diff] [blame] | 63 | |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 64 | final SearchIndexableResource sir = new SearchIndexableResource(context); |
| 65 | sir.xmlResId = R.xml.device_admin_settings; |
| 66 | result.add(sir); |
| 67 | return result; |
Zoltan Szatmary-Ban | f3d7209 | 2014-07-02 16:48:00 +0100 | [diff] [blame] | 68 | } |
Fan Zhang | fc7188d | 2018-06-14 13:17:51 -0700 | [diff] [blame] | 69 | }; |
Dianne Hackborn | feff652 | 2010-01-12 18:18:05 -0800 | [diff] [blame] | 70 | } |