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

Commit 5ce9d01f authored by lpeter's avatar lpeter
Browse files

Add different error message to distinguish why failing to get services extension package.

Bug: 287426479
Test: build pass and boot success
Test: manually test for config_servicesExtensionPackage is empty
Change-Id: Iaededa7c940b4c0155de7767951f8045360cbe10
parent 50498dc6
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -2493,13 +2493,22 @@ public class PackageManagerService implements PackageSender, TestUtilityService

    @NonNull
    private String getRequiredServicesExtensionPackageLPr(@NonNull Computer computer) {
        String servicesExtensionPackage =
                ensureSystemPackageName(computer,
                        mContext.getString(R.string.config_servicesExtensionPackage));
        String configServicesExtensionPackage = mContext.getString(
                R.string.config_servicesExtensionPackage);
        if (TextUtils.isEmpty(configServicesExtensionPackage)) {
            throw new RuntimeException(
                    "Required services extension package failed due to "
                            + "config_servicesExtensionPackage is empty.");
        }
        String servicesExtensionPackage = ensureSystemPackageName(computer,
                configServicesExtensionPackage);
        if (TextUtils.isEmpty(servicesExtensionPackage)) {
            throw new RuntimeException(
                    "Required services extension package is missing, check "
                            + "config_servicesExtensionPackage.");
                    "Required services extension package is missing, "
                            + "config_servicesExtensionPackage had defined with "
                            + configServicesExtensionPackage
                            + ", but can not find the package info on the system image, check if "
                            + "the package has a problem.");
        }
        return servicesExtensionPackage;
    }