CustomModelDownloadConditions.Builder

class CustomModelDownloadConditions.Builder


Builder of CustomModelDownloadConditions.

Summary

Public constructors

Public functions

CustomModelDownloadConditions

Builds CustomModelDownloadConditions.

CustomModelDownloadConditions.Builder
@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
requireCharging()

Sets charging as required.

CustomModelDownloadConditions.Builder
@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
requireDeviceIdle()

Sets device idle as required.

CustomModelDownloadConditions.Builder

Sets wifi as required.

Public constructors

Builder

Builder()

Public functions

requireCharging

@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
fun requireCharging(): CustomModelDownloadConditions.Builder

Sets charging as required. Only works on Android N and above.

requireDeviceIdle

@RequiresApi(value = VERSION_CODES.N)
@TargetApi(value = VERSION_CODES.N)
fun requireDeviceIdle(): CustomModelDownloadConditions.Builder

Sets device idle as required.

Idle mode is a loose definition provided by the system, which means that the device is not in use, and has not been in use for some time.

Only works on Android N and above.

requireWifi

fun requireWifi(): CustomModelDownloadConditions.Builder

Sets wifi as required.