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

Commit 9448724c authored by Patrick Baumann's avatar Patrick Baumann
Browse files

Use String.equals when comparing conflicting providers

Prior to this change, we were comparing the package name of the
conflicting component with the soon-to-be installed
PackageParser.Package package name using object equality, as used
elsewhere in packagemanager components. However, ComponentName.mPackage
does not use an interned string for performance reasons, so we need to
use .equals here.

Change-Id: Ibfed7cd47f18d06b2f65c6d8f6c46b752859375c
Fixes: 115956948
Bug: 109941548
Test: run pts -m PtsTimeZoneTestCases passes
parent c95add6d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1049,7 +1049,7 @@ public class ComponentResolver {
                                (other != null && other.getComponentName() != null)
                                        ? other.getComponentName().getPackageName() : "?";
                        // if we're installing over the same already-installed package, this is ok
                        if (otherPackageName != pkg.packageName) {
                        if (!otherPackageName.equals(pkg.packageName)) {
                            throw new PackageManagerException(
                                    INSTALL_FAILED_CONFLICTING_PROVIDER,
                                    "Can't install because provider name " + names[j]