Hook up blocked keys

Block any slice in onBind that is the in the blacklist

Change-Id: I9687d07cbfef5fcb94842046bc5dc3296eed4252
Fixes: 80195653
Test: robotests
This commit is contained in:
Matthew Fritze
2018-05-23 12:25:23 -07:00
parent 28dc3917a9
commit 4242ed2171
2 changed files with 29 additions and 0 deletions

View File

@@ -175,6 +175,13 @@ public class SettingsSliceProvider extends SliceProvider {
@Override
public Slice onBindSlice(Uri sliceUri) {
final Set<String> blockedKeys = getBlockedKeys();
final String key = sliceUri.getLastPathSegment();
if (blockedKeys.contains(key)) {
Log.e(TAG, "Requested blocked slice with Uri: " + sliceUri);
return null;
}
// If adding a new Slice, do not directly match Slice URIs.
// Use {@link SlicesDatabaseAccessor}.
if (WifiCallingSliceHelper.WIFI_CALLING_URI.equals(sliceUri)) {