@@ -8899,7 +8899,7 @@ public void updateExternalMediaStatus(final boolean mediaStatus, final boolean r
88998899 // little while.
89008900 mHandler .post (new Runnable () {
89018901 public void run () {
8902- updateExternalMediaStatusInner (mediaStatus , reportStatus );
8902+ updateExternalMediaStatusInner (mediaStatus , reportStatus , true );
89038903 }
89048904 });
89058905 }
@@ -8909,7 +8909,7 @@ public void run() {
89098909 * Should block until all the ASEC containers are finished being scanned.
89108910 */
89118911 public void scanAvailableAsecs () {
8912- updateExternalMediaStatusInner (true , false );
8912+ updateExternalMediaStatusInner (true , false , false );
89138913 }
89148914
89158915 /*
@@ -8918,7 +8918,8 @@ public void scanAvailableAsecs() {
89188918 * Please note that we always have to report status if reportStatus has been
89198919 * set to true especially when unloading packages.
89208920 */
8921- private void updateExternalMediaStatusInner (boolean isMounted , boolean reportStatus ) {
8921+ private void updateExternalMediaStatusInner (boolean isMounted , boolean reportStatus ,
8922+ boolean externalStorage ) {
89228923 // Collection of uids
89238924 int uidArr [] = null ;
89248925 // Collection of stale containers
@@ -8956,6 +8957,14 @@ private void updateExternalMediaStatusInner(boolean isMounted, boolean reportSta
89568957 continue ;
89578958 }
89588959
8960+ /*
8961+ * Skip packages that are not external if we're unmounting
8962+ * external storage.
8963+ */
8964+ if (externalStorage && !isMounted && !isExternal (ps )) {
8965+ continue ;
8966+ }
8967+
89598968 final AsecInstallArgs args = new AsecInstallArgs (cid , isForwardLocked (ps ));
89608969 // The package status is changed only if the code path
89618970 // matches between settings and the container id.
0 commit comments