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

Commit 438a0efc authored by Kenny Root's avatar Kenny Root
Browse files

Do not eject internal ASECs when storage unmounted

If the incoming request is to notify of storage unmounted, don't mess
with apps that are in internal ASECs.

Bug: 6948035
Change-Id: I63ffb895c4d994ee03a5a9bd6bb23f69c88e2a87
parent ea31b47a
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -8833,7 +8833,7 @@ public class PackageManagerService extends IPackageManager.Stub {
        // little while.
        mHandler.post(new Runnable() {
            public void run() {
                updateExternalMediaStatusInner(mediaStatus, reportStatus);
                updateExternalMediaStatusInner(mediaStatus, reportStatus, true);
            }
        });
    }
@@ -8843,7 +8843,7 @@ public class PackageManagerService extends IPackageManager.Stub {
     * Should block until all the ASEC containers are finished being scanned.
     */
    public void scanAvailableAsecs() {
        updateExternalMediaStatusInner(true, false);
        updateExternalMediaStatusInner(true, false, false);
    }

    /*
@@ -8852,7 +8852,8 @@ public class PackageManagerService extends IPackageManager.Stub {
     * Please note that we always have to report status if reportStatus has been
     * set to true especially when unloading packages.
     */
    private void updateExternalMediaStatusInner(boolean isMounted, boolean reportStatus) {
    private void updateExternalMediaStatusInner(boolean isMounted, boolean reportStatus,
            boolean externalStorage) {
        // Collection of uids
        int uidArr[] = null;
        // Collection of stale containers
@@ -8890,6 +8891,14 @@ public class PackageManagerService extends IPackageManager.Stub {
                        continue;
                    }

                    /*
                     * Skip packages that are not external if we're unmounting
                     * external storage.
                     */
                    if (externalStorage && !isMounted && !isExternal(ps)) {
                        continue;
                    }

                    final AsecInstallArgs args = new AsecInstallArgs(cid, isForwardLocked(ps));
                    // The package status is changed only if the code path
                    // matches between settings and the container id.