diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/app/slice/Slice.java | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 8a09b82bf770..4a463fed063e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -7020,6 +7020,7 @@ package android.app.slice { method public android.net.Uri getUri(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.app.slice.Slice> CREATOR; + field public static final java.lang.String EXTRA_TOGGLE_STATE = "android.app.slice.extra.TOGGLE_STATE"; field public static final java.lang.String HINT_ACTIONS = "actions"; field public static final java.lang.String HINT_HORIZONTAL = "horizontal"; field public static final java.lang.String HINT_LARGE = "large"; @@ -7035,6 +7036,7 @@ package android.app.slice { field public static final java.lang.String SUBTYPE_MESSAGE = "message"; field public static final java.lang.String SUBTYPE_SLIDER = "slider"; field public static final java.lang.String SUBTYPE_SOURCE = "source"; + field public static final java.lang.String SUBTYPE_TOGGLE = "toggle"; } public static class Slice.Builder { diff --git a/core/java/android/app/slice/Slice.java b/core/java/android/app/slice/Slice.java index e61e8b290519..1aff7e9c9eff 100644 --- a/core/java/android/app/slice/Slice.java +++ b/core/java/android/app/slice/Slice.java @@ -156,7 +156,6 @@ public final class Slice implements Parcelable { /** * Key to retrieve an extra added to an intent when a control is changed. - * @hide */ public static final String EXTRA_TOGGLE_STATE = "android.app.slice.extra.TOGGLE_STATE"; /** @@ -176,6 +175,13 @@ public final class Slice implements Parcelable { * Subtype to tag an item represents a slider. */ public static final String SUBTYPE_SLIDER = "slider"; + /** + * Subtype to indicate that this content has a toggle action associated with it. To indicate + * that the toggle is on, use {@link #HINT_SELECTED}. When the toggle state changes, the + * intent associated with it will be sent along with an extra {@link #EXTRA_TOGGLE_STATE} + * which can be retrieved to see the new state of the toggle. + */ + public static final String SUBTYPE_TOGGLE = "toggle"; private final SliceItem[] mItems; private final @SliceHint String[] mHints; |