package com.avg.zaap.crashlibrary;

import android.content.Context;
import android.content.Intent;

import com.avg.zaap.crashlibrary.core.CrashUncaughtExceptionHandler;
import com.avg.zaap.crashlibrary.core.helper.process.IProcessHelper;
import com.avg.zaap.crashlibrary.core.helper.process.ProcessHelper;

import java.io.File;

/**
 * This class serves as the default dependency factory for the {@link CrashLib} class.
 * <p>
 * Created by marek.osvald on 12.5.2016.
 */
public class CrashLibFactory implements ICrashLibFactory {

    @Override
    public File getFile(File dir, String name) {
        return new File(dir, name);
    }

    @Override
    public Thread.UncaughtExceptionHandler getCrashUncaughtExceptionHandler(Context context) {
        return new CrashUncaughtExceptionHandler(context);
    }

    @Override
    public Intent getIntent(Context context, Class<CrashReportingService> serviceClass) {
        return new Intent(context, serviceClass);
    }

    @Override
    public IProcessHelper getProcessHelper() {
        return new ProcessHelper();
    }

}
