package com.cvte.dss.ups.mic.mic3308;

import android.content.Context;
import com.cvte.dss.ups.plugin.IUpsPlugin;

/* JADX INFO: loaded from: classes.dex */
public class Plugin implements IUpsPlugin {
    private IUpdOperation mUpdTool;

    private synchronized IUpdOperation getUpdTool(Context context) {
        if (this.mUpdTool == null) {
            if (SystemPropertyUtil.isUseVman()) {
                this.mUpdTool = VmanTool.getInstance();
            } else {
                this.mUpdTool = new UpdTool(context);
            }
        }
        return this.mUpdTool;
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public IUpsPlugin.FirmwareInfo getFirmwareInfo(Context context) {
        String version;
        String module;
        String otaKey = getUpdTool(context).getOtaKey();
        if (otaKey == null || (version = getUpdTool(context).getVersion()) == null || (module = getUpdTool(context).getModule()) == null) {
            return null;
        }
        return new IUpsPlugin.FirmwareInfo("microphone", module, "microphone", version, otaKey, false, false);
    }

    @Override // com.cvte.dss.ups.plugin.IUpsPlugin
    public boolean upgradeFirmware(Context context, String str, boolean z, IUpsPlugin.IUpgradeStatusListener iUpgradeStatusListener) {
        return getUpdTool(context).upgrade(str, Boolean.valueOf(z), iUpgradeStatusListener).booleanValue();
    }
}
