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

Commit 9ed56381 authored by Ryan Mitchell's avatar Ryan Mitchell Committed by Liz Kammer
Browse files

Do not rename R.java package

When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

(This is a cherry pick.)

Bug: 147434671
Test: manual
Merged-In: Id9d10e16f32533da1b67ab72ac846791526e7a76
Change-Id: Id9d10e16f32533da1b67ab72ac846791526e7a76
parent 8adff722
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1669,6 +1669,16 @@ class Linker {
      context_->SetCompilationPackage(app_info.package);
    }

    // Determine the package name under which to merge resources.
    if (options_.rename_resources_package) {
      if (!options_.custom_java_package) {
        // Generate the R.java under the original package name instead of the package name specified
        // through --rename-resources-package.
        options_.custom_java_package = context_->GetCompilationPackage();
      }
      context_->SetCompilationPackage(options_.rename_resources_package.value());
    }

    // Now that the compilation package is set, load the dependencies. This will also extract
    // the Android framework's versionCode and versionName, if they exist.
    if (!LoadSymbolsFromIncludePaths()) {