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

Commit bc86efa3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Address the Smartspace UI templates APIs review comments."

parents f2ee166b 0c4e5d8d
Loading
Loading
Loading
Loading
+49 −30
Original line number Diff line number Diff line
@@ -2174,23 +2174,41 @@ package android.app.smartspace {
    field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.SmartspaceTarget> CREATOR;
    field public static final int FEATURE_ALARM = 7; // 0x7
    field public static final int FEATURE_BEDTIME_ROUTINE = 16; // 0x10
    field public static final int FEATURE_BLAZE_BUILD_PROGRESS = 40; // 0x28
    field public static final int FEATURE_CALENDAR = 2; // 0x2
    field public static final int FEATURE_COMMUTE_TIME = 3; // 0x3
    field public static final int FEATURE_CONSENT = 11; // 0xb
    field public static final int FEATURE_CROSS_DEVICE_TIMER = 32; // 0x20
    field public static final int FEATURE_DOORBELL = 30; // 0x1e
    field public static final int FEATURE_DRIVING_MODE = 26; // 0x1a
    field public static final int FEATURE_EARTHQUAKE_ALERT = 38; // 0x26
    field public static final int FEATURE_EARTHQUAKE_OCCURRED = 41; // 0x29
    field public static final int FEATURE_ETA_MONITORING = 18; // 0x12
    field public static final int FEATURE_FITNESS_TRACKING = 17; // 0x11
    field public static final int FEATURE_FLASHLIGHT = 28; // 0x1c
    field public static final int FEATURE_FLIGHT = 4; // 0x4
    field public static final int FEATURE_GAS_STATION_PAYMENT = 24; // 0x18
    field public static final int FEATURE_HOLIDAY_ALARM = 34; // 0x22
    field public static final int FEATURE_LOYALTY_CARD = 14; // 0xe
    field public static final int FEATURE_MEDIA = 15; // 0xf
    field public static final int FEATURE_MEDIA_HEADS_UP = 36; // 0x24
    field public static final int FEATURE_MEDIA_RESUME = 31; // 0x1f
    field public static final int FEATURE_MISSED_CALL = 19; // 0x13
    field public static final int FEATURE_ONBOARDING = 8; // 0x8
    field public static final int FEATURE_PACKAGE_TRACKING = 20; // 0x14
    field public static final int FEATURE_PAIRED_DEVICE_STATE = 25; // 0x19
    field public static final int FEATURE_REMINDER = 6; // 0x6
    field public static final int FEATURE_SAFETY_CHECK = 35; // 0x23
    field public static final int FEATURE_SEVERE_WEATHER_ALERT = 33; // 0x21
    field public static final int FEATURE_SHOPPING_LIST = 13; // 0xd
    field public static final int FEATURE_SLEEP_SUMMARY = 27; // 0x1b
    field public static final int FEATURE_SPORTS = 9; // 0x9
    field public static final int FEATURE_STEP_COUNTING = 37; // 0x25
    field public static final int FEATURE_STEP_DATE = 39; // 0x27
    field public static final int FEATURE_STOCK_PRICE_CHANGE = 12; // 0xc
    field public static final int FEATURE_STOPWATCH = 22; // 0x16
    field public static final int FEATURE_TIMER = 21; // 0x15
    field public static final int FEATURE_TIME_TO_LEAVE = 29; // 0x1d
    field public static final int FEATURE_TIPS = 5; // 0x5
    field public static final int FEATURE_UNDEFINED = 0; // 0x0
    field public static final int FEATURE_UPCOMING_ALARM = 23; // 0x17
@@ -2256,22 +2274,12 @@ package android.app.smartspace.uitemplatedata {
  public class BaseTemplateData implements android.os.Parcelable {
    method public int describeContents();
    method public int getLayoutWeight();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getPrimaryLoggingInfo();
    method @Nullable public android.app.smartspace.uitemplatedata.TapAction getPrimaryTapAction();
    method @Nullable public android.app.smartspace.uitemplatedata.Icon getSubtitleIcon();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getSubtitleText();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalAlarmText();
    method @Nullable public android.app.smartspace.uitemplatedata.Icon getSupplementalIcon();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getSupplementalLoggingInfo();
    method @Nullable public android.app.smartspace.uitemplatedata.Icon getSupplementalSubtitleIcon();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getSupplementalSubtitleLoggingInfo();
    method @Nullable public android.app.smartspace.uitemplatedata.TapAction getSupplementalSubtitleTapAction();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalSubtitleText();
    method @Nullable public android.app.smartspace.uitemplatedata.TapAction getSupplementalTapAction();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getSupplementalText();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getPrimaryItem();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSubtitleItem();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSubtitleSupplementalItem();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSupplementalAlarmItem();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo getSupplementalLineItem();
    method public int getTemplateType();
    method @Nullable public android.app.smartspace.uitemplatedata.Icon getTitleIcon();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getTitleText();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData> CREATOR;
  }
@@ -2280,27 +2288,37 @@ package android.app.smartspace.uitemplatedata {
    ctor public BaseTemplateData.Builder(int);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData build();
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setLayoutWeight(int);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalAlarmText(@NonNull android.app.smartspace.uitemplatedata.Text);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalSubtitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalText(@NonNull android.app.smartspace.uitemplatedata.Text);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setTitleIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setTitleText(@NonNull android.app.smartspace.uitemplatedata.Text);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setPrimaryItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSubtitleSupplementalItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalAlarmItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.Builder setSupplementalLineItem(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo);
  }
  public static final class BaseTemplateData.SubItemInfo implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.app.smartspace.uitemplatedata.Icon getIcon();
    method @Nullable public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo getLoggingInfo();
    method @Nullable public android.app.smartspace.uitemplatedata.TapAction getTapAction();
    method @Nullable public android.app.smartspace.uitemplatedata.Text getText();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo> CREATOR;
  }
  public static final class BaseTemplateData.SubItemInfo.Builder {
    ctor public BaseTemplateData.SubItemInfo.Builder();
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo build();
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setIcon(@NonNull android.app.smartspace.uitemplatedata.Icon);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setLoggingInfo(@NonNull android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setTapAction(@NonNull android.app.smartspace.uitemplatedata.TapAction);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemInfo.Builder setText(@NonNull android.app.smartspace.uitemplatedata.Text);
  }
  public static final class BaseTemplateData.SubItemLoggingInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getFeatureType();
    method public int getInstanceId();
    method @Nullable public CharSequence getPackageName();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo> CREATOR;
  }
@@ -2308,6 +2326,7 @@ package android.app.smartspace.uitemplatedata {
  public static final class BaseTemplateData.SubItemLoggingInfo.Builder {
    ctor public BaseTemplateData.SubItemLoggingInfo.Builder(int, int);
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo build();
    method @NonNull public android.app.smartspace.uitemplatedata.BaseTemplateData.SubItemLoggingInfo.Builder setPackageName(@NonNull CharSequence);
  }
  public final class CarouselTemplateData extends android.app.smartspace.uitemplatedata.BaseTemplateData {
+37 −1
Original line number Diff line number Diff line
@@ -159,6 +159,24 @@ public final class SmartspaceTarget implements Parcelable {
    public static final int FEATURE_TIMER = 21;
    public static final int FEATURE_STOPWATCH = 22;
    public static final int FEATURE_UPCOMING_ALARM = 23;
    public static final int FEATURE_GAS_STATION_PAYMENT = 24;
    public static final int FEATURE_PAIRED_DEVICE_STATE = 25;
    public static final int FEATURE_DRIVING_MODE = 26;
    public static final int FEATURE_SLEEP_SUMMARY = 27;
    public static final int FEATURE_FLASHLIGHT = 28;
    public static final int FEATURE_TIME_TO_LEAVE = 29;
    public static final int FEATURE_DOORBELL = 30;
    public static final int FEATURE_MEDIA_RESUME = 31;
    public static final int FEATURE_CROSS_DEVICE_TIMER = 32;
    public static final int FEATURE_SEVERE_WEATHER_ALERT = 33;
    public static final int FEATURE_HOLIDAY_ALARM = 34;
    public static final int FEATURE_SAFETY_CHECK = 35;
    public static final int FEATURE_MEDIA_HEADS_UP = 36;
    public static final int FEATURE_STEP_COUNTING = 37;
    public static final int FEATURE_EARTHQUAKE_ALERT = 38;
    public static final int FEATURE_STEP_DATE = 39;
    public static final int FEATURE_BLAZE_BUILD_PROGRESS = 40;
    public static final int FEATURE_EARTHQUAKE_OCCURRED = 41;

    /**
     * @hide
@@ -187,7 +205,25 @@ public final class SmartspaceTarget implements Parcelable {
            FEATURE_PACKAGE_TRACKING,
            FEATURE_TIMER,
            FEATURE_STOPWATCH,
            FEATURE_UPCOMING_ALARM
            FEATURE_UPCOMING_ALARM,
            FEATURE_GAS_STATION_PAYMENT,
            FEATURE_PAIRED_DEVICE_STATE,
            FEATURE_DRIVING_MODE,
            FEATURE_SLEEP_SUMMARY,
            FEATURE_FLASHLIGHT,
            FEATURE_TIME_TO_LEAVE,
            FEATURE_DOORBELL,
            FEATURE_MEDIA_RESUME,
            FEATURE_CROSS_DEVICE_TIMER,
            FEATURE_SEVERE_WEATHER_ALERT,
            FEATURE_HOLIDAY_ALARM,
            FEATURE_SAFETY_CHECK,
            FEATURE_MEDIA_HEADS_UP,
            FEATURE_STEP_COUNTING,
            FEATURE_EARTHQUAKE_ALERT,
            FEATURE_STEP_DATE,
            FEATURE_BLAZE_BUILD_PROGRESS,
            FEATURE_EARTHQUAKE_OCCURRED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface FeatureType {
+304 −435

File changed.

Preview size limit exceeded, changes collapsed.

+10 −30
Original line number Diff line number Diff line
@@ -56,31 +56,16 @@ public final class CarouselTemplateData extends BaseTemplateData {
    }

    private CarouselTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
            @Nullable Text titleText,
            @Nullable Icon titleIcon,
            @Nullable Text subtitleText,
            @Nullable Icon subtitleIcon,
            @Nullable TapAction primaryTapAction,
            @Nullable SubItemLoggingInfo primaryLoggingInfo,
            @Nullable Text supplementalSubtitleText,
            @Nullable Icon supplementalSubtitleIcon,
            @Nullable TapAction supplementalSubtitleTapAction,
            @Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
            @Nullable Text supplementalText,
            @Nullable Icon supplementalIcon,
            @Nullable TapAction supplementalTapAction,
            @Nullable SubItemLoggingInfo supplementalLoggingInfo,
            @Nullable Text supplementalAlarmText,
            @Nullable SubItemInfo primaryItem,
            @Nullable SubItemInfo subtitleItem,
            @Nullable SubItemInfo subtitleSupplementalItem,
            @Nullable SubItemInfo supplementalLineItem,
            @Nullable SubItemInfo supplementalAlarmItem,
            int layoutWeight,
            @NonNull List<CarouselItem> carouselItems,
            @Nullable TapAction carouselAction) {
        super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
                primaryTapAction, primaryLoggingInfo,
                supplementalSubtitleText, supplementalSubtitleIcon,
                supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
                supplementalText, supplementalIcon,
                supplementalTapAction, supplementalLoggingInfo,
                supplementalAlarmText, layoutWeight);
        super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
                supplementalLineItem, supplementalAlarmItem, layoutWeight);

        mCarouselItems = carouselItems;
        mCarouselAction = carouselAction;
@@ -190,14 +175,9 @@ public final class CarouselTemplateData extends BaseTemplateData {
                throw new IllegalStateException("Carousel data is empty");
            }

            return new CarouselTemplateData(getTemplateType(), getTitleText(),
                    getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
                    getPrimaryTapAction(), getPrimaryLoggingInfo(),
                    getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
                    getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
                    getSupplementalText(), getSupplementalIcon(),
                    getSupplementalTapAction(), getSupplementalLoggingInfo(),
                    getSupplementalAlarmText(), getLayoutWeight(),
            return new CarouselTemplateData(getTemplateType(), getPrimaryItem(),
                    getSubtitleItem(), getSubtitleSupplemtnalItem(),
                    getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
                    mCarouselItems, mCarouselAction);
        }
    }
+11 −30
Original line number Diff line number Diff line
@@ -51,30 +51,16 @@ public final class CombinedCardsTemplateData extends BaseTemplateData {
    }

    private CombinedCardsTemplateData(@SmartspaceTarget.UiTemplateType int templateType,
            @Nullable Text titleText,
            @Nullable Icon titleIcon,
            @Nullable Text subtitleText,
            @Nullable Icon subtitleIcon,
            @Nullable TapAction primaryTapAction,
            @Nullable SubItemLoggingInfo primaryLoggingInfo,
            @Nullable Text supplementalSubtitleText,
            @Nullable Icon supplementalSubtitleIcon,
            @Nullable TapAction supplementalSubtitleTapAction,
            @Nullable SubItemLoggingInfo supplementalSubtitleLoggingInfo,
            @Nullable Text supplementalText,
            @Nullable Icon supplementalIcon,
            @Nullable TapAction supplementalTapAction,
            @Nullable SubItemLoggingInfo supplementalLoggingInfo,
            @Nullable Text supplementalAlarmText,
            @Nullable SubItemInfo primaryItem,
            @Nullable SubItemInfo subtitleItem,
            @Nullable SubItemInfo subtitleSupplementalItem,
            @Nullable SubItemInfo supplementalLineItem,
            @Nullable SubItemInfo supplementalAlarmItem,
            int layoutWeight,
            @NonNull List<BaseTemplateData> combinedCardDataList) {
        super(templateType, titleText, titleIcon, subtitleText, subtitleIcon,
                primaryTapAction, primaryLoggingInfo,
                supplementalSubtitleText, supplementalSubtitleIcon,
                supplementalSubtitleTapAction, supplementalSubtitleLoggingInfo,
                supplementalText, supplementalIcon,
                supplementalTapAction, supplementalLoggingInfo,
                supplementalAlarmText, layoutWeight);
        super(templateType, primaryItem, subtitleItem, subtitleSupplementalItem,
                supplementalLineItem, supplementalAlarmItem, layoutWeight);

        mCombinedCardDataList = combinedCardDataList;
    }

@@ -161,14 +147,9 @@ public final class CombinedCardsTemplateData extends BaseTemplateData {
            if (mCombinedCardDataList == null) {
                throw new IllegalStateException("Please assign a value to all @NonNull args.");
            }
            return new CombinedCardsTemplateData(getTemplateType(), getTitleText(),
                    getTitleIcon(), getSubtitleText(), getSubtitleIcon(),
                    getPrimaryTapAction(), getPrimaryLoggingInfo(),
                    getSupplementalSubtitleText(), getSupplementalSubtitleIcon(),
                    getSupplementalSubtitleTapAction(), getSupplementalSubtitleLoggingInfo(),
                    getSupplementalText(), getSupplementalIcon(),
                    getSupplementalTapAction(), getSupplementalLoggingInfo(),
                    getSupplementalAlarmText(), getLayoutWeight(),
            return new CombinedCardsTemplateData(getTemplateType(), getPrimaryItem(),
                    getSubtitleItem(), getSubtitleSupplemtnalItem(),
                    getSupplementalLineItem(), getSupplementalAlarmItem(), getLayoutWeight(),
                    mCombinedCardDataList);
        }
    }
Loading