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

Commit 625ebd39 authored by Ryan Mitchell's avatar Ryan Mitchell
Browse files

Call verify in create-multiple

Idmap Scan previously called Verify before calling Create. OverlayConfig
should do the same. Removing the verify call caused b/149784008.

Since sSystem is marked @UnsupportedAppUsage,
createSystemAssetsInZygoteLocked could potentially be invoked in the
system server. Rather than attempting to create the overlays a second
time, first check whether the idmap must be invalidated.

Bug: 149784008
Test: running forrest using web UI
Change-Id: I5d995a87e8552bd156fb5415b2c46a08f4c1d6c5
parent 3df3b53b
Loading
Loading
Loading
Loading
+29 −26
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "idmap2/Idmap.h"
#include "idmap2/Policies.h"
#include "idmap2/SysTrace.h"
#include "Commands.h"

using android::ApkAssets;
using android::base::StringPrintf;
@@ -105,6 +106,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) {
      continue;
    }

    if (!Verify(std::vector<std::string>({"--idmap-path", idmap_path}))) {
      const std::unique_ptr<const ApkAssets> overlay_apk = ApkAssets::Load(overlay_apk_path);
      if (!overlay_apk) {
        LOG(WARNING) << "failed to load apk " << overlay_apk_path.c_str();
@@ -132,6 +134,7 @@ Result<Unit> CreateMultiple(const std::vector<std::string>& args) {
        LOG(WARNING) << "failed to write to idmap path %s" << idmap_path.c_str();
        continue;
      }
    }

    idmap_paths.emplace_back(idmap_path);
  }