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

* commit '38cc2a5a3ad076fbbb0824a91f49730a4297549b':
  Do not eject internal ASECs when storage unmounted
This commit is contained in:
Kenny Root
2012-08-13 11:45:08 -07:00
committed by Android Git Automerger

View File

@@ -8899,7 +8899,7 @@ public class PackageManagerService extends IPackageManager.Stub {
// little while. // little while.
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
public void run() { 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. * Should block until all the ASEC containers are finished being scanned.
*/ */
public void scanAvailableAsecs() { 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 * Please note that we always have to report status if reportStatus has been
* set to true especially when unloading packages. * 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 // Collection of uids
int uidArr[] = null; int uidArr[] = null;
// Collection of stale containers // Collection of stale containers
@@ -8956,6 +8957,14 @@ public class PackageManagerService extends IPackageManager.Stub {
continue; 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)); final AsecInstallArgs args = new AsecInstallArgs(cid, isForwardLocked(ps));
// The package status is changed only if the code path // The package status is changed only if the code path
// matches between settings and the container id. // matches between settings and the container id.