recommendation/src/main/java/androidx/recommendation/app/RecommendationExtender.java
@Override
    public Notification.Builder extend(Notification.Builder builder) {
        Bundle contentBundle = new Bundle();

        if (mTypes != null) {
            contentBundle.putStringArray(KEY_CONTENT_TYPE, mTypes);
        }
        if (mGenres != null) {
            contentBundle.putStringArray(KEY_CONTENT_GENRES, mGenres);
        }
        if (mPricingType != null) {
            contentBundle.putString(KEY_CONTENT_PRICING_TYPE, mPricingType);
        }
        if (mPricingValue != null) {
            contentBundle.putString(KEY_CONTENT_PRICING_VALUE, mPricingValue);
        }
        if (mContentStatus != -1) {
            contentBundle.putInt(KEY_CONTENT_STATUS, mContentStatus);
        }
        if (mMaturityRating != null) {
            contentBundle.putString(KEY_CONTENT_MATURITY_RATING, mMaturityRating);
        }
        if (mRunLength > 0) {
            contentBundle.putLong(KEY_CONTENT_RUN_LENGTH, mRunLength);
        }

        builder.getExtras().putBundle(EXTRA_CONTENT_INFO_EXTENDER, contentBundle);
        return builder;
    }
/**
     * Apply content extensions to a notification that is being built. This is typically called by
     * the {@link android.app.Notification.Builder#extend(Notification.Extender)
     * Notification.Builder.extend(Notification.Extender)} method of {@link Notification.Builder}.
     */
Apply content extensions to a notification that is being built.
Apply content extensions to a notification that is being built .
@Override
    public Notification.Builder extend(Notification.Builder builder) {
        Bundle contentBundle = new Bundle();
        if (mTypes != null) {
            contentBundle.putStringArray(KEY_CONTENT_TYPE, mTypes);
        }
        if (mGenres != null) {
            contentBundle.putStringArray(KEY_CONTENT_GENRES, mGenres);
        }
        if (mPricingType != null) {
            contentBundle.putString(KEY_CONTENT_PRICING_TYPE, mPricingType);
        }
        if (mPricingValue != null) {
            contentBundle.putString(KEY_CONTENT_PRICING_VALUE, mPricingValue);
        }
        if (mContentStatus != -1) {
            contentBundle.putInt(KEY_CONTENT_STATUS, mContentStatus);
        }
        if (mMaturityRating != null) {
            contentBundle.putString(KEY_CONTENT_MATURITY_RATING, mMaturityRating);
        }
        if (mRunLength > 0) {
            contentBundle.putLong(KEY_CONTENT_RUN_LENGTH, mRunLength);
        }
        builder.getExtras().putBundle(EXTRA_CONTENT_INFO_EXTENDER, contentBundle);
        return builder;
    }
@ Override public Notification . Builder extend ( Notification . Builder builder ) { Bundle contentBundle = new Bundle ( ) ; if ( mTypes != null ) { contentBundle . putStringArray ( KEY_CONTENT_TYPE , mTypes ) ; } if ( mGenres != null ) { contentBundle . putStringArray ( KEY_CONTENT_GENRES , mGenres ) ; } if ( mPricingType != null ) { contentBundle . putString ( KEY_CONTENT_PRICING_TYPE , mPricingType ) ; } if ( mPricingValue != null ) { contentBundle . putString ( KEY_CONTENT_PRICING_VALUE , mPricingValue ) ; } if ( mContentStatus != - 1 ) { contentBundle . putInt ( KEY_CONTENT_STATUS , mContentStatus ) ; } if ( mMaturityRating != null ) { contentBundle . putString ( KEY_CONTENT_MATURITY_RATING , mMaturityRating ) ; } if ( mRunLength > 0 ) { contentBundle . putLong ( KEY_CONTENT_RUN_LENGTH , mRunLength ) ; } builder . getExtras ( ) . putBundle ( EXTRA_CONTENT_INFO_EXTENDER , contentBundle ) ; return builder ; }
Apply content extensions to a notification that is being built.
Apply content extensions to a notification that is being built .