Add getDescendants to Settings Slice Provider

getDescendants allows another app to collect a list
of all valid Uris for Settings Slices. Important for search,
assistant or launcher apps.

This means searching our database for all valid keys and building
a list of Uris for each of those keys.

Fixes: 77808328
Test: robotests
Change-Id: I3ae27e4661a7dcaab50b091ae2730013118af8a2
This commit is contained in:
Matthew Fritze
2018-03-26 17:30:20 -07:00
parent d743f20618
commit 6730a061b1
6 changed files with 392 additions and 33 deletions

View File

@@ -295,14 +295,16 @@ public class SliceBuilderUtilsTest {
assertThat(pathPair.second).isEqualTo(KEY);
}
@Test(expected = IllegalArgumentException.class)
@Test
public void getPathData_noKey_returnsNull() {
final Uri uri = new Uri.Builder()
.authority(SettingsSliceProvider.SLICE_AUTHORITY)
.appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
.build();
SliceBuilderUtils.getPathData(uri);
final Pair<Boolean, String> pathPair = SliceBuilderUtils.getPathData(uri);
assertThat(pathPair).isNull();
}
@Test