Skip to content

Commit 3221bf2

Browse files
krutonAndroid Git Automerger
authored andcommitted
am 438a0ef: Do not eject internal ASECs when storage unmounted
* commit '438a0efcfbee5dc953e8e5bbdf4cb3dbe94b3f80': Do not eject internal ASECs when storage unmounted
2 parents 82c2ff5 + 438a0ef commit 3221bf2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

services/java/com/android/server/pm/PackageManagerService.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8833,7 +8833,7 @@ public void updateExternalMediaStatus(final boolean mediaStatus, final boolean r
88338833
// little while.
88348834
mHandler.post(new Runnable() {
88358835
public void run() {
8836-
updateExternalMediaStatusInner(mediaStatus, reportStatus);
8836+
updateExternalMediaStatusInner(mediaStatus, reportStatus, true);
88378837
}
88388838
});
88398839
}
@@ -8843,7 +8843,7 @@ public void run() {
88438843
* Should block until all the ASEC containers are finished being scanned.
88448844
*/
88458845
public void scanAvailableAsecs() {
8846-
updateExternalMediaStatusInner(true, false);
8846+
updateExternalMediaStatusInner(true, false, false);
88478847
}
88488848

88498849
/*
@@ -8852,7 +8852,8 @@ public void scanAvailableAsecs() {
88528852
* Please note that we always have to report status if reportStatus has been
88538853
* set to true especially when unloading packages.
88548854
*/
8855-
private void updateExternalMediaStatusInner(boolean isMounted, boolean reportStatus) {
8855+
private void updateExternalMediaStatusInner(boolean isMounted, boolean reportStatus,
8856+
boolean externalStorage) {
88568857
// Collection of uids
88578858
int uidArr[] = null;
88588859
// Collection of stale containers
@@ -8890,6 +8891,14 @@ private void updateExternalMediaStatusInner(boolean isMounted, boolean reportSta
88908891
continue;
88918892
}
88928893

8894+
/*
8895+
* Skip packages that are not external if we're unmounting
8896+
* external storage.
8897+
*/
8898+
if (externalStorage && !isMounted && !isExternal(ps)) {
8899+
continue;
8900+
}
8901+
88938902
final AsecInstallArgs args = new AsecInstallArgs(cid, isForwardLocked(ps));
88948903
// The package status is changed only if the code path
88958904
// matches between settings and the container id.

0 commit comments

Comments
 (0)