package com.app.simplitend.callwhitelisting;

import android.content.Context;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.work.Worker;
import androidx.work.WorkerParameters;

import com.app.simplitend.apputils.AppUtil;

public class CallUnBlockingWorker extends Worker {

    public static final String CALL_BLOCKING_WORk = "call_blocking_work";

    private final Context context;

    public CallUnBlockingWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
        super(context, workerParams);
        this.context = context;
    }

    @NonNull
    @Override
    public Result doWork() {
        Log.d(CALL_BLOCKING_WORk, "CALL BLOCKING ENABLED");
        AppUtil.setIsCallBlockingEnabled(context, true);
        return Result.success();
    }
}
