Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f019dbc7 authored by Taeksoo Kim's avatar Taeksoo Kim Committed by Todd Kennedy
Browse files

Add null check for package in setEnabledSetting

When calling setEnabledSetting, the target package might have been
uninstalled. This change checks whether the package is null or not.

Bug: 162753654
Test: compile & verify basic functions working
Change-Id: Ibc1816cd7b5b4577c0510a388880fbec964c200a
parent cc848e93
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21242,7 +21242,8 @@ public class PackageManagerService extends IPackageManager.Stub
            // Prior to enabling the package, we need to decompress the APK(s) to the
            // data partition and then replace the version on the system partition.
            final AndroidPackage deletedPkg = pkgSetting.pkg;
            final boolean isSystemStub = deletedPkg.isStub()
            final boolean isSystemStub = (deletedPkg != null)
                    && deletedPkg.isStub()
                    && deletedPkg.isSystem();
            if (isSystemStub
                    && (newState == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT