Add SettingsPrefController for Slices

Adds a new abstraction layer between preference controllers
and the AbstractPreferenceController. The layer is used to
consolidate the logic for each the setting type for getting
and setting values. This will be extended to support UI
information for Slices.

For reference how this fits into Slices, look at the
like-named classes added in this prototype:
ag/3221891

The changes in Search are as a transition into deprecation.
The code for Search in Settings is out-of-date from the
unbundled counterpart, and this change is made so that the
current code behaves as normal.

Test: robotests
Bug: 67996707
Change-Id: Ib1faab706485039edad66119a27a3fd5cabe6009
This commit is contained in:
Matthew Fritze
2017-11-15 15:12:52 -08:00
parent c61ed6356d
commit 3a4168360b
11 changed files with 502 additions and 119 deletions

View File

@@ -40,6 +40,7 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -178,11 +179,11 @@ public class IndexDataConverter {
final String intentTargetPackage = sir.intentTargetPackage;
final String intentTargetClass = sir.intentTargetClass;
Map<String, PreferenceControllerMixin> controllerUriMap = null;
Map<String, ResultPayload> controllerUriMap = new HashMap<>();
if (fragmentName != null) {
controllerUriMap = DatabaseIndexingUtils
.getPreferenceControllerUriMap(fragmentName, context);
.getPayloadKeyMap(fragmentName, context);
}
headerTitle = XmlParserUtils.getDataTitle(context, attrs);
@@ -249,7 +250,7 @@ public class IndexDataConverter {
}
// TODO (b/62254931) index primitives instead of payload
payload = DatabaseIndexingUtils.getPayloadFromUriMap(controllerUriMap, key);
payload = controllerUriMap.get(key);
childFragment = XmlParserUtils.getDataChildFragment(context, attrs);
builder.setSummaryOn(summary)