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

Commit 38cc2a5a authored by Kenny Root's avatar Kenny Root Committed by Android Git Automerger
Browse files

am 3221bf27: am 438a0efc: Do not eject internal ASECs when storage unmounted

* commit '3221bf27':
  Do not eject internal ASECs when storage unmounted
parents 4d198869 3221bf27
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -8899,7 +8899,7 @@ public class PackageManagerService extends IPackageManager.Stub {
        // little while.
        mHandler.post(new Runnable() {
            public void run() {
                updateExternalMediaStatusInner(mediaStatus, reportStatus);
                updateExternalMediaStatusInner(mediaStatus, reportStatus, true);
            }
        });
    }
@@ -8909,7 +8909,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);
    }

    /*
@@ -8918,7 +8918,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
@@ -8956,6 +8957,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.