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

Commit fc08c2d0 authored by Ryan Prichard's avatar Ryan Prichard Committed by Gerrit Code Review
Browse files

Merge "[RESTRICT AUTOMERGE] Fix std::unique_ptr error with incomplete CommonFeatureGroup" into main

parents 90cd1955 c3e32935
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -116,9 +116,7 @@ class CommonFeatureGroup;

class ManifestExtractor {
 public:

  explicit ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options)
      : apk_(apk), options_(options) { }
  explicit ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options);

  class Element {
   public:
@@ -387,7 +385,7 @@ class ManifestExtractor {
  DumpManifestOptions& options_;

 private:
  std::unique_ptr<CommonFeatureGroup> commonFeatureGroup_ = util::make_unique<CommonFeatureGroup>();
  std::unique_ptr<CommonFeatureGroup> commonFeatureGroup_;
  std::map<std::string, ConfigDescription> locales_;
  std::map<uint16_t, ConfigDescription> densities_;
  std::vector<Element*> parent_stack_;
@@ -1970,6 +1968,12 @@ static void Print(ManifestExtractor::Element* el, text::Printer* printer) {
  }
}

// Define this constructor after the CommonFeatureGroup class definition to avoid errors with using
// std::unique_ptr on an incomplete type.
ManifestExtractor::ManifestExtractor(LoadedApk* apk, DumpManifestOptions& options)
    : apk_(apk), options_(options), commonFeatureGroup_(util::make_unique<CommonFeatureGroup>()) {
}

bool ManifestExtractor::Dump(text::Printer* printer, IDiagnostics* diag) {
  // Load the manifest
  std::unique_ptr<xml::XmlResource> doc = apk_->LoadXml("AndroidManifest.xml", diag);