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

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

View File

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