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

Commit 9da97c2d authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Don't kill apps receiving OP_REQUEST_INSTALL_PACKAGES.

We used to kill these apps to give them the correct OBB mount view; but
very few apps use OBBs in the first place, and those that do can
manually restart to make sure they have the correct access permissions.

Bug: 157493954
Bug: 157674306
Test: atest CtsPackageInstallTestCases
Change-Id: Ia97c9f70b4184edf83c030b8a8ee0e5c7de127ec
parent ed7b77e8
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -4637,10 +4637,13 @@ class StorageManagerService extends IStorageManager.Stub
                // When using FUSE, we may need to kill the app if the op changes
                switch(code) {
                    case OP_REQUEST_INSTALL_PACKAGES:
                        if (previousMode == MODE_ALLOWED || mode == MODE_ALLOWED) {
                            // If we transition to/from MODE_ALLOWED, kill the app to make
                            // sure it has the correct view of /storage. Changing between
                            // MODE_DEFAULT / MODE_ERRORED is a no-op
                        // In R, we used to kill the app here if it transitioned to/from
                        // MODE_ALLOWED, to make sure the app had the correct (writable) OBB
                        // view. But the majority of apps don't handle OBBs anyway, and for those
                        // that do, they can restart themselves. Therefore, starting from S,
                        // only kill the app when it transitions away from MODE_ALLOWED (eg,
                        // when the permission is taken away).
                        if (previousMode == MODE_ALLOWED && mode != MODE_ALLOWED) {
                            killAppForOpChange(code, uid);
                        }
                        return;