package com.dowse.base.manager;

import android.content.Context;
import android.text.TextUtils;
import com.dowse.base.data.DSTFInfo;
import com.dowse.base.util.ContextUtil;
import com.dowse.base.util.TFUtil;

/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSTFManager.class */
public class DSTFManager {
    private static final String TAG = "DSTFManager";
    private Context mContext;

    public static DSTFManager getInstance() {
        return DSTFManagerHolder.instance;
    }

    /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSTFManager$DSTFManagerHolder.class */
    private static class DSTFManagerHolder {
        public static final DSTFManager instance = new DSTFManager();

        private DSTFManagerHolder() {
        }
    }

    private DSTFManager() {
        this.mContext = null;
        this.mContext = ContextUtil.getApplication();
    }

    public DSTFInfo getTFInfo() {
        DSTFInfo dstfInfo = new DSTFInfo();
        if (this.mContext != null) {
            String sdPath = TFUtil.getStoragePath(this.mContext, false);
            String usbPath = TFUtil.getStoragePath(this.mContext, true);
            if (!TextUtils.isEmpty(sdPath)) {
                dstfInfo.setSdExsit(1);
                dstfInfo.setSdTotal(TFUtil.getTotalSize(sdPath));
                dstfInfo.setSdLeft(TFUtil.getLeftSize(sdPath));
            }
            if (!TextUtils.isEmpty(usbPath)) {
                dstfInfo.setUsbExsit(1);
                dstfInfo.setUsbTotal(TFUtil.getTotalSize(usbPath));
                dstfInfo.setUsbLeft(TFUtil.getLeftSize(usbPath));
            }
        }
        return dstfInfo;
    }
}
