• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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.applications.managedomainurls;
18 
19 import static com.android.settingslib.search.SearchIndexable.MOBILE;
20 
21 import android.app.settings.SettingsEnums;
22 import android.content.Context;
23 import android.provider.SearchIndexableResource;
24 
25 import com.android.settings.R;
26 import com.android.settings.dashboard.DashboardFragment;
27 import com.android.settings.search.BaseSearchIndexProvider;
28 import com.android.settings.search.Indexable;
29 import com.android.settingslib.search.SearchIndexable;
30 
31 import java.util.ArrayList;
32 import java.util.List;
33 
34 /**
35  * Activity to manage how Android handles URL resolution. Includes both per-app
36  * handling as well as system handling for Web Actions.
37  */
38 @SearchIndexable(forTarget = MOBILE)
39 public class ManageDomainUrls extends DashboardFragment {
40 
41     private static final String TAG = "ManageDomainUrls";
42 
43     @Override
getLogTag()44     protected String getLogTag() {
45         return TAG;
46     }
47 
48     @Override
onAttach(Context context)49     public void onAttach(Context context) {
50         super.onAttach(context);
51         use(DomainAppPreferenceController.class).setFragment(this);
52     }
53 
54     @Override
getPreferenceScreenResId()55     protected int getPreferenceScreenResId() {
56         return R.xml.manage_domain_url_settings;
57     }
58 
59     @Override
getMetricsCategory()60     public int getMetricsCategory() {
61         return SettingsEnums.MANAGE_DOMAIN_URLS;
62     }
63 
64     public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
65             new BaseSearchIndexProvider() {
66                 @Override
67                 public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
68                         boolean enabled) {
69                     final ArrayList<SearchIndexableResource> result = new ArrayList<>();
70 
71                     final SearchIndexableResource sir = new SearchIndexableResource(context);
72                     sir.xmlResId = R.xml.manage_domain_url_settings;
73                     result.add(sir);
74                     return result;
75                 }
76             };
77 }
78