From 5d9dcf7aa37c546ee83421fec993c1c8f39b644d Mon Sep 17 00:00:00 2001 From: lpeter Date: Mon, 8 May 2023 16:19:19 +0800 Subject: [PATCH] Don't need to check whether codePath /oat dir is existed. The oat directory doesn't always exist, so it will cause the failure when moving the package by this check. As the comment on the b/167241596, we don't need this check. We remove this check. Bug: 167241596 Test: build pass and boot success Test: atest CrossUserPackageVisibilityTests Change-Id: I6ad9b3269a07de53ee6cf07414308acfffec44e7 --- .../core/java/com/android/server/pm/MovePackageHelper.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/pm/MovePackageHelper.java b/services/core/java/com/android/server/pm/MovePackageHelper.java index bec5a9a7782cd..bf239682d8bb0 100644 --- a/services/core/java/com/android/server/pm/MovePackageHelper.java +++ b/services/core/java/com/android/server/pm/MovePackageHelper.java @@ -100,16 +100,13 @@ public final class MovePackageHelper { "3rd party apps are not allowed on internal storage"); } - - final String currentVolumeUuid = packageState.getVolumeUuid(); - final File probe = new File(pkg.getPath()); - final File probeOat = new File(probe, "oat"); - if (!probe.isDirectory() || !probeOat.isDirectory()) { + if (!probe.isDirectory()) { throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR, "Move only supported for modern cluster style installs"); } + final String currentVolumeUuid = packageState.getVolumeUuid(); if (Objects.equals(currentVolumeUuid, volumeUuid)) { throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR, "Package already moved to " + volumeUuid);