Rabbit-R1/android (non root)/java/sources/androidx/work/impl/diagnostics/DiagnosticsReceiver.java
2024-05-21 17:08:36 -04:00

28 lines
1 KiB
Java

package androidx.work.impl.diagnostics;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import androidx.work.ListenableWorker;
import androidx.work.Logger;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
import androidx.work.impl.workers.DiagnosticsWorker;
/* loaded from: classes2.dex */
public class DiagnosticsReceiver extends BroadcastReceiver {
private static final String TAG = Logger.tagWithPrefix("DiagnosticsRcvr");
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
if (intent == null) {
return;
}
Logger.get().debug(TAG, "Requesting diagnostics");
try {
WorkManager.getInstance(context).enqueue(OneTimeWorkRequest.from((Class<? extends ListenableWorker>) DiagnosticsWorker.class));
} catch (IllegalStateException e) {
Logger.get().error(TAG, "WorkManager is not initialized", e);
}
}
}