Loading core/java/android/content/pm/PackageParser.java +25 −21 Original line number Diff line number Diff line Loading @@ -1120,12 +1120,12 @@ public class PackageParser { final String cacheKey = getCacheKey(packageFile, flags); final File cacheFile = new File(mCacheDir, cacheKey); try { // If the cache is not up to date, return null. if (!isCacheUpToDate(packageFile, cacheFile)) { return null; } try { final byte[] bytes = IoUtils.readFileAsByteArray(cacheFile.getAbsolutePath()); Package p = fromCacheEntry(bytes); if (mCallback != null) { Loading @@ -1140,7 +1140,7 @@ public class PackageParser { } } return p; } catch (Exception e) { } catch (Throwable e) { Slog.w(TAG, "Error reading package cache: ", e); // If something went wrong while reading the cache entry, delete the cache file Loading @@ -1158,6 +1158,7 @@ public class PackageParser { return; } try { final String cacheKey = getCacheKey(packageFile, flags); final File cacheFile = new File(mCacheDir, cacheKey); Loading @@ -1179,6 +1180,9 @@ public class PackageParser { Slog.w(TAG, "Error writing cache entry.", ioe); cacheFile.delete(); } } catch (Throwable e) { Slog.w(TAG, "Error saving package cache.", e); } } /** Loading Loading
core/java/android/content/pm/PackageParser.java +25 −21 Original line number Diff line number Diff line Loading @@ -1120,12 +1120,12 @@ public class PackageParser { final String cacheKey = getCacheKey(packageFile, flags); final File cacheFile = new File(mCacheDir, cacheKey); try { // If the cache is not up to date, return null. if (!isCacheUpToDate(packageFile, cacheFile)) { return null; } try { final byte[] bytes = IoUtils.readFileAsByteArray(cacheFile.getAbsolutePath()); Package p = fromCacheEntry(bytes); if (mCallback != null) { Loading @@ -1140,7 +1140,7 @@ public class PackageParser { } } return p; } catch (Exception e) { } catch (Throwable e) { Slog.w(TAG, "Error reading package cache: ", e); // If something went wrong while reading the cache entry, delete the cache file Loading @@ -1158,6 +1158,7 @@ public class PackageParser { return; } try { final String cacheKey = getCacheKey(packageFile, flags); final File cacheFile = new File(mCacheDir, cacheKey); Loading @@ -1179,6 +1180,9 @@ public class PackageParser { Slog.w(TAG, "Error writing cache entry.", ioe); cacheFile.delete(); } } catch (Throwable e) { Slog.w(TAG, "Error saving package cache.", e); } } /** Loading