From c04df4ae391cf114aa982b324e6eff11d17dc638 Mon Sep 17 00:00:00 2001 From: Yi-Ling Chuang Date: Mon, 18 Nov 2019 15:28:06 +0800 Subject: [PATCH] Add a new method in Sliceable. We are making some Settings Slices public and some not so we can expose more Settings Slices to Settings Search without worrying about privacy and security concern. Hence, add this method to distinguish these two. Bug: 141088937 Test: rebuild Change-Id: I457802bb6472ec81a3dfb65c0674af4bb3dd4b5a --- src/com/android/settings/slices/Sliceable.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/slices/Sliceable.java b/src/com/android/settings/slices/Sliceable.java index aab49064dbb..ad27b7c0496 100644 --- a/src/com/android/settings/slices/Sliceable.java +++ b/src/com/android/settings/slices/Sliceable.java @@ -25,6 +25,8 @@ import android.content.IntentFilter; import android.net.Uri; import android.widget.Toast; +import androidx.slice.Slice; + import com.android.settings.R; /** @@ -49,12 +51,23 @@ public interface Sliceable { *

* This does not guarantee the setting is available. * - * @return {@code true} if the controller should be used externally as a Slice. + * @return {@code true} if the controller should be used as a Slice. */ default boolean isSliceable() { return false; } + /** + * Determines if the {@link Slice} should be public to other apps. + * This does not guarantee the setting is available. + * + * @return {@code true} if the controller should be used as a Slice, and is + * publicly visible to other apps. + */ + default boolean isPublicSlice() { + return false; + } + /** * Returns uri for this slice (if it's a slice). */