package ZtlApi;

import android.content.Intent;
import android.util.Log;
import java.io.File;

public class ZtlManager33287_1 extends ZtlManager {
    String ALARM_OFF = "0";
    String ALARM_ON = "1";
    private boolean DEBUG_ZTL = false;
    String IS_OPEN_ALARM = "persist.sys.isopenalarm";
    String POWER_OFF_ALARM = "persist.sys.poweroffalarm";
    String POWER_ON_TIME = "persist.sys.powerontime";
    private String TAG = "ZTLManager3328_7.1";
    String targetTime = "2019-5-4 18:00:00";

    public void setSplitScreenLeftRightEnable(boolean z) {
    }

    public void setSplitScreenUpDownEnable(boolean z) {
    }

    public void goToSleep() {
        Intent intent = new Intent("com.ztl.action.boardstate");
        intent.putExtra("state", 0);
        this.mContext.sendBroadcast(intent);
    }

    public void wakeUp() {
        Intent intent = new Intent("com.ztl.action.boardstate");
        intent.putExtra("state", 1);
        this.mContext.sendBroadcast(intent);
    }

    public String getUsbStoragePath() {
        File file = new File("/storage/");
        String str = null;
        try {
            if (file.exists() && file.isDirectory()) {
                File[] listFiles = file.listFiles();
                for (File absolutePath : listFiles) {
                    str = absolutePath.getAbsolutePath();
                    LOGD("shx : get file path " + str);
                    if (str.contains("udisk")) {
                        LOGD("shx : open " + str);
                        File file2 = new File(str);
                        if (file2.exists() && file2.isDirectory()) {
                            File[] listFiles2 = file2.listFiles();
                            if (listFiles2.length == 1) {
                                str = listFiles2[0].getAbsolutePath();
                                Log.e("steve : usbPath ", "" + str);
                            } else {
                                int i = 0;
                                while (true) {
                                    if (i >= listFiles2.length) {
                                        break;
                                    } else if (!listFiles2[i].getAbsolutePath().contains("(")) {
                                        str = listFiles2[i].getAbsolutePath();
                                        Log.e("steve : usbPath ", "" + str);
                                        break;
                                    } else {
                                        i++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return str;
    }

    public int setAutoTimeZone(int i) {
        Intent intent = new Intent("com.ztl.action.autotimezone");
        intent.putExtra("checked", i);
        this.mContext.sendBroadcast(intent);
        return 0;
    }

    public int setAutoDateTime(int i) {
        Intent intent = new Intent("com.ztl.action.autodatetime");
        intent.putExtra("checked", i);
        this.mContext.sendBroadcast(intent);
        return 0;
    }

    public int setRaiseSystemVolume() {
        return setSystemVolumeIndex(getSystemCurrenVolume() + 1);
    }

    public int setLowerSystemVolume() {
        return setSystemVolumeIndex(getSystemCurrenVolume() - 1);
    }

    public int setSystemBrightness(int i) {
        Intent intent = new Intent("com.ztl.action.setbrightness");
        intent.putExtra("brightness", i);
        this.mContext.sendBroadcast(intent);
        return 0;
    }

    public void recoverySystem() {
        this.mContext.sendBroadcast(new Intent("com.ztl.action.recovery"));
    }

    public int getDisplayOrientation() {
        return Integer.valueOf(getSystemProperty("persist.sys.ztlOrientation", "0")).intValue();
    }

    @Deprecated
    public int getUsbDebugState() {
        String str = "1";
        String systemProperty = getSystemProperty("persist.usb.mode", str);
        if (!systemProperty.equals("0") && !systemProperty.equals("2")) {
            str = "0";
        }
        return Integer.valueOf(str).intValue();
    }

    public int getSystemBarState() {
        return Integer.valueOf(getSystemProperty("persist.sys.barState", "1")).intValue();
    }

    public String[] getScreenModes() {
        return getSystemProperty("persist.sys.displaymdoes", "").split(",");
    }

    public void setScreenMode(String str) {
        Intent intent = new Intent("android.ztl.action.SET_SCREEN_MODE");
        intent.putExtra("mode", str);
        this.mContext.sendBroadcast(intent);
    }
}
