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

Commit e0ee6fe2 authored by Gavin Corkery's avatar Gavin Corkery
Browse files

Allow requested installer package name to be null

Since an installer package name may be null, switch to
TextUtils.equals to allow for this case and to stop
any NullPointerExceptions

Test: adb shell pm install --staged
      /system/app/CaptivePortalLogin/CaptivePortalLogin.apk works
Bug: 145575703

Change-Id: Ic30cc4610884657aaa8415dc96107c7cc3647ce9
parent b3913509
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
            }
            // Only apps with INSTALL_PACKAGES are allowed to set an installer that is not the
            // caller.
            if (!requestedInstallerPackageName.equals(installerPackageName)) {
            if (!TextUtils.equals(requestedInstallerPackageName, installerPackageName)) {
                if (mContext.checkCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGES)
                        != PackageManager.PERMISSION_GRANTED) {
                    mAppOps.checkPackage(callingUid, requestedInstallerPackageName);