work/workmanager/src/main/java/androidx/work/WorkRequest.java
@RequiresApi(26)
        public @NonNull B keepResultsForAtLeast(@NonNull Duration duration) {
            mWorkSpec.minimumRetentionDuration = duration.toMillis();
            return getThis();
        }
/**
         * Specifies that the results of this work should be kept for at least the specified amount
         * of time.  After this time has elapsed, the results may be pruned at the discretion of
         * WorkManager when there are no pending dependent jobs.
         *
         * When the results of a work are pruned, it becomes impossible to query for its
         * {@link WorkStatus}.
         *
         * Specifying a long duration here may adversely affect performance in terms of app storage
         * and database query time.
         *
         * @param duration The minimum duration of time to keep the results of this work
         * @return The current {@link Builder}
         */
Specifies that the results of this work should be kept for at least the specified amount
of time.  After this time has elapsed, the results may be pruned at the discretion of
WorkManager when there are no pending dependent jobs.

When the results of a work are pruned, it becomes impossible to query for its
WorkStatus.

Specifying a long duration here may adversely affect performance in terms of app storage
and database query time.

@param duration The minimum duration of time to keep the results of this work
@return The current  Builder
Specifies that the results of this work should be kept for at least the specified amount of time . After this time has elapsed the results may be pruned at the discretion of WorkManager when there are no pending dependent jobs . When the results of a work are pruned it becomes impossible to query for its WorkStatus . Specifying a long duration here may adversely affect performance in terms of app storage and database query time . @param duration The minimum duration of time to keep the results of this work @return The current Builder
@RequiresApi(26)
        public @NonNull B keepResultsForAtLeast(@NonNull Duration duration) {
            mWorkSpec.minimumRetentionDuration = duration.toMillis();
            return getThis();
        }
@ RequiresApi ( 26 ) public @ NonNull B keepResultsForAtLeast ( @ NonNull Duration duration ) { mWorkSpec . minimumRetentionDuration = duration . toMillis ( ) ; return getThis ( ) ; }
Specifies that the results of this work should be kept for at least the specified amount
 of time.
Specifies that the results of this work should be kept for at least the specified amount of time .