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

Commit 2ce84341 authored by Dario Freni's avatar Dario Freni
Browse files

Use updatable sysprop to for enabling APEX mgmt

This should prevent unnecessary communication with apexd on devices that
don't support APEX package management.

Bug: 130623080
Test: CTS tests on marlin (no APEX support) and cuttlefish
Change-Id: Ic5fdb088aa1530b3c5aecbd5abd3d794a364c775
parent 87dbdeab
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -687,6 +687,7 @@ java_defaults {
        "core/java/com/android/server/DropboxLogTags.logtags",
        "core/java/org/chromium/arc/EventLogTags.logtags",

        ":apex-properties",
        ":platform-properties",

        ":framework-statslog-gen",
+2 −5
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.content.pm.PackageParser.PackageParserException;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.sysprop.ApexProperties;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;
@@ -237,11 +238,7 @@ class ApexManager {
     * @return true if APEX packages can be managed on this device, false otherwise.
     */
    boolean isApexSupported() {
        populateActivePackagesCacheIfNeeded();
        // There is no system-wide property available to check if APEX are flattened and hence can't
        // be updated. In absence of such property, we assume that if we didn't index APEX packages
        // since they were flattened, no APEX management should be possible.
        return !mActivePackagesCache.isEmpty();
        return ApexProperties.updatable().orElse(false);
    }

    /**