blob: 1badbb4f6ce1e6c87b3a830b8dc0f3fc53bab239 [file] [log] [blame]
Justin Klaassen4d01eea2018-04-03 23:21:57 -04001/*
2 * Copyright 2018 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
17package androidx.slice;
18
19import static androidx.slice.widget.SliceLiveData.SUPPORTED_SPECS;
20
21import android.content.Context;
22import android.content.Intent;
23import android.net.Uri;
24
25import androidx.annotation.NonNull;
26import androidx.annotation.Nullable;
27import androidx.annotation.RestrictTo;
28import androidx.slice.compat.SliceProviderCompat;
29import androidx.slice.widget.SliceLiveData;
30
Justin Klaassenb8042fc2018-04-15 00:41:15 -040031import java.util.Collection;
Justin Klaassen4d01eea2018-04-03 23:21:57 -040032import java.util.Set;
33
34
35/**
36 * @hide
37 */
38@RestrictTo(RestrictTo.Scope.LIBRARY)
39class SliceManagerCompat extends SliceManagerBase {
40
41 SliceManagerCompat(Context context) {
42 super(context);
43 }
44
45 @Override
46 public void pinSlice(@NonNull Uri uri) {
47 SliceProviderCompat.pinSlice(mContext, uri, SliceLiveData.SUPPORTED_SPECS);
48 }
49
50 @Override
51 public void unpinSlice(@NonNull Uri uri) {
52 SliceProviderCompat.unpinSlice(mContext, uri, SliceLiveData.SUPPORTED_SPECS);
53 }
54
55 @Override
56 public @NonNull Set<SliceSpec> getPinnedSpecs(@NonNull Uri uri) {
57 return SliceProviderCompat.getPinnedSpecs(mContext, uri);
58 }
59
60 @Nullable
61 @Override
62 public Slice bindSlice(@NonNull Uri uri) {
63 return SliceProviderCompat.bindSlice(mContext, uri, SUPPORTED_SPECS);
64 }
65
66 @Nullable
67 @Override
68 public Slice bindSlice(@NonNull Intent intent) {
69 return SliceProviderCompat.bindSlice(mContext, intent, SUPPORTED_SPECS);
70 }
71
72 @Nullable
73 @Override
74 public Uri mapIntentToUri(@NonNull Intent intent) {
75 return SliceProviderCompat.mapIntentToUri(mContext, intent);
76 }
Justin Klaassenb8042fc2018-04-15 00:41:15 -040077
78 @Override
79 public Collection<Uri> getSliceDescendants(Uri uri) {
80 return SliceProviderCompat.getSliceDescendants(mContext, uri);
81 }
Justin Klaassen4d01eea2018-04-03 23:21:57 -040082}