Loading app/src/main/java/foundation/e/drive/services/ObserverService.java +6 −10 Original line number Diff line number Diff line Loading @@ -130,9 +130,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.i(TAG, "onStartCommand"); SharedPreferences prefs = this.getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); if (prefs.getBoolean(INITIALIZATION_HAS_BEEN_DONE, false)) { Loading @@ -150,17 +147,16 @@ public class ObserverService extends Service implements OnRemoteOperationListene CommonUtils.getOwnCloudClient(this.mAccount, getApplicationContext(), this); else begin(); }else{ JobUtils.stopScheduledJob(this, JobUtils.ScannerJobId); //If no account }else{ //Neither media nor settings are allowed to be sync this.stopSelf(); } } else {//If initialization not done Log.w(TAG, "ContentResolver.getSyncAutomatically(account, '**_PROVIDER_AUTHORITY') return false"); } else {//If no account JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.ScannerJobId); this.stopSelf(); } }else{ Log.w(TAG, "Server must be initialized before to start"); Intent initializerIntent = new Intent(this, InitializerService.class); Intent initializerIntent = new Intent(getApplicationContext(), InitializerService.class); startService(initializerIntent); this.stopSelf(); } Loading @@ -179,7 +175,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene //If there is a internet connexion if (CommonUtils.haveNetworkConnexion(this)) { if (!mBoundToOperationManager) { Intent opMgrSrvIntent = new Intent(this, OperationManagerService.class); Intent opMgrSrvIntent = new Intent(getApplicationContext(), OperationManagerService.class); bindService(opMgrSrvIntent, this.mOperationManagerServiceConnection, Context.BIND_NOT_FOREGROUND); } else { clearCachedFile(); Loading Loading
app/src/main/java/foundation/e/drive/services/ObserverService.java +6 −10 Original line number Diff line number Diff line Loading @@ -130,9 +130,6 @@ public class ObserverService extends Service implements OnRemoteOperationListene @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.i(TAG, "onStartCommand"); SharedPreferences prefs = this.getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); if (prefs.getBoolean(INITIALIZATION_HAS_BEEN_DONE, false)) { Loading @@ -150,17 +147,16 @@ public class ObserverService extends Service implements OnRemoteOperationListene CommonUtils.getOwnCloudClient(this.mAccount, getApplicationContext(), this); else begin(); }else{ JobUtils.stopScheduledJob(this, JobUtils.ScannerJobId); //If no account }else{ //Neither media nor settings are allowed to be sync this.stopSelf(); } } else {//If initialization not done Log.w(TAG, "ContentResolver.getSyncAutomatically(account, '**_PROVIDER_AUTHORITY') return false"); } else {//If no account JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.ScannerJobId); this.stopSelf(); } }else{ Log.w(TAG, "Server must be initialized before to start"); Intent initializerIntent = new Intent(this, InitializerService.class); Intent initializerIntent = new Intent(getApplicationContext(), InitializerService.class); startService(initializerIntent); this.stopSelf(); } Loading @@ -179,7 +175,7 @@ public class ObserverService extends Service implements OnRemoteOperationListene //If there is a internet connexion if (CommonUtils.haveNetworkConnexion(this)) { if (!mBoundToOperationManager) { Intent opMgrSrvIntent = new Intent(this, OperationManagerService.class); Intent opMgrSrvIntent = new Intent(getApplicationContext(), OperationManagerService.class); bindService(opMgrSrvIntent, this.mOperationManagerServiceConnection, Context.BIND_NOT_FOREGROUND); } else { clearCachedFile(); Loading