package com.foxx.androidcast.network.selftest;

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

/** Helper to signal network self-test service from cast services. */
public final class NetworkSelfTestBridge {
    private NetworkSelfTestBridge() {}

    public static void startCapture(Context context) {
        send(context, NetworkSelfTestService.ACTION_START_CAPTURE);
    }

    public static void stopCapture(Context context) {
        send(context, NetworkSelfTestService.ACTION_STOP_CAPTURE);
    }

    private static void send(Context context, String action) {
        if (context == null) {
            return;
        }
        Intent i = new Intent(context, NetworkSelfTestService.class);
        i.setAction(action);
        context.startService(i);
    }
}
