Loading services/java/com/android/server/PackageManagerService.java +28 −22 Original line number Original line Diff line number Diff line Loading @@ -3648,12 +3648,11 @@ class PackageManagerService extends IPackageManager.Stub { installedNativeLibraries = true; installedNativeLibraries = true; // Always extract the shared library String sharedLibraryFilePath = sharedLibraryDir.getPath() + String sharedLibraryFilePath = sharedLibraryDir.getPath() + File.separator + libFileName; File.separator + libFileName; File sharedLibraryFile = new File(sharedLibraryFilePath); File sharedLibraryFile = new File(sharedLibraryFilePath); if (! sharedLibraryFile.exists() || sharedLibraryFile.length() != entry.getSize() || sharedLibraryFile.lastModified() != entry.getTime()) { if (Config.LOGD) { if (Config.LOGD) { Log.d(TAG, "Caching shared lib " + entry.getName()); Log.d(TAG, "Caching shared lib " + entry.getName()); } } Loading @@ -3663,7 +3662,6 @@ class PackageManagerService extends IPackageManager.Stub { cacheNativeBinaryLI(pkg, zipFile, entry, sharedLibraryDir, cacheNativeBinaryLI(pkg, zipFile, entry, sharedLibraryDir, sharedLibraryFile); sharedLibraryFile); } } } if (!hasNativeLibraries) if (!hasNativeLibraries) return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; Loading Loading @@ -3704,9 +3702,7 @@ class PackageManagerService extends IPackageManager.Stub { String installGdbServerPath = installGdbServerDir.getPath() + String installGdbServerPath = installGdbServerDir.getPath() + "/" + GDBSERVER; "/" + GDBSERVER; File installGdbServerFile = new File(installGdbServerPath); File installGdbServerFile = new File(installGdbServerPath); if (! installGdbServerFile.exists() || installGdbServerFile.length() != entry.getSize() || installGdbServerFile.lastModified() != entry.getTime()) { if (Config.LOGD) { if (Config.LOGD) { Log.d(TAG, "Caching gdbserver " + entry.getName()); Log.d(TAG, "Caching gdbserver " + entry.getName()); } } Loading @@ -3715,7 +3711,7 @@ class PackageManagerService extends IPackageManager.Stub { } } cacheNativeBinaryLI(pkg, zipFile, entry, installGdbServerDir, cacheNativeBinaryLI(pkg, zipFile, entry, installGdbServerDir, installGdbServerFile); installGdbServerFile); } return PACKAGE_INSTALL_NATIVE_FOUND_LIBRARIES; return PACKAGE_INSTALL_NATIVE_FOUND_LIBRARIES; } } return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; Loading @@ -3729,6 +3725,16 @@ class PackageManagerService extends IPackageManager.Stub { // one if ro.product.cpu.abi2 is defined. // one if ro.product.cpu.abi2 is defined. // // private int cachePackageSharedLibsLI(PackageParser.Package pkg, File scanFile) { private int cachePackageSharedLibsLI(PackageParser.Package pkg, File scanFile) { // Remove all native binaries from a directory. This is used when upgrading // a package: in case the new .apk doesn't contain a native binary that was // in the old one (and thus installed), we need to remove it from // /data/data/<appname>/lib // // The simplest way to do that is to remove all files in this directory, // since it is owned by "system", applications are not supposed to write // anything there. removeNativeBinariesLI(pkg); String cpuAbi = Build.CPU_ABI; String cpuAbi = Build.CPU_ABI; try { try { int result = cachePackageSharedLibsForAbiLI(pkg, scanFile, cpuAbi); int result = cachePackageSharedLibsForAbiLI(pkg, scanFile, cpuAbi); Loading Loading
services/java/com/android/server/PackageManagerService.java +28 −22 Original line number Original line Diff line number Diff line Loading @@ -3648,12 +3648,11 @@ class PackageManagerService extends IPackageManager.Stub { installedNativeLibraries = true; installedNativeLibraries = true; // Always extract the shared library String sharedLibraryFilePath = sharedLibraryDir.getPath() + String sharedLibraryFilePath = sharedLibraryDir.getPath() + File.separator + libFileName; File.separator + libFileName; File sharedLibraryFile = new File(sharedLibraryFilePath); File sharedLibraryFile = new File(sharedLibraryFilePath); if (! sharedLibraryFile.exists() || sharedLibraryFile.length() != entry.getSize() || sharedLibraryFile.lastModified() != entry.getTime()) { if (Config.LOGD) { if (Config.LOGD) { Log.d(TAG, "Caching shared lib " + entry.getName()); Log.d(TAG, "Caching shared lib " + entry.getName()); } } Loading @@ -3663,7 +3662,6 @@ class PackageManagerService extends IPackageManager.Stub { cacheNativeBinaryLI(pkg, zipFile, entry, sharedLibraryDir, cacheNativeBinaryLI(pkg, zipFile, entry, sharedLibraryDir, sharedLibraryFile); sharedLibraryFile); } } } if (!hasNativeLibraries) if (!hasNativeLibraries) return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; Loading Loading @@ -3704,9 +3702,7 @@ class PackageManagerService extends IPackageManager.Stub { String installGdbServerPath = installGdbServerDir.getPath() + String installGdbServerPath = installGdbServerDir.getPath() + "/" + GDBSERVER; "/" + GDBSERVER; File installGdbServerFile = new File(installGdbServerPath); File installGdbServerFile = new File(installGdbServerPath); if (! installGdbServerFile.exists() || installGdbServerFile.length() != entry.getSize() || installGdbServerFile.lastModified() != entry.getTime()) { if (Config.LOGD) { if (Config.LOGD) { Log.d(TAG, "Caching gdbserver " + entry.getName()); Log.d(TAG, "Caching gdbserver " + entry.getName()); } } Loading @@ -3715,7 +3711,7 @@ class PackageManagerService extends IPackageManager.Stub { } } cacheNativeBinaryLI(pkg, zipFile, entry, installGdbServerDir, cacheNativeBinaryLI(pkg, zipFile, entry, installGdbServerDir, installGdbServerFile); installGdbServerFile); } return PACKAGE_INSTALL_NATIVE_FOUND_LIBRARIES; return PACKAGE_INSTALL_NATIVE_FOUND_LIBRARIES; } } return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; return PACKAGE_INSTALL_NATIVE_NO_LIBRARIES; Loading @@ -3729,6 +3725,16 @@ class PackageManagerService extends IPackageManager.Stub { // one if ro.product.cpu.abi2 is defined. // one if ro.product.cpu.abi2 is defined. // // private int cachePackageSharedLibsLI(PackageParser.Package pkg, File scanFile) { private int cachePackageSharedLibsLI(PackageParser.Package pkg, File scanFile) { // Remove all native binaries from a directory. This is used when upgrading // a package: in case the new .apk doesn't contain a native binary that was // in the old one (and thus installed), we need to remove it from // /data/data/<appname>/lib // // The simplest way to do that is to remove all files in this directory, // since it is owned by "system", applications are not supposed to write // anything there. removeNativeBinariesLI(pkg); String cpuAbi = Build.CPU_ABI; String cpuAbi = Build.CPU_ABI; try { try { int result = cachePackageSharedLibsForAbiLI(pkg, scanFile, cpuAbi); int result = cachePackageSharedLibsForAbiLI(pkg, scanFile, cpuAbi); Loading