Loading app/src/main/java/foundation/e/drive/services/InitializerService.java +3 −10 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import foundation.e.drive.receivers.ScreenOffReceiver; import foundation.e.drive.utils.AppConstants; import foundation.e.drive.utils.CommonUtils; import foundation.e.drive.utils.JobUtils; import foundation.e.drive.utils.ServiceExceptionHandler; import static com.owncloud.android.lib.resources.files.FileUtils.PATH_SEPARATOR; import static foundation.e.drive.utils.AppConstants.INITIALFOLDERS_NUMBER; Loading @@ -50,9 +49,9 @@ import androidx.annotation.Nullable; */ public class InitializerService extends Service implements OnRemoteOperationListener { final private String TAG = InitializerService.class.getSimpleName(); //Complex properties private int existingRemoteFolderCounter; //@dev-only; Temporarily used to know if all remotePath exist private List<SyncedFolder> mSyncedFolders; //syncedFolders private int existingRemoteFolderCounter; //Temporarily used to know if all remotePath exist private List<SyncedFolder> mSyncedFolders; private OwnCloudClient mCloudClient; private Handler mHandler; private Account mAccount; Loading @@ -63,7 +62,6 @@ public class InitializerService extends Service implements OnRemoteOperationList Log.i(TAG, "onCreate()"); super.onCreate(); this.existingRemoteFolderCounter = 0; //JobUtils.scheduleInitializerJob(getApplicationContext()); } @Override Loading @@ -86,7 +84,6 @@ public class InitializerService extends Service implements OnRemoteOperationList accountName = intent.getExtras().getString( AccountManager.KEY_ACCOUNT_NAME, "" ); accountType = intent.getExtras().getString( AccountManager.KEY_ACCOUNT_TYPE, "" ); //If data come from intent, store them into pref because there aren't stored prefs.edit().putString( AccountManager.KEY_ACCOUNT_NAME, accountName ) .putString( AccountManager.KEY_ACCOUNT_TYPE, accountType ) .apply(); Loading @@ -94,7 +91,6 @@ public class InitializerService extends Service implements OnRemoteOperationList if(accountName.isEmpty() ) { Log.w(TAG, "Account's name not found. Neither in shared prefs nor in intent's extras"); //JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.InitializerJobId); stopSelf(); }else{ this.mAccount = CommonUtils.getAccount( accountName, accountType, AccountManager.get(this) ); Loading Loading @@ -123,7 +119,6 @@ public class InitializerService extends Service implements OnRemoteOperationList return; } //Get categories of element to sync List<String> syncCategories = new ArrayList<>(); if (CommonUtils.isMediaSyncEnabled(mAccount)) { Loading @@ -134,7 +129,6 @@ public class InitializerService extends Service implements OnRemoteOperationList syncCategories.addAll(Arrays.asList(SETTINGS_SYNCABLE_CATEGORIES)); } //Get SyncedFolders getInitialSyncedFolders(syncCategories); this.existingRemoteFolderCounter = 0; Loading Loading @@ -213,7 +207,6 @@ public class InitializerService extends Service implements OnRemoteOperationList this.restartFolderCreationCounter = 0; if( this.mSyncedFolders == null || this.mSyncedFolders.isEmpty() ){ //JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.InitializerJobId); this.stopSelf(); } Loading Loading
app/src/main/java/foundation/e/drive/services/InitializerService.java +3 −10 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ import foundation.e.drive.receivers.ScreenOffReceiver; import foundation.e.drive.utils.AppConstants; import foundation.e.drive.utils.CommonUtils; import foundation.e.drive.utils.JobUtils; import foundation.e.drive.utils.ServiceExceptionHandler; import static com.owncloud.android.lib.resources.files.FileUtils.PATH_SEPARATOR; import static foundation.e.drive.utils.AppConstants.INITIALFOLDERS_NUMBER; Loading @@ -50,9 +49,9 @@ import androidx.annotation.Nullable; */ public class InitializerService extends Service implements OnRemoteOperationListener { final private String TAG = InitializerService.class.getSimpleName(); //Complex properties private int existingRemoteFolderCounter; //@dev-only; Temporarily used to know if all remotePath exist private List<SyncedFolder> mSyncedFolders; //syncedFolders private int existingRemoteFolderCounter; //Temporarily used to know if all remotePath exist private List<SyncedFolder> mSyncedFolders; private OwnCloudClient mCloudClient; private Handler mHandler; private Account mAccount; Loading @@ -63,7 +62,6 @@ public class InitializerService extends Service implements OnRemoteOperationList Log.i(TAG, "onCreate()"); super.onCreate(); this.existingRemoteFolderCounter = 0; //JobUtils.scheduleInitializerJob(getApplicationContext()); } @Override Loading @@ -86,7 +84,6 @@ public class InitializerService extends Service implements OnRemoteOperationList accountName = intent.getExtras().getString( AccountManager.KEY_ACCOUNT_NAME, "" ); accountType = intent.getExtras().getString( AccountManager.KEY_ACCOUNT_TYPE, "" ); //If data come from intent, store them into pref because there aren't stored prefs.edit().putString( AccountManager.KEY_ACCOUNT_NAME, accountName ) .putString( AccountManager.KEY_ACCOUNT_TYPE, accountType ) .apply(); Loading @@ -94,7 +91,6 @@ public class InitializerService extends Service implements OnRemoteOperationList if(accountName.isEmpty() ) { Log.w(TAG, "Account's name not found. Neither in shared prefs nor in intent's extras"); //JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.InitializerJobId); stopSelf(); }else{ this.mAccount = CommonUtils.getAccount( accountName, accountType, AccountManager.get(this) ); Loading Loading @@ -123,7 +119,6 @@ public class InitializerService extends Service implements OnRemoteOperationList return; } //Get categories of element to sync List<String> syncCategories = new ArrayList<>(); if (CommonUtils.isMediaSyncEnabled(mAccount)) { Loading @@ -134,7 +129,6 @@ public class InitializerService extends Service implements OnRemoteOperationList syncCategories.addAll(Arrays.asList(SETTINGS_SYNCABLE_CATEGORIES)); } //Get SyncedFolders getInitialSyncedFolders(syncCategories); this.existingRemoteFolderCounter = 0; Loading Loading @@ -213,7 +207,6 @@ public class InitializerService extends Service implements OnRemoteOperationList this.restartFolderCreationCounter = 0; if( this.mSyncedFolders == null || this.mSyncedFolders.isEmpty() ){ //JobUtils.stopScheduledJob(getApplicationContext(), JobUtils.InitializerJobId); this.stopSelf(); } Loading