I've set the constraints as
val constraints = Constraints.Builder()
.setRequiresCharging(true)
.setRequiresDeviceIdle(false)
.setRequiresBatteryNotLow(false)
.build()
and created a OneTimeWorkRequest.
It starts the work inside the emulator with API 28 (android 9) as intended.
The problem is that on devices with Android 10 it doesn't starts the work even after I plugged in the charger. This also happens with android 10 emulators.