Loading services/core/java/com/android/server/pm/PackageDexOptimizer.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -328,10 +328,11 @@ class PackageDexOptimizer { for (String apkPath : pkg.getAllCodePathsExcludingResourceOnly()) { for (String apkPath : pkg.getAllCodePathsExcludingResourceOnly()) { try { try { apkPath = new File(apkPath).getCanonicalPath(); apkPath = PackageManagerServiceUtils.realpath(new File(apkPath)); } catch (IOException e) { } catch (IOException e) { // Log an error but continue without it. // Log an error but continue without it. Slog.w(TAG, "Failed to get canonical path", e); Slog.w(TAG, "Failed to get canonical path", e); continue; } } String useMarker = apkPath.replace('/', '@'); String useMarker = apkPath.replace('/', '@'); final int[] currentUserIds = UserManagerService.getInstance().getUserIds(); final int[] currentUserIds = UserManagerService.getInstance().getUserIds(); Loading services/core/java/com/android/server/pm/PackageManagerService.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -7604,10 +7604,11 @@ public class PackageManagerService extends IPackageManager.Stub { for (String path : pkg.getAllCodePathsExcludingResourceOnly()) { for (String path : pkg.getAllCodePathsExcludingResourceOnly()) { try { try { path = new File(path).getCanonicalPath(); path = PackageManagerServiceUtils.realpath(new File(path)); } catch (IOException e) { } catch (IOException e) { // TODO: Should we return early here ? // TODO: Should we return early here ? Slog.w(TAG, "Failed to get canonical path", e); Slog.w(TAG, "Failed to get canonical path", e); continue; } } final String useMarker = path.replace('/', '@'); final String useMarker = path.replace('/', '@'); Loading services/core/java/com/android/server/pm/PackageManagerServiceUtils.java +17 −1 Original line number Original line Diff line number Diff line Loading @@ -25,9 +25,13 @@ import android.content.pm.PackageParser; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.os.RemoteException; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserHandle; import android.system.ErrnoException; import android.util.ArraySet; import android.util.ArraySet; import android.util.Log; import android.util.Log; import libcore.io.Libcore; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.ArrayList; import java.util.Collection; import java.util.Collection; import java.util.Date; import java.util.Date; Loading Loading @@ -163,4 +167,16 @@ public class PackageManagerServiceUtils { return result; return result; } } /** * Returns the canonicalized path of {@code path} as per {@code realpath(3)} * semantics. */ public static String realpath(File path) throws IOException { try { return Libcore.os.realpath(path.getAbsolutePath()); } catch (ErrnoException ee) { throw ee.rethrowAsIOException(); } } } } Loading
services/core/java/com/android/server/pm/PackageDexOptimizer.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -328,10 +328,11 @@ class PackageDexOptimizer { for (String apkPath : pkg.getAllCodePathsExcludingResourceOnly()) { for (String apkPath : pkg.getAllCodePathsExcludingResourceOnly()) { try { try { apkPath = new File(apkPath).getCanonicalPath(); apkPath = PackageManagerServiceUtils.realpath(new File(apkPath)); } catch (IOException e) { } catch (IOException e) { // Log an error but continue without it. // Log an error but continue without it. Slog.w(TAG, "Failed to get canonical path", e); Slog.w(TAG, "Failed to get canonical path", e); continue; } } String useMarker = apkPath.replace('/', '@'); String useMarker = apkPath.replace('/', '@'); final int[] currentUserIds = UserManagerService.getInstance().getUserIds(); final int[] currentUserIds = UserManagerService.getInstance().getUserIds(); Loading
services/core/java/com/android/server/pm/PackageManagerService.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -7604,10 +7604,11 @@ public class PackageManagerService extends IPackageManager.Stub { for (String path : pkg.getAllCodePathsExcludingResourceOnly()) { for (String path : pkg.getAllCodePathsExcludingResourceOnly()) { try { try { path = new File(path).getCanonicalPath(); path = PackageManagerServiceUtils.realpath(new File(path)); } catch (IOException e) { } catch (IOException e) { // TODO: Should we return early here ? // TODO: Should we return early here ? Slog.w(TAG, "Failed to get canonical path", e); Slog.w(TAG, "Failed to get canonical path", e); continue; } } final String useMarker = path.replace('/', '@'); final String useMarker = path.replace('/', '@'); Loading
services/core/java/com/android/server/pm/PackageManagerServiceUtils.java +17 −1 Original line number Original line Diff line number Diff line Loading @@ -25,9 +25,13 @@ import android.content.pm.PackageParser; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.os.RemoteException; import android.os.RemoteException; import android.os.UserHandle; import android.os.UserHandle; import android.system.ErrnoException; import android.util.ArraySet; import android.util.ArraySet; import android.util.Log; import android.util.Log; import libcore.io.Libcore; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.ArrayList; import java.util.Collection; import java.util.Collection; import java.util.Date; import java.util.Date; Loading Loading @@ -163,4 +167,16 @@ public class PackageManagerServiceUtils { return result; return result; } } /** * Returns the canonicalized path of {@code path} as per {@code realpath(3)} * semantics. */ public static String realpath(File path) throws IOException { try { return Libcore.os.realpath(path.getAbsolutePath()); } catch (ErrnoException ee) { throw ee.rethrowAsIOException(); } } } }