Rabbit-R1/switch port/java/sources/androidx/work/impl/DefaultRunnableScheduler.java

26 lines
764 B
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.work.impl;
import android.os.Handler;
import android.os.Looper;
import androidx.core.os.HandlerCompat;
import androidx.work.RunnableScheduler;
/* loaded from: classes2.dex */
public class DefaultRunnableScheduler implements RunnableScheduler {
private final Handler mHandler = HandlerCompat.createAsync(Looper.getMainLooper());
public Handler getHandler() {
return this.mHandler;
}
@Override // androidx.work.RunnableScheduler
public void scheduleWithDelay(long delayInMillis, Runnable runnable) {
this.mHandler.postDelayed(runnable, delayInMillis);
}
@Override // androidx.work.RunnableScheduler
public void cancel(Runnable runnable) {
this.mHandler.removeCallbacks(runnable);
}
}