Java Code Examples for com.xunlei.downloadlib.parameter.XLConstant.XLManagerStatus#MANAGER_RUNNING

The following examples show how to use com.xunlei.downloadlib.parameter.XLConstant.XLManagerStatus#MANAGER_RUNNING . 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 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 2
Source File: XLDownloadManager.java    From BtPlayer 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 3
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int setFileName(long j, String str) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || str == null)) {
        i = this.mLoader.setFileName(j, str);
    }
    decreRefCount();
    return i;
}
 
Example 4
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.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 5
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 5 votes vote down vote up
public int createEmuleTask(EmuleTaskParam emuleTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(emuleTaskParam == null || getTaskId == null || !emuleTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createEmuleTask(emuleTaskParam.mUrl, emuleTaskParam.mFilePath, emuleTaskParam.mFileName, emuleTaskParam.mCreateMode, emuleTaskParam.mSeqId, getTaskId);
        }
        decreRefCount();
    }
    return i;
}
 
Example 6
Source File: XLDownloadManager.java    From MiniThunder 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 7
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 8
Source File: XLDownloadManager.java    From BtPlayer 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 9
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int setOriginUserAgent(long j, String str) {
    int i = 9900;
    increRefCount();
    if (!(mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || str == null)) {
        i = this.mLoader.setOriginUserAgent(j, str);
    }
    decreRefCount();
    return i;
}
 
Example 10
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 11
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int setTaskLxState(long j, int i, int i2) {
    int i3 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i3 = this.mLoader.setTaskLxState(j, i, i2);
    }
    decreRefCount();
    return i3;
}
 
Example 12
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 13
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public int setTaskAllowUseResource(long j, int i) {
    int i2 = 9900;
    increRefCount();
    if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
        i2 = this.mLoader.setTaskAllowUseResource(j, i);
    }
    decreRefCount();
    return i2;
}
 
Example 14
Source File: XLDownloadManager.java    From AndroidDownload 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 15
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 5 votes vote down vote up
public int createP2spTask(P2spTaskParam p2spTaskParam, GetTaskId getTaskId) {
    int i = 9900;
    if (!(p2spTaskParam == null || getTaskId == null || !p2spTaskParam.checkMemberVar())) {
        increRefCount();
        if (mDownloadManagerState == XLManagerStatus.MANAGER_RUNNING && this.mLoader != null) {
            i = this.mLoader.createP2spTask(p2spTaskParam.mUrl, p2spTaskParam.mRefUrl, p2spTaskParam.mCookie, p2spTaskParam.mUser, p2spTaskParam.mPass, p2spTaskParam.mFilePath, p2spTaskParam.mFileName, p2spTaskParam.mCreateMode, p2spTaskParam.mSeqId, getTaskId);
        }
        decreRefCount();
    }
    return i;
}
 
Example 16
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.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 17
Source File: XLDownloadManager.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
int notifyNetWorkCarrier(int i) {
    if (mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null) {
        return 9900;
    }
    return this.mLoader.setNotifyNetWorkCarrier(i);
}
 
Example 18
Source File: XLDownloadManager.java    From AndroidDownload with Apache License 2.0 4 votes vote down vote up
private int setLocalProperty(String str, String str2) {
    if (mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null || str == null || str2 == null) {
        return 9900;
    }
    return this.mLoader.setLocalProperty(str, str2);
}
 
Example 19
Source File: XLDownloadManager.java    From BtPlayer with Apache License 2.0 4 votes vote down vote up
int notifyNetWorkCarrier(int i) {
    if (mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null) {
        return 9900;
    }
    return this.mLoader.setNotifyNetWorkCarrier(i);
}
 
Example 20
Source File: XLDownloadManager.java    From MiniThunder with Apache License 2.0 4 votes vote down vote up
int notifyNetWorkCarrier(int i) {
    if (mDownloadManagerState != XLManagerStatus.MANAGER_RUNNING || this.mLoader == null) {
        return 9900;
    }
    return this.mLoader.setNotifyNetWorkCarrier(i);
}