com.xunlei.downloadlib.parameter.XLConstant.XLManagerStatus Java Examples

The following examples show how to use com.xunlei.downloadlib.parameter.XLConstant.XLManagerStatus. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 6 votes vote down vote up
public synchronized int uninit() {
    int i = 9900;
    synchronized (this) {
        if (mRunningRefCount != 0) {
            XLLog.i(TAG, "some function of XLDownloadManager is running, uninit failed!");
        } else if (!(mDownloadManagerState == XLManagerStatus.MANAGER_UNINIT || this.mLoader == null)) {
            if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING) {
                undoMonitorNetworkChange();
            }
            stopGetGuidTimer();
            i = this.mLoader.unInit();
            mDownloadManagerState = XLManagerStatus.MANAGER_UNINIT;
            this.mContext = null;
        }
    }
    return i;
}
 
Example #2
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 6 votes vote down vote up
public synchronized int uninit() {
    int i = 9900;
    synchronized (this) {
        if (mRunningRefCount != 0) {
            XLLog.i(TAG, "some function of XLDownloadManager is running, uninit failed!");
        } else if (!(mDownloadManagerState == XLManagerStatus.MANAGER_UNINIT || this.mLoader == null)) {
            if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING) {
                undoMonitorNetworkChange();
            }
            stopGetGuidTimer();
            i = this.mLoader.unInit();
            mDownloadManagerState = XLManagerStatus.MANAGER_UNINIT;
            this.mContext = null;
        }
    }
    return i;
}
 
Example #3
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 6 votes vote down vote up
public synchronized int uninit() {
    int i = 9900;
    synchronized (this) {
        if (mRunningRefCount != 0) {
            XLLog.i(TAG, "some function of XLDownloadManager is running, uninit failed!");
        } else if (!(mDownloadManagerState == XLManagerStatus.MANAGER_UNINIT || this.mLoader == null)) {
            if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING) {
                undoMonitorNetworkChange();
            }
            stopGetGuidTimer();
            i = this.mLoader.unInit();
            mDownloadManagerState = XLManagerStatus.MANAGER_UNINIT;
            this.mContext = null;
        }
    }
    return i;
}
 
Example #4
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 6 votes vote down vote up
public synchronized int uninit() {
    int i = 9900;
    synchronized (this) {
        if (mRunningRefCount != 0) {
            XLLog.i(TAG, "some function of XLDownloadManager is running, uninit failed!");
        } else if (!(mDownloadManagerState == XLManagerStatus.MANAGER_UNINIT || this.mLoader == null)) {
            if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING) {
                undoMonitorNetworkChange();
            }
            stopGetGuidTimer();
            i = this.mLoader.unInit();
            mDownloadManagerState = XLManagerStatus.MANAGER_UNINIT;
            this.mContext = null;
        }
    }
    return i;
}
 
Example #5
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int getUrlQuickInfo(long j, UrlQuickInfo urlQuickInfo) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || urlQuickInfo == null)) {
        i = this.mLoader.getUrlQuickInfo(j, urlQuickInfo);
    }
    decreRefCount();
    return i;
}
 
Example #6
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int createBtMagnetTask(MagnetTaskParam magnetTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(magnetTaskParam == null || getTaskId == null || !magnetTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createBtMagnetTask(magnetTaskParam.mUrl, magnetTaskParam.mFilePath, magnetTaskParam.mFileName, getTaskId);
        }
        decreRefCount();
    }
    return i;
}
 
Example #7
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int setOSVersion(String str) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || str == null)) {
        i = this.mLoader.setMiUiVersion(str);
    }
    decreRefCount();
    return i;
}
 
Example #8
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int getLocalUrl(String str, XLTaskLocalUrl xLTaskLocalUrl) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || xLTaskLocalUrl == null)) {
        i = this.mLoader.getLocalUrl(str, xLTaskLocalUrl);
    }
    decreRefCount();
    return i;
}
 
