Loading services/core/java/com/android/server/pm/PackageMetrics.java +19 −12 Original line number Original line Diff line number Diff line Loading @@ -310,6 +310,10 @@ final class PackageMetrics { if (!SecurityLog.isLoggingEnabled()) { if (!SecurityLog.isLoggingEnabled()) { return; return; } } // TODO: Remove temp try-catch to avoid IllegalStateException. The reason is because // the scan result is null for installExistingPackageAsUser(). Because it's installing // a package that's already existing, there's no scanning or parsing involved try { final PackageSetting ps = mInstallRequest.getScannedPackageSetting(); final PackageSetting ps = mInstallRequest.getScannedPackageSetting(); if (ps == null) { if (ps == null) { return; return; Loading @@ -323,6 +327,9 @@ final class PackageMetrics { SecurityLog.writeEvent(SecurityLog.TAG_PACKAGE_UPDATED, packageName, versionCode, SecurityLog.writeEvent(SecurityLog.TAG_PACKAGE_UPDATED, packageName, versionCode, userId); userId); } } } catch (IllegalStateException | NullPointerException e) { // no-op } } } private static void reportUninstallationToSecurityLog(String packageName, long versionCode, private static void reportUninstallationToSecurityLog(String packageName, long versionCode, Loading Loading
services/core/java/com/android/server/pm/PackageMetrics.java +19 −12 Original line number Original line Diff line number Diff line Loading @@ -310,6 +310,10 @@ final class PackageMetrics { if (!SecurityLog.isLoggingEnabled()) { if (!SecurityLog.isLoggingEnabled()) { return; return; } } // TODO: Remove temp try-catch to avoid IllegalStateException. The reason is because // the scan result is null for installExistingPackageAsUser(). Because it's installing // a package that's already existing, there's no scanning or parsing involved try { final PackageSetting ps = mInstallRequest.getScannedPackageSetting(); final PackageSetting ps = mInstallRequest.getScannedPackageSetting(); if (ps == null) { if (ps == null) { return; return; Loading @@ -323,6 +327,9 @@ final class PackageMetrics { SecurityLog.writeEvent(SecurityLog.TAG_PACKAGE_UPDATED, packageName, versionCode, SecurityLog.writeEvent(SecurityLog.TAG_PACKAGE_UPDATED, packageName, versionCode, userId); userId); } } } catch (IllegalStateException | NullPointerException e) { // no-op } } } private static void reportUninstallationToSecurityLog(String packageName, long versionCode, private static void reportUninstallationToSecurityLog(String packageName, long versionCode, Loading