Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79e7ce39 authored by Mady Mellor's avatar Mady Mellor
Browse files

Add hints for toggles in Slice

Test: Manual, build a slice with a toggle needs the support lib CL to
      present the toggle
Bug: 68378574
Change-Id: I3067cfee49be17c2688de6d4ce9569e490280705
parent 1a6d229e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7006,6 +7006,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";
@@ -7020,6 +7021,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 {
+7 −1
Original line number Diff line number Diff line
@@ -151,7 +151,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";
    /**
@@ -171,6 +170,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;