blob: 7cbd8c72aaaebbf8392cdb7506b787e30458516c [file] [log] [blame]
Dianne Hackbornfeff6522010-01-12 18:18:05 -08001/*
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 Zhangca6d86c2018-06-14 12:52:06 -070017package com.android.settings.applications.specialaccess.deviceadmin;
Dianne Hackbornfeff6522010-01-12 18:18:05 -080018
Fan Zhang31b21002019-01-16 13:49:47 -080019import android.app.settings.SettingsEnums;
Dianne Hackbornfeff6522010-01-12 18:18:05 -080020import android.content.Context;
Fan Zhangfc7188d2018-06-14 13:17:51 -070021import android.provider.SearchIndexableResource;
Dianne Hackbornfeff6522010-01-12 18:18:05 -080022
Fan Zhangca6d86c2018-06-14 12:52:06 -070023import com.android.settings.R;
Fan Zhangfc7188d2018-06-14 13:17:51 -070024import com.android.settings.dashboard.DashboardFragment;
25import com.android.settings.search.BaseSearchIndexProvider;
26import com.android.settings.search.Indexable;
27import com.android.settingslib.search.SearchIndexable;
Fan Zhang65076132016-08-08 10:25:13 -070028
Dianne Hackbornfeff6522010-01-12 18:18:05 -080029import java.util.ArrayList;
30import java.util.List;
31
Fan Zhangfc7188d2018-06-14 13:17:51 -070032@SearchIndexable
33public class DeviceAdminSettings extends DashboardFragment {
Dianne Hackbornfeff6522010-01-12 18:18:05 -080034 static final String TAG = "DeviceAdminSettings";
Amith Yamasanib8e0f602014-07-28 16:28:36 -070035
Fan Zhang65076132016-08-08 10:25:13 -070036 public int getMetricsCategory() {
Fan Zhang31b21002019-01-16 13:49:47 -080037 return SettingsEnums.DEVICE_ADMIN_SETTINGS;
Fan Zhang65076132016-08-08 10:25:13 -070038 }
39
40 @Override
Fan Zhangfc7188d2018-06-14 13:17:51 -070041 public void onAttach(Context context) {
42 super.onAttach(context);
43 use(DeviceAdminListPreferenceController.class).setFooterPreferenceMixin(
44 mFooterPreferenceMixin);
Amith Yamasania1d01842011-01-24 16:02:11 -080045 }
46
47 @Override
Fan Zhangfc7188d2018-06-14 13:17:51 -070048 protected int getPreferenceScreenResId() {
49 return R.xml.device_admin_settings;
Amith Yamasania1d01842011-01-24 16:02:11 -080050 }
51
52 @Override
Fan Zhangfc7188d2018-06-14 13:17:51 -070053 protected String getLogTag() {
54 return TAG;
Fabrice Di Meglio402c4512014-07-28 18:55:29 -070055 }
56
Fan Zhangfc7188d2018-06-14 13:17:51 -070057 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 Onuki4cfe39f2015-11-19 13:47:55 -080063
Fan Zhangfc7188d2018-06-14 13:17:51 -070064 final SearchIndexableResource sir = new SearchIndexableResource(context);
65 sir.xmlResId = R.xml.device_admin_settings;
66 result.add(sir);
67 return result;
Zoltan Szatmary-Banf3d72092014-07-02 16:48:00 +010068 }
Fan Zhangfc7188d2018-06-14 13:17:51 -070069 };
Dianne Hackbornfeff6522010-01-12 18:18:05 -080070}