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

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

View File

@ -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.