Loading services/core/java/com/android/server/pm/AppDataHelper.java +11 −5 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.pm; import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER; import static com.android.server.pm.PackageManagerService.TAG; import static com.android.server.pm.PackageManagerServiceUtils.getPackageManagerLocal; import static com.android.server.pm.PackageManagerServiceUtils.logCriticalInfo; Loading Loading @@ -228,7 +227,7 @@ public class AppDataHelper { userId, flags, appId, seInfo, targetSdkVersion, usesSdk); args.previousAppId = previousAppId; return batch.createAppData(args).whenComplete((ceDataInode, e) -> { return batch.createAppData(args).whenComplete((createAppDataResult, e) -> { // Note: this code block is executed with the Installer lock // already held, since it's invoked as a side-effect of // executeBatchLI() Loading @@ -237,7 +236,7 @@ public class AppDataHelper { + ", but trying to recover: " + e); destroyAppDataLeafLIF(pkg, userId, flags); try { ceDataInode = mInstaller.createAppData(args).ceDataInode; createAppDataResult = mInstaller.createAppData(args); logCriticalInfo(Log.DEBUG, "Recovery succeeded!"); } catch (Installer.InstallerException e2) { logCriticalInfo(Log.DEBUG, "Recovery failed!"); Loading Loading @@ -279,12 +278,19 @@ public class AppDataHelper { } } final long ceDataInode = createAppDataResult.ceDataInode; final long deDataInode = createAppDataResult.deDataInode; if ((flags & StorageManager.FLAG_STORAGE_CE) != 0 && ceDataInode != -1) { // TODO: mark this structure as dirty so we persist it! synchronized (mPm.mLock) { ps.setCeDataInode(ceDataInode, userId); } } if ((flags & StorageManager.FLAG_STORAGE_DE) != 0 && deDataInode != -1) { synchronized (mPm.mLock) { ps.setDeDataInode(deDataInode, userId); } } prepareAppDataContentsLeafLIF(pkg, ps, userId, flags); }); Loading Loading @@ -609,7 +615,7 @@ public class AppDataHelper { destroyAppDataLeafLIF(pkg, userId, flags); } public void destroyAppDataLeafLIF(AndroidPackage pkg, int userId, int flags) { private void destroyAppDataLeafLIF(AndroidPackage pkg, int userId, int flags) { final Computer snapshot = mPm.snapshotComputer(); final PackageStateInternal packageStateInternal = snapshot.getPackageStateInternal(pkg.getPackageName()); Loading services/core/java/com/android/server/pm/DeletePackageHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ final class DeletePackageHelper { ps.setUserState(nextUserId, ps.getCeDataInode(nextUserId), ps.getDeDataInode(nextUserId), COMPONENT_ENABLED_STATE_DEFAULT, false /*installed*/, true /*stopped*/, Loading services/core/java/com/android/server/pm/Installer.java +7 −5 Original line number Diff line number Diff line Loading @@ -257,6 +257,7 @@ public class Installer extends SystemService { private static CreateAppDataResult buildPlaceholderCreateAppDataResult() { final CreateAppDataResult result = new CreateAppDataResult(); result.ceDataInode = -1; result.deDataInode = -1; result.exceptionCode = 0; result.exceptionMessage = null; return result; Loading Loading @@ -361,7 +362,7 @@ public class Installer extends SystemService { private boolean mExecuted; private final List<CreateAppDataArgs> mArgs = new ArrayList<>(); private final List<CompletableFuture<Long>> mFutures = new ArrayList<>(); private final List<CompletableFuture<CreateAppDataResult>> mFutures = new ArrayList<>(); /** * Enqueue the given {@code installd} operation to be executed in the Loading @@ -371,11 +372,12 @@ public class Installer extends SystemService { * {@link Installer} object. */ @NonNull public synchronized CompletableFuture<Long> createAppData(CreateAppDataArgs args) { public synchronized CompletableFuture<CreateAppDataResult> createAppData( CreateAppDataArgs args) { if (mExecuted) { throw new IllegalStateException(); } final CompletableFuture<Long> future = new CompletableFuture<>(); final CompletableFuture<CreateAppDataResult> future = new CompletableFuture<>(); mArgs.add(args); mFutures.add(future); return future; Loading @@ -402,9 +404,9 @@ public class Installer extends SystemService { final CreateAppDataResult[] results = installer.createAppDataBatched(args); for (int j = 0; j < results.length; j++) { final CreateAppDataResult result = results[j]; final CompletableFuture<Long> future = mFutures.get(i + j); final CompletableFuture<CreateAppDataResult> future = mFutures.get(i + j); if (result.exceptionCode == 0) { future.complete(result.ceDataInode); future.complete(result); } else { future.completeExceptionally( new InstallerException(result.exceptionMessage)); Loading services/core/java/com/android/server/pm/PackageSetting.java +23 −13 File changed.Preview size limit exceeded, changes collapsed. Show changes services/core/java/com/android/server/pm/RemovePackageHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,7 @@ final class RemovePackageHelper { mAppDataHelper.destroyAppDataLIF(pkg, nextUserId, FLAG_STORAGE_DE | FLAG_STORAGE_CE | FLAG_STORAGE_EXTERNAL); ps.setCeDataInode(-1, nextUserId); ps.setDeDataInode(-1, nextUserId); } mAppDataHelper.clearKeystoreData(nextUserId, ps.getAppId()); preferredActivityHelper.clearPackagePreferredActivities(ps.getPackageName(), Loading Loading
services/core/java/com/android/server/pm/AppDataHelper.java +11 −5 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.pm; import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER; import static com.android.server.pm.PackageManagerService.TAG; import static com.android.server.pm.PackageManagerServiceUtils.getPackageManagerLocal; import static com.android.server.pm.PackageManagerServiceUtils.logCriticalInfo; Loading Loading @@ -228,7 +227,7 @@ public class AppDataHelper { userId, flags, appId, seInfo, targetSdkVersion, usesSdk); args.previousAppId = previousAppId; return batch.createAppData(args).whenComplete((ceDataInode, e) -> { return batch.createAppData(args).whenComplete((createAppDataResult, e) -> { // Note: this code block is executed with the Installer lock // already held, since it's invoked as a side-effect of // executeBatchLI() Loading @@ -237,7 +236,7 @@ public class AppDataHelper { + ", but trying to recover: " + e); destroyAppDataLeafLIF(pkg, userId, flags); try { ceDataInode = mInstaller.createAppData(args).ceDataInode; createAppDataResult = mInstaller.createAppData(args); logCriticalInfo(Log.DEBUG, "Recovery succeeded!"); } catch (Installer.InstallerException e2) { logCriticalInfo(Log.DEBUG, "Recovery failed!"); Loading Loading @@ -279,12 +278,19 @@ public class AppDataHelper { } } final long ceDataInode = createAppDataResult.ceDataInode; final long deDataInode = createAppDataResult.deDataInode; if ((flags & StorageManager.FLAG_STORAGE_CE) != 0 && ceDataInode != -1) { // TODO: mark this structure as dirty so we persist it! synchronized (mPm.mLock) { ps.setCeDataInode(ceDataInode, userId); } } if ((flags & StorageManager.FLAG_STORAGE_DE) != 0 && deDataInode != -1) { synchronized (mPm.mLock) { ps.setDeDataInode(deDataInode, userId); } } prepareAppDataContentsLeafLIF(pkg, ps, userId, flags); }); Loading Loading @@ -609,7 +615,7 @@ public class AppDataHelper { destroyAppDataLeafLIF(pkg, userId, flags); } public void destroyAppDataLeafLIF(AndroidPackage pkg, int userId, int flags) { private void destroyAppDataLeafLIF(AndroidPackage pkg, int userId, int flags) { final Computer snapshot = mPm.snapshotComputer(); final PackageStateInternal packageStateInternal = snapshot.getPackageStateInternal(pkg.getPackageName()); Loading
services/core/java/com/android/server/pm/DeletePackageHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ final class DeletePackageHelper { ps.setUserState(nextUserId, ps.getCeDataInode(nextUserId), ps.getDeDataInode(nextUserId), COMPONENT_ENABLED_STATE_DEFAULT, false /*installed*/, true /*stopped*/, Loading
services/core/java/com/android/server/pm/Installer.java +7 −5 Original line number Diff line number Diff line Loading @@ -257,6 +257,7 @@ public class Installer extends SystemService { private static CreateAppDataResult buildPlaceholderCreateAppDataResult() { final CreateAppDataResult result = new CreateAppDataResult(); result.ceDataInode = -1; result.deDataInode = -1; result.exceptionCode = 0; result.exceptionMessage = null; return result; Loading Loading @@ -361,7 +362,7 @@ public class Installer extends SystemService { private boolean mExecuted; private final List<CreateAppDataArgs> mArgs = new ArrayList<>(); private final List<CompletableFuture<Long>> mFutures = new ArrayList<>(); private final List<CompletableFuture<CreateAppDataResult>> mFutures = new ArrayList<>(); /** * Enqueue the given {@code installd} operation to be executed in the Loading @@ -371,11 +372,12 @@ public class Installer extends SystemService { * {@link Installer} object. */ @NonNull public synchronized CompletableFuture<Long> createAppData(CreateAppDataArgs args) { public synchronized CompletableFuture<CreateAppDataResult> createAppData( CreateAppDataArgs args) { if (mExecuted) { throw new IllegalStateException(); } final CompletableFuture<Long> future = new CompletableFuture<>(); final CompletableFuture<CreateAppDataResult> future = new CompletableFuture<>(); mArgs.add(args); mFutures.add(future); return future; Loading @@ -402,9 +404,9 @@ public class Installer extends SystemService { final CreateAppDataResult[] results = installer.createAppDataBatched(args); for (int j = 0; j < results.length; j++) { final CreateAppDataResult result = results[j]; final CompletableFuture<Long> future = mFutures.get(i + j); final CompletableFuture<CreateAppDataResult> future = mFutures.get(i + j); if (result.exceptionCode == 0) { future.complete(result.ceDataInode); future.complete(result); } else { future.completeExceptionally( new InstallerException(result.exceptionMessage)); Loading
services/core/java/com/android/server/pm/PackageSetting.java +23 −13 File changed.Preview size limit exceeded, changes collapsed. Show changes
services/core/java/com/android/server/pm/RemovePackageHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -277,6 +277,7 @@ final class RemovePackageHelper { mAppDataHelper.destroyAppDataLIF(pkg, nextUserId, FLAG_STORAGE_DE | FLAG_STORAGE_CE | FLAG_STORAGE_EXTERNAL); ps.setCeDataInode(-1, nextUserId); ps.setDeDataInode(-1, nextUserId); } mAppDataHelper.clearKeystoreData(nextUserId, ps.getAppId()); preferredActivityHelper.clearPackagePreferredActivities(ps.getPackageName(), Loading