Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed1b65b1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Retain DownloadManager Uri grants when clearing."

parents 38d20cc5 23ec8112
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -200,6 +200,7 @@ import android.os.WorkSource;
import android.os.storage.IStorageManager;
import android.os.storage.StorageManagerInternal;
import android.os.storage.StorageManager;
import android.provider.Downloads;
import android.provider.Settings;
import android.service.voice.IVoiceInteractionSession;
import android.service.voice.VoiceInteractionManagerInternal;
@@ -8513,6 +8514,12 @@ public class ActivityManagerService extends IActivityManager.Stub
                    // Only inspect grants matching package
                    if (packageName == null || perm.sourcePkg.equals(packageName)
                            || perm.targetPkg.equals(packageName)) {
                        // Hacky solution as part of fixing a security bug; ignore
                        // grants associated with DownloadManager so we don't have
                        // to immediately launch it to regrant the permissions
                        if (Downloads.Impl.AUTHORITY.equals(perm.uri.uri.getAuthority())
                                && !persistable) continue;
                        persistChanged |= perm.revokeModes(persistable
                                ? ~0 : ~Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION, true);