@@ -130,7 +130,7 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
*/
privatesynchronizedvoidstartWork(intthreadIndex){
Log.i(TAG,"startWork("+threadIndex+")");
if(!mThreadWorkingState[threadIndex]||CommonUtils.haveNetworkConnexion(getApplicationContext())){//check if the thread corresponding to threadIndex isn't already working
if(!mThreadWorkingState[threadIndex]&&CommonUtils.haveNetworkConnexion(getApplicationContext())){//check if the thread corresponding to threadIndex isn't already working
ComparableOperationoperation=this.mOperationsQueue.poll();//return null if deque is empty
if(operation!=null){
...
...
@@ -152,18 +152,6 @@ public class OperationManagerService extends Service implements OnRemoteOperatio
}//else : thread is already running or no network connexion
}
/**
* Tell if there is at least one thread which can get new task to do
* @return boolean true if there is a free thread place else return false
*/
privatebooleanisThereAFreeThread(){
for(inti=-1;++i<workerAmount;){
if(!mThreadWorkingState[i])
returntrue;
}
returnfalse;
}
@Nullable
@Override
publicIBinderonBind(Intentintent){
...
...
@@ -326,7 +314,7 @@ public class OperationManagerService extends Service implements OnRemoteOperatio