compat/src/main/java/androidx/core/content/pm/ShortcutInfoCompat.java
@RequiresApi(25)
    public ShortcutInfo toShortcutInfo() {
        ShortcutInfo.Builder builder = new ShortcutInfo.Builder(mContext, mId)
                .setShortLabel(mLabel)
                .setIntents(mIntents);
        if (mIcon != null) {
            builder.setIcon(mIcon.toIcon());
        }
        if (!TextUtils.isEmpty(mLongLabel)) {
            builder.setLongLabel(mLongLabel);
        }
        if (!TextUtils.isEmpty(mDisabledMessage)) {
            builder.setDisabledMessage(mDisabledMessage);
        }
        if (mActivity != null) {
            builder.setActivity(mActivity);
        }
        return builder.build();
    }
/**
     * @return {@link ShortcutInfo} object from this compat object.
     */
@return  ShortcutInfo object from this compat object.
@return ShortcutInfo object from this compat object .
@RequiresApi(25)
    public ShortcutInfo toShortcutInfo() {
        ShortcutInfo.Builder builder = new ShortcutInfo.Builder(mContext, mId)
                .setShortLabel(mLabel)
                .setIntents(mIntents);
        if (mIcon != null) {
            builder.setIcon(mIcon.toIcon());
        }
        if (!TextUtils.isEmpty(mLongLabel)) {
            builder.setLongLabel(mLongLabel);
        }
        if (!TextUtils.isEmpty(mDisabledMessage)) {
            builder.setDisabledMessage(mDisabledMessage);
        }
        if (mActivity != null) {
            builder.setActivity(mActivity);
        }
        return builder.build();
    }
@ RequiresApi ( 25 ) public ShortcutInfo toShortcutInfo ( ) { ShortcutInfo . Builder builder = new ShortcutInfo . Builder ( mContext , mId ) . setShortLabel ( mLabel ) . setIntents ( mIntents ) ; if ( mIcon != null ) { builder . setIcon ( mIcon . toIcon ( ) ) ; } if ( ! TextUtils . isEmpty ( mLongLabel ) ) { builder . setLongLabel ( mLongLabel ) ; } if ( ! TextUtils . isEmpty ( mDisabledMessage ) ) { builder . setDisabledMessage ( mDisabledMessage ) ; } if ( mActivity != null ) { builder . setActivity ( mActivity ) ; } return builder . build ( ) ; }
@return {@link ShortcutInfo} object from this compat object.
@return { @link ShortcutInfo } object from this compat object .