package com.mstar.android.tvapi.dtv.common;

import android.text.format.Time;
import com.mstar.android.tvapi.common.exception.TvCommonException;
import com.mstar.android.tvapi.dtv.vo.OadCustomerInfo;
import java.lang.ref.WeakReference;

/* JADX INFO: loaded from: classes.dex */
public final class OadManager {
    private static OadManager sOadManager;
    private long mNativeContext;
    private int mOadManagerContext;

    static {
        try {
            System.loadLibrary("oadmanager_jni");
            native_init();
        } catch (UnsatisfiedLinkError e2) {
            System.err.println("Cannot load oadmanager_jni library:\n" + e2.toString());
        }
    }

    private OadManager() {
        native_setup(new WeakReference(this));
    }

    private static void PostEvent_SnServiceDeadth(Object obj, int i2, int i3) {
    }

    protected static OadManager getInstance() {
        if (sOadManager == null) {
            synchronized (OadManager.class) {
                try {
                    if (sOadManager == null) {
                        sOadManager = new OadManager();
                    }
                } finally {
                }
            }
        }
        return sOadManager;
    }

    private final native boolean hasOadSchedule(int i2) throws TvCommonException;

    private final native void native_finalize();

    private final native long native_getOadBroadcastEndTime() throws TvCommonException;

    private final native long native_getOadBroadcastStartTime() throws TvCommonException;

    private final native int native_getOadVersion(int i2) throws TvCommonException;

    private static final native void native_init();

    private final native void native_setup(Object obj);

    private static void postEventFromNative(Object obj, int i2, int i3, int i4, Object obj2) {
        System.out.println("ThreeDimensionManager callback  \n");
    }

    protected void finalize() throws Throwable {
        super.finalize();
        native_finalize();
    }

    public final native boolean getOadActiveStandbyMode() throws TvCommonException;

    public Time getOadBroadcastEndTime() throws TvCommonException {
        Time time = new Time();
        time.set(native_getOadBroadcastEndTime());
        time.normalize(true);
        return time;
    }

    public Time getOadBroadcastStartTime() throws TvCommonException {
        Time time = new Time();
        time.set(native_getOadBroadcastStartTime());
        time.normalize(true);
        return time;
    }

    public final native OadCustomerInfo getOadCustomerInfo() throws TvCommonException;

    public final native short getOadDownloadProgress() throws TvCommonException;

    public final native short getOadUpdatedServiceNumber() throws TvCommonException;

    public final int getOadVersion(int i2) throws TvCommonException {
        return native_getOadVersion(i2);
    }

    public final native boolean getOadViewerPrompt() throws TvCommonException;

    public final native boolean resetForOadUpgrade() throws TvCommonException;

    public final native boolean resetOad() throws TvCommonException;

    public final native void setOadOff() throws TvCommonException;

    public final native void setOadOn() throws TvCommonException;

    public final native void setOadScanTime(int i2) throws TvCommonException;

    public final native void setOadViewerPrompt(boolean z2) throws TvCommonException;

    public final native void setOadWakeUpTime(int i2) throws TvCommonException;

    public final native boolean standbyCheck() throws TvCommonException;

    public final native boolean standbyForOadUpgrade() throws TvCommonException;

    public final native void startAutoOadScan() throws TvCommonException;

    public final native void startOad() throws TvCommonException;

    public final native boolean startOadInStandby() throws TvCommonException;

    public final native boolean startOadInStandy() throws TvCommonException;

    public final native void stopOad(boolean z2) throws TvCommonException;
}
