1 /* 2 * Copyright (C) 2021 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.enterprise; 18 19 import android.content.Context; 20 import android.provider.SearchIndexableResource; 21 22 import com.android.settings.R; 23 import com.android.settingslib.core.AbstractPreferenceController; 24 25 import java.util.Collections; 26 import java.util.List; 27 28 /** Privacy Settings preferences for a financed device. */ 29 public class PrivacySettingsFinancedPreference implements PrivacySettingsPreference { 30 private static final String KEY_EXPOSURE_CHANGES_CATEGORY = "exposure_changes_category"; 31 32 private final Context mContext; 33 PrivacySettingsFinancedPreference(Context context)34 public PrivacySettingsFinancedPreference(Context context) { 35 mContext = context.getApplicationContext(); 36 } 37 38 /** 39 * Returns the XML Res Id that is used for financed devices in the Privacy Settings screen. 40 */ 41 @Override getPreferenceScreenResId()42 public int getPreferenceScreenResId() { 43 return R.xml.financed_privacy_settings; 44 } 45 46 /** 47 * Returns the XML resources to index for a financed device. 48 */ 49 @Override getXmlResourcesToIndex()50 public List<SearchIndexableResource> getXmlResourcesToIndex() { 51 final SearchIndexableResource sir = new SearchIndexableResource(mContext); 52 sir.xmlResId = getPreferenceScreenResId(); 53 return Collections.singletonList(sir); 54 } 55 56 /** 57 * Returns the preference controllers used to populate the privacy preferences in the Privacy 58 * Settings screen for a financed device. 59 */ 60 @Override createPreferenceControllers(boolean async)61 public List<AbstractPreferenceController> createPreferenceControllers(boolean async) { 62 return Collections.emptyList(); 63 } 64 } 65