Loading app/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ android { defaultConfig { applicationId "foundation.e.drive" minSdk 26 targetSdk 31 targetSdk 34 versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch versionName "${versionMajor}.${versionMinor}.${versionPatch}" setProperty("archivesBaseName", "eDrive-$versionName") Loading Loading @@ -106,7 +106,7 @@ dependencies { implementation 'androidx.test:core:1.5.0' implementation 'com.jakewharton.timber:timber:5.0.1' implementation 'foundation.e:elib:0.0.1-alpha11' implementation 'foundation.e.lib:telemetry:0.0.8-alpha' implementation 'foundation.e.lib:telemetry:0.0.11-alpha' androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test:rules:1.5.0' Loading app/src/main/java/foundation/e/drive/work/CreateRemoteFolderWorker.java +40 −38 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class CreateRemoteFolderWorker extends Worker { @NonNull @Override public Result doWork() { try { final Context context = getApplicationContext(); final Account account = getAccount(); if (account == null) { Loading Loading @@ -89,13 +90,14 @@ public class CreateRemoteFolderWorker extends Worker { final CreateFolderRemoteOperation mkcolRequest = new CreateFolderRemoteOperation(syncedFolder.getRemoteFolder(), true); @SuppressWarnings("deprecation") final RemoteOperationResult result = mkcolRequest.execute(client); @SuppressWarnings("deprecation") final RemoteOperationResult result = mkcolRequest.execute(client); if (result.isSuccess() || result.getCode() == RemoteOperationResult.ResultCode.FOLDER_ALREADY_EXISTS) { DbHelper.insertSyncedFolder(syncedFolder, context); return Result.success(); } } catch (Exception exception) { Timber.e(exception); } return Result.retry(); } Loading app/src/main/java/foundation/e/drive/work/FirstStartWorker.java +18 −13 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public class FirstStartWorker extends Worker { @Override public Result doWork() { Timber.v("FirstStartWorker.doWork()"); try { final Context appContext = getApplicationContext(); enqueueAppListGenerationWorkRequest(appContext); Loading @@ -60,6 +61,10 @@ public class FirstStartWorker extends Worker { ((EdriveApplication) getApplicationContext()).startRecursiveFileObserver(); return Result.success(); } catch (Exception exception) { Timber.e(exception); } return Result.retry(); } private void enqueueAppListGenerationWorkRequest(@NonNull final Context context) { Loading app/src/main/java/foundation/e/drive/work/FullScanWorker.java +20 −15 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class FullScanWorker extends Worker { @NonNull @Override public Result doWork() { try { Timber.v("doWork(): going to send intent to ObserverService"); final SharedPreferences prefs = getApplicationContext().getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); Loading @@ -59,5 +60,9 @@ public class FullScanWorker extends Worker { } return Result.success(); } catch (Exception exception) { Timber.e(exception); return Result.retry(); } } } No newline at end of file app/src/main/java/foundation/e/drive/work/ListAppsWorker.java +13 −8 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class ListAppsWorker extends Worker { @Override public Result doWork() { Timber.d("generateAppListFile()"); try { final Context context = getApplicationContext(); final StringBuilder fileContents = listRegularApps(context); listPWAs(context, fileContents); Loading @@ -52,6 +53,10 @@ public class ListAppsWorker extends Worker { final boolean success = writeToFile(fileContents); return success ? Result.success() : Result.failure(); } catch (Exception exception) { Timber.e(exception); return Result.failure(); } } private StringBuilder listRegularApps(@NonNull final Context context) { Loading Loading @@ -89,7 +94,7 @@ public class ListAppsWorker extends Worker { .append("\n"); } catch (IllegalArgumentException exception) { Timber.e(exception, "Catched exception: invalid column names for cursor"); Timber.e(exception, "Caught exception: invalid column names for cursor"); } } while (cursor.moveToNext()); Loading Loading
app/build.gradle +2 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ android { defaultConfig { applicationId "foundation.e.drive" minSdk 26 targetSdk 31 targetSdk 34 versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch versionName "${versionMajor}.${versionMinor}.${versionPatch}" setProperty("archivesBaseName", "eDrive-$versionName") Loading Loading @@ -106,7 +106,7 @@ dependencies { implementation 'androidx.test:core:1.5.0' implementation 'com.jakewharton.timber:timber:5.0.1' implementation 'foundation.e:elib:0.0.1-alpha11' implementation 'foundation.e.lib:telemetry:0.0.8-alpha' implementation 'foundation.e.lib:telemetry:0.0.11-alpha' androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation 'androidx.test:rules:1.5.0' Loading
app/src/main/java/foundation/e/drive/work/CreateRemoteFolderWorker.java +40 −38 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ public class CreateRemoteFolderWorker extends Worker { @NonNull @Override public Result doWork() { try { final Context context = getApplicationContext(); final Account account = getAccount(); if (account == null) { Loading Loading @@ -89,13 +90,14 @@ public class CreateRemoteFolderWorker extends Worker { final CreateFolderRemoteOperation mkcolRequest = new CreateFolderRemoteOperation(syncedFolder.getRemoteFolder(), true); @SuppressWarnings("deprecation") final RemoteOperationResult result = mkcolRequest.execute(client); @SuppressWarnings("deprecation") final RemoteOperationResult result = mkcolRequest.execute(client); if (result.isSuccess() || result.getCode() == RemoteOperationResult.ResultCode.FOLDER_ALREADY_EXISTS) { DbHelper.insertSyncedFolder(syncedFolder, context); return Result.success(); } } catch (Exception exception) { Timber.e(exception); } return Result.retry(); } Loading
app/src/main/java/foundation/e/drive/work/FirstStartWorker.java +18 −13 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ public class FirstStartWorker extends Worker { @Override public Result doWork() { Timber.v("FirstStartWorker.doWork()"); try { final Context appContext = getApplicationContext(); enqueueAppListGenerationWorkRequest(appContext); Loading @@ -60,6 +61,10 @@ public class FirstStartWorker extends Worker { ((EdriveApplication) getApplicationContext()).startRecursiveFileObserver(); return Result.success(); } catch (Exception exception) { Timber.e(exception); } return Result.retry(); } private void enqueueAppListGenerationWorkRequest(@NonNull final Context context) { Loading
app/src/main/java/foundation/e/drive/work/FullScanWorker.java +20 −15 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class FullScanWorker extends Worker { @NonNull @Override public Result doWork() { try { Timber.v("doWork(): going to send intent to ObserverService"); final SharedPreferences prefs = getApplicationContext().getSharedPreferences(AppConstants.SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE); Loading @@ -59,5 +60,9 @@ public class FullScanWorker extends Worker { } return Result.success(); } catch (Exception exception) { Timber.e(exception); return Result.retry(); } } } No newline at end of file
app/src/main/java/foundation/e/drive/work/ListAppsWorker.java +13 −8 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ public class ListAppsWorker extends Worker { @Override public Result doWork() { Timber.d("generateAppListFile()"); try { final Context context = getApplicationContext(); final StringBuilder fileContents = listRegularApps(context); listPWAs(context, fileContents); Loading @@ -52,6 +53,10 @@ public class ListAppsWorker extends Worker { final boolean success = writeToFile(fileContents); return success ? Result.success() : Result.failure(); } catch (Exception exception) { Timber.e(exception); return Result.failure(); } } private StringBuilder listRegularApps(@NonNull final Context context) { Loading Loading @@ -89,7 +94,7 @@ public class ListAppsWorker extends Worker { .append("\n"); } catch (IllegalArgumentException exception) { Timber.e(exception, "Catched exception: invalid column names for cursor"); Timber.e(exception, "Caught exception: invalid column names for cursor"); } } while (cursor.moveToNext()); Loading