Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class MetadataWorker(private val context: Context, params: WorkerParameters, pri
return Result.failure()
}

if (user.isAnonymous) {
Log_OC.w(TAG, "user is anonymous cannot start metadata worker")
return Result.failure()
}

val storageManager = FileDataStorageManager(user, context.contentResolver)
val currentDir = storageManager.getFileByDecryptedRemotePath(filePath)
if (currentDir == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import androidx.work.WorkManager
import com.google.android.material.snackbar.Snackbar
import com.nextcloud.android.common.ui.util.extensions.applyEdgeToEdgeWithSystemBarPadding
import com.nextcloud.client.account.UserAccountManager
Expand Down Expand Up @@ -61,6 +62,9 @@ class ManageSpaceActivity :
@Suppress("MagicNumber")
private suspend fun clearData() {
withContext(Dispatchers.IO) {
// cancel all works
WorkManager.getInstance(this@ManageSpaceActivity).cancelAllWork()

val lockPref = preferences.lockPreference
val passCodeEnable = SettingsActivity.LOCK_PASSCODE == lockPref
var passCodeDigits = arrayOfNulls<String>(4)
Expand All @@ -87,6 +91,7 @@ class ManageSpaceActivity :
val result = clearApplicationData()
withContext(Dispatchers.Main) {
if (result) {
finishAffinity()
finishAndRemoveTask()
exitProcess(0)
Copy link
Collaborator Author

@alperozturk96 alperozturk96 Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, FileDisplayActivity should not be launched after all accounts are removed on APP_RESUME. However, the app uses quite a bit of complex logic during startup.

Currently, FirstRunActivity, OnboardingServiceImpl, LauncherActivity, and AuthenticatorActivity all play a role in triggering the login flow and eventually FileDisplayActivity. To be honest, I’m not entirely sure why the app has four different launcher-related activities.

If you have any suggestions or ideas on a better approach to handle this, I’d really appreciate your feedback.

@ZetaTom @tobiasKaminsky

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,10 @@ public void swapDirectory(
return;
}

if (userId == null) {
return;
}

helper.prepareFileList(directory,
adapterDataProvider,
onlyOnDevice,
Expand Down
Loading