Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b501ef1e authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Aggressively clear cached data when forgetting.

Otherwise the system server risks keeping open FDs to an adopted
storage device that could later be ejected.

Test: builds
Bug: 31596654
Change-Id: I6285042b4f0714dbf601c7dfa53efb704ea29d0b
parent 5ddd7172
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1877,6 +1877,11 @@ public class PackageManagerService extends IPackageManager.Stub {
                    Slog.d(TAG, "Destroying " + ps.name + " because volume was forgotten");
                    deletePackage(ps.name, new LegacyPackageDeleteObserver(null).getBinder(),
                            UserHandle.USER_SYSTEM, PackageManager.DELETE_ALL_USERS);
                    // Try very hard to release any references to this package
                    // so we don't risk the system server being killed due to
                    // open FDs
                    AttributeCache.instance().removePackage(ps.name);
                }
                mSettings.onVolumeForgotten(fsUuid);