AppAndNotificationDashboardFragment.java revision 13e5af06b8bf9f2520cc8db32f46bda04f4dd7bc
1/* 2 * Copyright (C) 2016 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.applications; 18 19import android.content.Context; 20import android.provider.SearchIndexableResource; 21 22import com.android.internal.logging.nano.MetricsProto; 23import com.android.settings.R; 24import com.android.settings.core.PreferenceController; 25import com.android.settings.dashboard.DashboardFragment; 26import com.android.settings.search.BaseSearchIndexProvider; 27 28import java.util.Arrays; 29import java.util.List; 30 31public class AppAndNotificationDashboardFragment extends DashboardFragment { 32 33 private static final String TAG = "AppAndNotifDashboard"; 34 35 @Override 36 public int getMetricsCategory() { 37 return MetricsProto.MetricsEvent.SETTINGS_APP_NOTIF_CATEGORY; 38 } 39 40 @Override 41 protected String getLogTag() { 42 return TAG; 43 } 44 45 @Override 46 public void onAttach(Context context) { 47 super.onAttach(context); 48 mProgressiveDisclosureMixin.setTileLimit(3); 49 } 50 51 @Override 52 protected int getPreferenceScreenResId() { 53 return R.xml.app_and_notification; 54 } 55 56 @Override 57 protected List<PreferenceController> getPreferenceControllers(Context context) { 58 return null; 59 } 60 61 public static final SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = 62 new BaseSearchIndexProvider() { 63 @Override 64 public List<SearchIndexableResource> getXmlResourcesToIndex( 65 Context context, boolean enabled) { 66 final SearchIndexableResource sir = new SearchIndexableResource(context); 67 sir.xmlResId = R.xml.app_and_notification; 68 return Arrays.asList(sir); 69 } 70 }; 71} 72