Example #9
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int getBtSubTaskStatus(long j, BtTaskStatus btTaskStatus, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || btTaskStatus == null)) {
        i3 = this.mLoader.getBtSubTaskStatus(j, btTaskStatus, i, i2);
    }
    decreRefCount();
    return i3;
}
 
Example #10
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int startDcdn(long j, int i, String str, String str2, String str3) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.startDcdn(j, i, str, str2, str3);
    }
    decreRefCount();
    XLLog.d(TAG, String.format("XLDownloadManager::startDcdn ret=[%d] taskId=[%d] subIndex=[%d] sessionId=[%s] productType=[%s] verifyInfo=[%s]", new Object[]{Integer.valueOf(i2), Long.valueOf(j), Integer.valueOf(i), str, str2, str3}));
    return i2;
}
 
Example #11
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int createBtTask(BtTaskParam btTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(btTaskParam == null || getTaskId == null || !btTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createBtTask(btTaskParam.mTorrentPath, btTaskParam.mFilePath, btTaskParam.mMaxConcurrent, btTaskParam.mCreateMode, btTaskParam.mSeqId, getTaskId);
        }
        decreRefCount();
    }
    return i;
}
 
Example #12
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int startTask(long j, boolean z) {
    int i = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i = this.mLoader.startTask(j, z);
    }
    decreRefCount();
    return i;
}
 
Example #13
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int getBtSubTaskInfo(long j, int i, BtSubTaskDetail btSubTaskDetail) {
    int i2 = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || btSubTaskDetail == null)) {
        i2 = this.mLoader.getBtSubTaskInfo(j, i, btSubTaskDetail);
    }
    decreRefCount();
    return i2;
}
 
Example #14
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int setStatReportSwitch(boolean z) {
    int i = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i = this.mLoader.setStatReportSwitch(z);
    }
    decreRefCount();
    return i;
}
 
Example #15
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int setReleaseLog(boolean z, String str, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i3 = z ? this.mLoader.setReleaseLog(1, str, i, i2) : this.mLoader.setReleaseLog(0, null, 0, 0);
    }
    decreRefCount();
    return i3;
}
 
Example #16
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int removeServerResource(long j, int i) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.removeAddedServerResource(j, i);
    }
    decreRefCount();
    return i2;
}
 
Example #17
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public int setTaskUid(long j, int i) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.setTaskUid(j, i);
    }
    decreRefCount();
    return i2;
}
 
Example #18
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int getDownloadHeader(long j, GetDownloadHead getDownloadHead) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || getDownloadHead == null)) {
        i = this.mLoader.getDownloadHeader(j, getDownloadHead);
    }
    decreRefCount();
    return i;
}
 
Example #19
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 5 votes vote down vote up
public synchronized int init(Context context, InitParam initParam, boolean z) {
    int i = XLConstant.XLErrorCode.DOWNLOAD_MANAGER_ERROR;
    int i2 = 0;
    synchronized (this) {
        if (!mIsLoadErrcodeMsg) {
            loadErrcodeString(context);
            mIsLoadErrcodeMsg = true;
        }
        if (!(context == null || initParam == null || !initParam.checkMemberVar())) {
            this.mContext = context;
            mAllowExecution = z;
            if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING) {
                XLLog.i(TAG, "XLDownloadManager is already init");
                Log.e(TAG, "XLDownloadManager is already init");
            } else if (this.mLoader != null) {
                String peerid = getPeerid();
                String guid = getGuid();
                XLLog.i(TAG, "Peerid:" + new String(Base64.encode(peerid.getBytes(), 0)));
                XLLog.i(TAG, "Guid:" + new String(Base64.encode(guid.getBytes(), 0)));
                if (mAllowExecution) {
                    i2 = XLUtil.getNetworkTypeComplete(context);
                }
                i = this.mLoader.init(context, initParam.mAppVersion, "", peerid, guid, initParam.mStatSavePath, initParam.mStatCfgSavePath, i2, initParam.mPermissionLevel);
                if (i != 9000) {
                    mDownloadManagerState = XLManagerStatus.MANAGER_INIT_FAIL;
                    XLLog.e(TAG, "XLDownloadManager init failed ret=" + i);
                    Log.e(TAG, "XLDownloadManager init failed ret=" + i);
                } else {
                    mDownloadManagerState = XLManagerStatus.MANAGER_RUNNING;
                    doMonitorNetworkChange();
                    setLocalProperty("PhoneModel", Build.MODEL);
                }
            }
        }
    }
    return i;
}
 
