package com.avg.zaap.crashlibrary;

import android.content.BroadcastReceiver;
import android.content.Context;

import com.avg.zaap.crashlibrary.offline.ConnectivityHelper;
import com.avg.zaap.crashlibrary.offline.IConnectivityHelper;
import com.avg.zaap.crashlibrary.offline.service.CrashReportingServiceBroadcastReceiver;
import com.avg.zaap.crashlibrary.offline.service.ICrashReportingServiceBroadcastReceiverCallback;
import com.avg.zaap.crashlibrary.offline.uploader.IOfflineUploader;
import com.avg.zaap.crashlibrary.offline.uploader.OfflineUploader;

/**
 * This class serves as the default dependency factory for the {@link CrashReportingService}.
 * <p/>
 * Created by marek.osvald on 2.5.2016.
 */
public class CrashReportingServiceFactory implements ICrashReportingServiceFactory {

    @Override
    public ICrashReporter getCrashReporter(Context context) {
        return new CrashReporter(context);
    }

    @Override
    public ICrashServiceCommunicator.Stub getCrashServiceBinder(Context context, ICrashReporter crashReporter) {
        return new CrashReportingServiceBinder(context, crashReporter);
    }

    @Override
    public BroadcastReceiver getBroadcastReceiver(ICrashReportingServiceBroadcastReceiverCallback callback) {
        return new CrashReportingServiceBroadcastReceiver(callback);
    }

    @Override
    public IConnectivityHelper getConnectivityHelper(Context context) {
        return new ConnectivityHelper(context);
    }

    @Override
    public IOfflineUploader getOfflineUploader(Context context) {
        return new OfflineUploader(context);
    }

}
