Loading app/src/main/java/foundation/e/drive/services/ObserverService.java +27 −7 Original line number Diff line number Diff line Loading @@ -131,12 +131,20 @@ public class ObserverService extends Service implements OnRemoteOperationListene //Check this service isn't already working if (isWorking) { Log.w(TAG, "ObserverService is already working"); return super.onStartCommand(intent, flags, startId); getApplicationContext().stopService(new Intent(getApplicationContext(), ObserverService.class)); // return super.onStartCommand(intent, flags, startId); startService(new Intent(this, ObserverService.class)); } //check OperationManagerService isn't working if (prefs.getBoolean(AppConstants.KEY_OMS_IS_WORKING, false)) { Log.w(TAG, "OperationManagerService is still performing some operation"); getApplicationContext().stopService(new Intent(getApplicationContext(), OperationManagerService.class)); if (operationsForIntent != null && !operationsForIntent.isEmpty()) { startOperationManagerService(); } } //Check a minimum delay has been respected between two start. Loading Loading @@ -338,13 +346,15 @@ public class ObserverService extends Service implements OnRemoteOperationListene //After everything has been scanned. Send Intent to OperationmanagerService with data in bundle if (operationsForIntent != null && !operationsForIntent.isEmpty()) { Intent OMSIntent = new Intent(this, OperationManagerService.class); for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); } // Intent OMSIntent = new Intent(this, OperationManagerService.class); // for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { // OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); // } // // OMSIntent.putExtra("account", mAccount); // startService(OMSIntent); OMSIntent.putExtra("account", mAccount); startService(OMSIntent); startOperationManagerService(); Loading Loading @@ -380,6 +390,16 @@ public class ObserverService extends Service implements OnRemoteOperationListene return result; } private void startOperationManagerService() { Intent OMSIntent = new Intent(this, OperationManagerService.class); for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); } OMSIntent.putExtra("account", mAccount); startService(OMSIntent); } /* methods related to Server Scanning */ /** Loading Loading
app/src/main/java/foundation/e/drive/services/ObserverService.java +27 −7 Original line number Diff line number Diff line Loading @@ -131,12 +131,20 @@ public class ObserverService extends Service implements OnRemoteOperationListene //Check this service isn't already working if (isWorking) { Log.w(TAG, "ObserverService is already working"); return super.onStartCommand(intent, flags, startId); getApplicationContext().stopService(new Intent(getApplicationContext(), ObserverService.class)); // return super.onStartCommand(intent, flags, startId); startService(new Intent(this, ObserverService.class)); } //check OperationManagerService isn't working if (prefs.getBoolean(AppConstants.KEY_OMS_IS_WORKING, false)) { Log.w(TAG, "OperationManagerService is still performing some operation"); getApplicationContext().stopService(new Intent(getApplicationContext(), OperationManagerService.class)); if (operationsForIntent != null && !operationsForIntent.isEmpty()) { startOperationManagerService(); } } //Check a minimum delay has been respected between two start. Loading Loading @@ -338,13 +346,15 @@ public class ObserverService extends Service implements OnRemoteOperationListene //After everything has been scanned. Send Intent to OperationmanagerService with data in bundle if (operationsForIntent != null && !operationsForIntent.isEmpty()) { Intent OMSIntent = new Intent(this, OperationManagerService.class); for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); } // Intent OMSIntent = new Intent(this, OperationManagerService.class); // for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { // OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); // } // // OMSIntent.putExtra("account", mAccount); // startService(OMSIntent); OMSIntent.putExtra("account", mAccount); startService(OMSIntent); startOperationManagerService(); Loading Loading @@ -380,6 +390,16 @@ public class ObserverService extends Service implements OnRemoteOperationListene return result; } private void startOperationManagerService() { Intent OMSIntent = new Intent(this, OperationManagerService.class); for (Map.Entry<Integer, Parcelable> entry : operationsForIntent.entrySet()) { OMSIntent.putExtra(entry.getKey() + "", entry.getValue()); } OMSIntent.putExtra("account", mAccount); startService(OMSIntent); } /* methods related to Server Scanning */ /** Loading