Example #20
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int releaseTask(long j) {
    int i = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i = this.mLoader.releaseTask(j);
    }
    decreRefCount();
    return i;
}
 
Example #21
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int stopDcdn(long j, int i) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.stopDcdn(j, i);
    }
    decreRefCount();
    XLLog.d(TAG, String.format("XLDownloadManager::stopDcdn ret=[%d] taskId=[%d] subIndex=[%d]", new Object[]{Integer.valueOf(i2), Long.valueOf(j), Integer.valueOf(i)}));
    return i2;
}
 
Example #22
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int startDcdn(long j, int i, String str, String str2, String str3) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.startDcdn(j, i, str, str2, str3);
    }
    decreRefCount();
    XLLog.d(TAG, String.format("XLDownloadManager::startDcdn ret=[%d] taskId=[%d] subIndex=[%d] sessionId=[%s] productType=[%s] verifyInfo=[%s]", new Object[]{Integer.valueOf(i2), Long.valueOf(j), Integer.valueOf(i), str, str2, str3}));
    return i2;
}
 
Example #23
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int createCIDTask(CIDTaskParam cIDTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(cIDTaskParam == null || getTaskId == null || !cIDTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createCIDTask(cIDTaskParam.mCid, cIDTaskParam.mGcid, cIDTaskParam.mBcid, cIDTaskParam.mFilePath, cIDTaskParam.mFileName, cIDTaskParam.mFileSize, cIDTaskParam.mCreateMode, cIDTaskParam.mSeqId, getTaskId);
        }
        decreRefCount();
    }
    return i;
}
 
Example #24
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int selectBtSubTask(long j, BtIndexSet btIndexSet) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || btIndexSet == null)) {
        i = this.mLoader.selectBtSubTask(j, btIndexSet);
    }
    decreRefCount();
    return i;
}
 
Example #25
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int btRemoveAddedResource(long j, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i3 = this.mLoader.btRemoveAddedResource(j, i, i2);
    }
    decreRefCount();
    return i3;
}
 
Example #26
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int setTaskGsState(long j, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i3 = this.mLoader.setTaskGsState(j, i, i2);
    }
    decreRefCount();
    return i3;
}
 
Example #27
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int setHttpHeaderProperty(long j, String str, String str2) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || str == null || str2 == null)) {
        i = this.mLoader.setHttpHeaderProperty(j, str, str2);
    }
    decreRefCount();
    return i;
}
 
Example #28
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
int notifyNetWorkType(int i, XLLoader xLLoader) {
    int i2 = 9900;
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && xLLoader != null) {
        try {
            i2 = xLLoader.notifyNetWorkType(i);
        } catch (Error e) {
            XLLog.e(TAG, "notifyNetWorkType failed," + e.getMessage());
        }
    }
    return i2;
}
 
Example #29
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int getBtSubTaskStatus(long j, BtTaskStatus btTaskStatus, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || btTaskStatus == null)) {
        i3 = this.mLoader.getBtSubTaskStatus(j, btTaskStatus, i, i2);
    }
    decreRefCount();
    return i3;
}
 
Example #30
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int createBtMagnetTask(MagnetTaskParam magnetTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(magnetTaskParam == null || getTaskId == null || !magnetTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createBtMagnetTask(magnetTaskParam.mUrl, magnetTaskParam.mFilePath, magnetTaskParam.mFileName, getTaskId);
        }
        decreRefCount();
    }
    return i;
}