diff options
| author | 2022-12-30 23:07:49 +0000 | |
|---|---|---|
| committer | 2023-01-19 20:16:58 +0000 | |
| commit | d1904e4b9c133f20efd6028d0fce73ea41614ea8 (patch) | |
| tree | 339c94986d03bd61b4e6795b60ee58a3f763184b | |
| parent | 6964ec7ba27cdb4ef3cfed7a4327503f5f48dd81 (diff) | |
Creat hardlink if active apexes are in the same partition
Before the code compare the dev of the source, and target file.
However, since the target file hasn't been created at this time, the
code will always copy the source file instead of hard linkking.
Test: sideload train, and check whether the apex in rollback folder is a
hardlink. Run presubmit
Bug: 168562373
Change-Id: I6e5c6e0d35e4fa44d41d3d2d6fc564e5213e0092
| -rw-r--r-- | services/core/java/com/android/server/rollback/RollbackStore.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/rollback/RollbackStore.java b/services/core/java/com/android/server/rollback/RollbackStore.java index f973f5ce9ce0..8068c6f46733 100644 --- a/services/core/java/com/android/server/rollback/RollbackStore.java +++ b/services/core/java/com/android/server/rollback/RollbackStore.java @@ -249,7 +249,7 @@ class RollbackStore { targetDir.mkdirs(); File targetFile = new File(targetDir, sourceFile.getName()); - boolean fallbackToCopy = !isLinkPossible(sourceFile, targetFile); + boolean fallbackToCopy = !isLinkPossible(sourceFile, targetDir); if (!fallbackToCopy) { try { // Create a hard link to avoid copy |