Add the ability to define a Preference Controller in xml using the 'controller' tag. This is useful for two reasons: - It allows the controllers to be instantiated via reflection for Slices and Dashboard fragment - Removes the requirement that controllers be defined manually in Fragments In order to be instantiable, they must have a unified construction following either: ClassName(Context) ClassName(Context, String) Also added a robotest that verifies that all controllers defined in XML follow the constructor schema, and extend BasePreferenceController. Test: robotests Bug: 67996923 Change-Id: I304b35dc666daebecf0c9e286696f3f2a510704a
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="utf-8"?>
 | |
| <!--
 | |
|   Copyright (C) 2017 The Android Open Source Project
 | |
| 
 | |
|   Licensed under the Apache License, Version 2.0 (the "License");
 | |
|   you may not use this file except in compliance with the License.
 | |
|   You may obtain a copy of the License at
 | |
| 
 | |
|        http://www.apache.org/licenses/LICENSE-2.0
 | |
| 
 | |
|   Unless required by applicable law or agreed to in writing, software
 | |
|   distributed under the License is distributed on an "AS IS" BASIS,
 | |
|   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | |
|   See the License for the specific language governing permissions and
 | |
|   limitations under the License.
 | |
| 
 | |
|   -->
 | |
| 
 | |
| <!--
 | |
|     WARNING: This resource file is used to test Settings Search indexing.
 | |
|     If you change something in here, please run the settings robotests and
 | |
|     make sure they still pass.
 | |
|  -->
 | |
| 
 | |
| <PreferenceScreen
 | |
|         xmlns:android="http://schemas.android.com/apk/res/android"
 | |
|         xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
 | |
|         android:title="bears_bears_bears"
 | |
|         settings:keywords="keywords">
 | |
| 
 | |
|     <Preference
 | |
|             android:key="pref_key_1"
 | |
|             android:title="bears_bears_bears"
 | |
|             settings:controller="mind_flayer"/>
 | |
| </PreferenceScreen> |