Skip to content

Commit

Permalink
Update document roots on vault unlock count changed
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Sep 29, 2023
1 parent 6c39e8b commit 9cb24f9
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.IBinder;
import android.provider.DocumentsContract;

import androidx.annotation.Nullable;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import org.cryptomator.data.cloud.crypto.Cryptors;
import org.cryptomator.presentation.BuildConfig;
import org.cryptomator.presentation.util.FileUtil;
import org.cryptomator.util.LockTimeout;
import org.cryptomator.util.SharedPreferencesHandler;
Expand Down Expand Up @@ -134,6 +137,12 @@ private void onUnlockCountChanged(int unlocked) {
notification.setUnlockedCount(unlocked);
notification.update();
signalVaultsUnlockedAndInBackgroundIfRequired();
updateDocumentProviderRoots();
}

private void updateDocumentProviderRoots() {
Uri rootsUri = DocumentsContract.buildRootsUri(BuildConfig.DOCUMENTS_PROVIDER_AUTHORITY);
getContentResolver().notifyChange(rootsUri, null);
}

private void onAppInForegroundChanged(boolean appInForeground) {
Expand Down

0 comments on commit 9cb24f9

Please sign in to comment.