diff options
| author | 2023-09-04 15:39:09 +0000 | |
|---|---|---|
| committer | 2023-09-04 15:39:09 +0000 | |
| commit | 178352cfeeba12a3b71b54708334a69d6281b5b4 (patch) | |
| tree | 9fc65eb893972d2aebd485d1f7a71920d1e28c13 | |
| parent | 0283bc86e7ed879a8aed5addaf4a344aea961649 (diff) | |
Catch NPE when reportInstallationStats
The scan result is null for installExistingPackageAsUser(), becuse
it is installing a package that already exists, there is no scanning
or parsing involved. We don't handle this case before and catch
the exception temporary, this change also catch the NPE here. There
is a follow up bug to handle it correctly.
Bug: 298693819
Test: ManagedProfileProvisioningCrossProfileAppsTest#
newlyProvisionedManagedProfile_requiredCrossProfileAppsArePresent
Change-Id: I07d5140785b700a0e9934a0150f709c234dfe0f7
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageMetrics.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/pm/PackageMetrics.java b/services/core/java/com/android/server/pm/PackageMetrics.java index c1580c4b1cb9..7ad336c9074d 100644 --- a/services/core/java/com/android/server/pm/PackageMetrics.java +++ b/services/core/java/com/android/server/pm/PackageMetrics.java @@ -120,7 +120,7 @@ final class PackageMetrics { versionCode = ps.getVersionCode(); apksSize = getApksSize(ps.getPath()); } - } catch (IllegalStateException e) { + } catch (IllegalStateException | NullPointerException e) { // no-op } } |