package com.ifpdos.autotest;

import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import androidx.core.app.b;
import com.ifpdos.autotest.api.IWB;

/* JADX INFO: compiled from: RemoteService.kt */
/* JADX INFO: loaded from: classes.dex */
@d.n
public final class RemoteService extends Service {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final a f1947c = new a(null);

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private com.ifpdos.autotest.k0.f.b f1948d;

    /* JADX INFO: compiled from: RemoteService.kt */
    @d.n
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(d.n0.c.l lVar) {
            this();
        }
    }

    private final void a() {
        if (Build.VERSION.SDK_INT >= 26) {
            NotificationChannel notificationChannel = new NotificationChannel("channel_id", "WhiteBalance", 3);
            notificationChannel.setDescription("Channel Description");
            ((NotificationManager) getSystemService(NotificationManager.class)).createNotificationChannel(notificationChannel);
        }
        startForeground(1, new b.C0025b(this, "channel_id").e(getString(R.string.str_white_balance_server)).d(getString(R.string.str_running)).f(R.drawable.icon_setting).a());
    }

    @Override // android.app.Service
    public IBinder onBind(Intent intent) {
        d.n0.c.s.e(intent, "intent");
        return null;
    }

    @Override // android.app.Service
    public void onCreate() {
        super.onCreate();
        com.ifpdos.autotest.k0.f.b bVarA = com.ifpdos.autotest.k0.f.e.a(this);
        this.f1948d = bVarA;
        if (bVarA != null) {
            bVarA.a();
        }
    }

    @Override // android.app.Service
    public void onDestroy() {
        com.ifpdos.autotest.k0.f.b bVar = this.f1948d;
        if (bVar != null) {
            bVar.b();
        }
        super.onDestroy();
        stopForeground(true);
    }

    @Override // android.app.Service
    public int onStartCommand(Intent intent, int i, int i2) {
        super.onStartCommand(intent, i, i2);
        com.ifpdos.autotest.o0.e.h();
        a();
        ((IWB) com.ifpdos.autotest.lancontrol.module.other.a.b().a(IWB.class)).closeNoSignalSleepTime();
        Intent intent2 = new Intent(this, (Class<?>) MainActivity.class);
        intent2.addFlags(335544320);
        startActivity(intent2);
        com.ifpdos.autotest.k0.g.b.f2053a.h(this);
        return 2;
    }
}
