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

Commit 4ce46793 authored by Dario Freni's avatar Dario Freni
Browse files

androidfw changes to support /product-services.

See CL I7a6a30bf8e8db9f2738594d187bb9148f138b8da for a more detailed
description of the change.

Test: see CL I7a6a30bf8e8db9f2738594d187bb9148f138b8da description
Bug: 80741439
Change-Id: I6cc9d713c07c319fc2ee1c531af41243bd1d4aee
parent 80457464
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -179,6 +179,10 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) {
        argv[argc++] = AssetManager::PRODUCT_OVERLAY_DIR;
      }

      if (stat(AssetManager::PRODUCT_SERVICES_OVERLAY_DIR, &st) == 0) {
        argv[argc++] = AssetManager::PRODUCT_SERVICES_OVERLAY_DIR;
      }

      // Finally, invoke idmap (if any overlay directory exists)
      if (argc > 5) {
        execv(AssetManager::IDMAP_BIN, (char* const*)argv);
+5 −1
Original line number Diff line number Diff line
@@ -87,13 +87,17 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
  static const char* kOverlaySubdir = "/system/vendor/overlay-subdir/";
  static const char* kSystemProductOverlayDir = "/system/product/overlay/";
  static const char* kProductOverlayDir = "/product/overlay";
  static const char* kSystemProductServicesOverlayDir = "/system/product_services/overlay/";
  static const char* kProductServicesOverlayDir = "/product_services/overlay";
  static const char* kApkSuffix = ".apk";

  if ((android::base::StartsWith(path, kOverlayDir)
       || android::base::StartsWith(path, kOverlaySubdir)
       || android::base::StartsWith(path, kVendorOverlayDir)
       || android::base::StartsWith(path, kSystemProductOverlayDir)
       || android::base::StartsWith(path, kProductOverlayDir))
       || android::base::StartsWith(path, kProductOverlayDir)
       || android::base::StartsWith(path, kSystemProductServicesOverlayDir)
       || android::base::StartsWith(path, kProductServicesOverlayDir))
      && android::base::EndsWith(path, kApkSuffix)
      && path.find("/../") == std::string::npos) {
    return true;
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ const char* AssetManager::RESOURCES_FILENAME = "resources.arsc";
const char* AssetManager::IDMAP_BIN = "/system/bin/idmap";
const char* AssetManager::OVERLAY_DIR = "/vendor/overlay";
const char* AssetManager::PRODUCT_OVERLAY_DIR = "/product/overlay";
const char* AssetManager::PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay";
const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme";
const char* AssetManager::TARGET_PACKAGE_NAME = "android";
const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk";
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public:
    static const char* IDMAP_BIN;
    static const char* OVERLAY_DIR;
    static const char* PRODUCT_OVERLAY_DIR;
    static const char* PRODUCT_SERVICES_OVERLAY_DIR;
    /*
     * If OVERLAY_THEME_DIR_PROPERTY is set, search for runtime resource overlay
     * APKs in OVERLAY_DIR/<value of OVERLAY_THEME_DIR_PROPERTY> in addition to