diff --git a/cmds/idmap2/Android.bp b/cmds/idmap2/Android.bp index 803f83c0bc6f0..056add5c71b57 100644 --- a/cmds/idmap2/Android.bp +++ b/cmds/idmap2/Android.bp @@ -16,11 +16,11 @@ cc_defaults { name: "idmap2_defaults", tidy: true, tidy_checks: [ + "modernize-*", + "-modernize-avoid-c-arrays", "android-*", "misc-*", - "modernize-*", "readability-*", - "-modernize-avoid-c-arrays", ], tidy_flags: [ "-system-headers", diff --git a/cmds/idmap2/libidmap2/Idmap.cpp b/cmds/idmap2/libidmap2/Idmap.cpp index 5d449e96663e1..fa5ac8ea11dcb 100644 --- a/cmds/idmap2/libidmap2/Idmap.cpp +++ b/cmds/idmap2/libidmap2/Idmap.cpp @@ -281,10 +281,10 @@ bool CheckOverlayable(const LoadedPackage& target_package, if (overlayable_info == nullptr) { // If the resource does not have an overlayable definition, allow the resource to be overlaid. // Once overlayable enforcement is turned on, this check will return false. - return true; + return !target_package.DefinesOverlayable(); } - if (!overlay_info.target_name.empty() && overlay_info.target_name != overlayable_info->name) { + if (overlay_info.target_name != overlayable_info->name) { // If the overlay supplies a target overlayable name, the resource must belong to the // overlayable defined with the specified name to be overlaid. return false; diff --git a/cmds/idmap2/tests/FileUtilsTests.cpp b/cmds/idmap2/tests/FileUtilsTests.cpp index 45f84fe341ccf..8514e12e8c171 100644 --- a/cmds/idmap2/tests/FileUtilsTests.cpp +++ b/cmds/idmap2/tests/FileUtilsTests.cpp @@ -40,9 +40,14 @@ TEST(FileUtilsTests, FindFilesFindEverythingNonRecursive) { const std::string& path ATTRIBUTE_UNUSED) -> bool { return true; }); ASSERT_THAT(v, NotNull()); ASSERT_EQ(v->size(), 6U); - ASSERT_EQ(std::set(v->begin(), v->end()), - std::set({root + "/.", root + "/..", root + "/overlay", root + "/target", - root + "/system-overlay", root + "/system-overlay-invalid"})); + ASSERT_EQ(std::set(v->begin(), v->end()), std::set({ + root + "/.", + root + "/..", + root + "/overlay", + root + "/target", + root + "/system-overlay", + root + "/system-overlay-invalid", + })); } TEST(FileUtilsTests, FindFilesFindApkFilesRecursive) { @@ -51,13 +56,15 @@ TEST(FileUtilsTests, FindFilesFindApkFilesRecursive) { return type == DT_REG && path.size() > 4 && path.compare(path.size() - 4, 4, ".apk") == 0; }); ASSERT_THAT(v, NotNull()); - ASSERT_EQ(v->size(), 6U); - ASSERT_EQ(std::set(v->begin(), v->end()), - std::set({root + "/target/target.apk", root + "/overlay/overlay.apk", - root + "/overlay/overlay-static-1.apk", - root + "/overlay/overlay-static-2.apk", - root + "/system-overlay/system-overlay.apk", - root + "/system-overlay-invalid/system-overlay-invalid.apk"})); + ASSERT_EQ(v->size(), 9U); + ASSERT_EQ( + std::set(v->begin(), v->end()), + std::set( + {root + "/target/target.apk", root + "/target/target-no-overlayable.apk", + root + "/overlay/overlay.apk", root + "/overlay/overlay-no-name.apk", + root + "/overlay/overlay-no-name-static.apk", root + "/overlay/overlay-static-1.apk", + root + "/overlay/overlay-static-2.apk", root + "/system-overlay/system-overlay.apk", + root + "/system-overlay-invalid/system-overlay-invalid.apk"})); } TEST(FileUtilsTests, ReadFile) { diff --git a/cmds/idmap2/tests/Idmap2BinaryTests.cpp b/cmds/idmap2/tests/Idmap2BinaryTests.cpp index c550eafe5ffe3..1216f9ec736a1 100644 --- a/cmds/idmap2/tests/Idmap2BinaryTests.cpp +++ b/cmds/idmap2/tests/Idmap2BinaryTests.cpp @@ -163,8 +163,12 @@ TEST_F(Idmap2BinaryTests, Dump) { TEST_F(Idmap2BinaryTests, Scan) { SKIP_TEST_IF_CANT_EXEC_IDMAP2; + const std::string overlay_static_no_name_apk_path = + GetTestDataPath() + "/overlay/overlay-no-name-static.apk"; const std::string overlay_static_1_apk_path = GetTestDataPath() + "/overlay/overlay-static-1.apk"; const std::string overlay_static_2_apk_path = GetTestDataPath() + "/overlay/overlay-static-2.apk"; + const std::string idmap_static_no_name_path = + Idmap::CanonicalIdmapPathFor(GetTempDirPath(), overlay_static_no_name_apk_path); const std::string idmap_static_1_path = Idmap::CanonicalIdmapPathFor(GetTempDirPath(), overlay_static_1_apk_path); const std::string idmap_static_2_path = @@ -184,11 +188,18 @@ TEST_F(Idmap2BinaryTests, Scan) { ASSERT_THAT(result, NotNull()); ASSERT_EQ(result->status, EXIT_SUCCESS) << result->stderr; std::stringstream expected; + expected << idmap_static_no_name_path << std::endl; expected << idmap_static_1_path << std::endl; expected << idmap_static_2_path << std::endl; ASSERT_EQ(result->stdout, expected.str()); std::stringstream error; + auto idmap_static_no_name_raw_string = utils::ReadFile(idmap_static_no_name_path); + auto idmap_static_no_name_raw_stream = std::istringstream(*idmap_static_no_name_raw_string); + auto idmap_static_no_name = Idmap::FromBinaryStream(idmap_static_no_name_raw_stream, error); + ASSERT_THAT(idmap_static_no_name, NotNull()); + ASSERT_IDMAP(*idmap_static_no_name, GetTargetApkPath(), overlay_static_no_name_apk_path); + auto idmap_static_1_raw_string = utils::ReadFile(idmap_static_1_path); auto idmap_static_1_raw_stream = std::istringstream(*idmap_static_1_raw_string); auto idmap_static_1 = Idmap::FromBinaryStream(idmap_static_1_raw_stream, error); @@ -201,6 +212,7 @@ TEST_F(Idmap2BinaryTests, Scan) { ASSERT_THAT(idmap_static_2, NotNull()); ASSERT_IDMAP(*idmap_static_2, GetTargetApkPath(), overlay_static_2_apk_path); + unlink(idmap_static_no_name_path.c_str()); unlink(idmap_static_2_path.c_str()); unlink(idmap_static_1_path.c_str()); @@ -218,6 +230,7 @@ TEST_F(Idmap2BinaryTests, Scan) { ASSERT_THAT(result, NotNull()); ASSERT_EQ(result->status, EXIT_SUCCESS) << result->stderr; ASSERT_EQ(result->stdout, expected.str()); + unlink(idmap_static_no_name_path.c_str()); unlink(idmap_static_2_path.c_str()); unlink(idmap_static_1_path.c_str()); @@ -236,6 +249,7 @@ TEST_F(Idmap2BinaryTests, Scan) { ASSERT_THAT(result, NotNull()); ASSERT_EQ(result->status, EXIT_SUCCESS) << result->stderr; ASSERT_EQ(result->stdout, expected.str()); + unlink(idmap_static_no_name_path.c_str()); unlink(idmap_static_2_path.c_str()); unlink(idmap_static_1_path.c_str()); diff --git a/cmds/idmap2/tests/IdmapTests.cpp b/cmds/idmap2/tests/IdmapTests.cpp index df28918ac9b4f..9e27ccd7cfbb2 100644 --- a/cmds/idmap2/tests/IdmapTests.cpp +++ b/cmds/idmap2/tests/IdmapTests.cpp @@ -224,7 +224,8 @@ TEST(IdmapTests, CreateIdmapFromApkAssets) { ASSERT_EQ(types[1]->GetEntry(3), 0x0002U); } -TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublic) { +// Overlays should abide by all overlayable restrictions if enforcement of overlayable is enabled. +TEST(IdmapOverlayableTests, CreateIdmapFromApkAssetsPolicySystemPublic) { const std::string target_apk_path(GetTestDataPath() + "/target/target.apk"); std::unique_ptr target_apk = ApkAssets::Load(target_apk_path); ASSERT_THAT(target_apk, NotNull()); @@ -260,7 +261,8 @@ TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublic) { ASSERT_EQ(types[0]->GetEntry(2), 0x0002U); // string/policy_system_vendor } -TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalid) { +// Overlays should abide by all overlayable restrictions if enforcement of overlayable is enabled. +TEST(IdmapOverlayableTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalid) { const std::string target_apk_path(GetTestDataPath() + "/target/target.apk"); std::unique_ptr target_apk = ApkAssets::Load(target_apk_path); ASSERT_THAT(target_apk, NotNull()); @@ -290,17 +292,15 @@ TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalid) { ASSERT_EQ(types[0]->GetTargetTypeId(), 0x02U); ASSERT_EQ(types[0]->GetOverlayTypeId(), 0x01U); - ASSERT_EQ(types[0]->GetEntryCount(), 6U); - ASSERT_EQ(types[0]->GetEntryOffset(), 3U); - ASSERT_EQ(types[0]->GetEntry(0), 0x0000U); // string/not_overlayable - ASSERT_EQ(types[0]->GetEntry(1), kNoEntry); // string/other - ASSERT_EQ(types[0]->GetEntry(2), kNoEntry); // string/policy_product - ASSERT_EQ(types[0]->GetEntry(3), 0x0003U); // string/policy_public - ASSERT_EQ(types[0]->GetEntry(4), 0x0004U); // string/policy_system - ASSERT_EQ(types[0]->GetEntry(5), 0x0005U); // string/policy_system_vendor + ASSERT_EQ(types[0]->GetEntryCount(), 3U); + ASSERT_EQ(types[0]->GetEntryOffset(), 6U); + ASSERT_EQ(types[0]->GetEntry(0), 0x0003U); // string/policy_public + ASSERT_EQ(types[0]->GetEntry(1), 0x0004U); // string/policy_system + ASSERT_EQ(types[0]->GetEntry(2), 0x0005U); // string/policy_system_vendor } -TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalidIgnoreOverlayable) { +// Overlays should ignore all overlayable restrictions if enforcement of overlayable is disabled. +TEST(IdmapOverlayableTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalidIgnoreOverlayable) { const std::string target_apk_path(GetTestDataPath() + "/target/target.apk"); std::unique_ptr target_apk = ApkAssets::Load(target_apk_path); ASSERT_THAT(target_apk, NotNull()); @@ -340,6 +340,91 @@ TEST(IdmapTests, CreateIdmapFromApkAssetsPolicySystemPublicInvalidIgnoreOverlaya ASSERT_EQ(types[0]->GetEntry(5), 0x0005U); // string/policy_system_vendor } +// The resources of APKs that do not include an overlayable declaration should not restrict what +// resources can be overlaid. +TEST(IdmapOverlayableTests, CreateIdmapFromApkAssetsNoDefinedOverlayable) { + const std::string target_apk_path(GetTestDataPath() + "/target/target-no-overlayable.apk"); + std::unique_ptr target_apk = ApkAssets::Load(target_apk_path); + ASSERT_THAT(target_apk, NotNull()); + + const std::string overlay_apk_path(GetTestDataPath() + + "/system-overlay-invalid/system-overlay-invalid.apk"); + std::unique_ptr overlay_apk = ApkAssets::Load(overlay_apk_path); + ASSERT_THAT(overlay_apk, NotNull()); + + std::stringstream error; + std::unique_ptr idmap = + Idmap::FromApkAssets(target_apk_path, *target_apk, overlay_apk_path, *overlay_apk, + PolicyFlags::POLICY_PUBLIC, /* enforce_overlayable */ true, error); + ASSERT_THAT(idmap, NotNull()); + + const std::vector>& dataBlocks = idmap->GetData(); + ASSERT_EQ(dataBlocks.size(), 1U); + + const std::unique_ptr& data = dataBlocks[0]; + + ASSERT_EQ(data->GetHeader()->GetTargetPackageId(), 0x7fU); + ASSERT_EQ(data->GetHeader()->GetTypeCount(), 1U); + + const std::vector>& types = data->GetTypeEntries(); + ASSERT_EQ(types.size(), 1U); + + ASSERT_EQ(types[0]->GetTargetTypeId(), 0x02U); + ASSERT_EQ(types[0]->GetOverlayTypeId(), 0x01U); + ASSERT_EQ(types[0]->GetEntryCount(), 6U); + ASSERT_EQ(types[0]->GetEntryOffset(), 3U); + ASSERT_EQ(types[0]->GetEntry(0), 0x0000U); // string/not_overlayable + ASSERT_EQ(types[0]->GetEntry(1), 0x0001U); // string/other + ASSERT_EQ(types[0]->GetEntry(2), 0x0002U); // string/policy_product + ASSERT_EQ(types[0]->GetEntry(3), 0x0003U); // string/policy_public + ASSERT_EQ(types[0]->GetEntry(4), 0x0004U); // string/policy_system + ASSERT_EQ(types[0]->GetEntry(5), 0x0005U); // string/policy_system_vendor +} + +// The resources of APKs that do not include an overlayable declaration should not restrict what +// resources can be overlaid. +TEST(IdmapOverlayableTests, CreateIdmapFromApkAssetsNoDefinedOverlayableAndNoTargetName) { + const std::string target_apk_path(GetTestDataPath() + "/target/target-no-overlayable.apk"); + std::unique_ptr target_apk = ApkAssets::Load(target_apk_path); + ASSERT_THAT(target_apk, NotNull()); + + const std::string overlay_apk_path(GetTestDataPath() + "/overlay/overlay-no-name.apk"); + std::unique_ptr overlay_apk = ApkAssets::Load(overlay_apk_path); + ASSERT_THAT(overlay_apk, NotNull()); + + std::stringstream error; + std::unique_ptr idmap = + Idmap::FromApkAssets(target_apk_path, *target_apk, overlay_apk_path, *overlay_apk, + PolicyFlags::POLICY_PUBLIC, /* enforce_overlayable */ true, error); + ASSERT_THAT(idmap, NotNull()); + + const std::vector>& dataBlocks = idmap->GetData(); + ASSERT_EQ(dataBlocks.size(), 1U); + + const std::unique_ptr& data = dataBlocks[0]; + + ASSERT_EQ(data->GetHeader()->GetTargetPackageId(), 0x7fU); + ASSERT_EQ(data->GetHeader()->GetTypeCount(), 2U); + + const std::vector>& types = data->GetTypeEntries(); + ASSERT_EQ(types.size(), 2U); + + ASSERT_EQ(types[0]->GetTargetTypeId(), 0x01U); + ASSERT_EQ(types[0]->GetOverlayTypeId(), 0x01U); + ASSERT_EQ(types[0]->GetEntryCount(), 1U); + ASSERT_EQ(types[0]->GetEntryOffset(), 0U); + ASSERT_EQ(types[0]->GetEntry(0), 0x0000U); + + ASSERT_EQ(types[1]->GetTargetTypeId(), 0x02U); + ASSERT_EQ(types[1]->GetOverlayTypeId(), 0x02U); + ASSERT_EQ(types[1]->GetEntryCount(), 4U); + ASSERT_EQ(types[1]->GetEntryOffset(), 9U); + ASSERT_EQ(types[1]->GetEntry(0), 0x0000U); + ASSERT_EQ(types[1]->GetEntry(1), kNoEntry); + ASSERT_EQ(types[1]->GetEntry(2), 0x0001U); + ASSERT_EQ(types[1]->GetEntry(3), 0x0002U); +} + TEST(IdmapTests, FailToCreateIdmapFromApkAssetsIfPathTooLong) { std::string target_apk_path(GetTestDataPath()); for (int i = 0; i < 32; i++) { diff --git a/cmds/idmap2/tests/data/overlay/AndroidManifest.xml b/cmds/idmap2/tests/data/overlay/AndroidManifest.xml index 9f89d3121a828..a7767a6d35e6c 100644 --- a/cmds/idmap2/tests/data/overlay/AndroidManifest.xml +++ b/cmds/idmap2/tests/data/overlay/AndroidManifest.xml @@ -17,5 +17,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" package="test.overlay"> + android:targetPackage="test.target" + android:targetName="TestResources"/> diff --git a/cmds/idmap2/tests/data/overlay/AndroidManifestNoName.xml b/cmds/idmap2/tests/data/overlay/AndroidManifestNoName.xml new file mode 100644 index 0000000000000..bc6b733e849fa --- /dev/null +++ b/cmds/idmap2/tests/data/overlay/AndroidManifestNoName.xml @@ -0,0 +1,21 @@ + + + + + diff --git a/cmds/idmap2/tests/data/overlay/AndroidManifestNoNameStatic.xml b/cmds/idmap2/tests/data/overlay/AndroidManifestNoNameStatic.xml new file mode 100644 index 0000000000000..ed327ce0e630f --- /dev/null +++ b/cmds/idmap2/tests/data/overlay/AndroidManifestNoNameStatic.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/cmds/idmap2/tests/data/overlay/AndroidManifestStatic1.xml b/cmds/idmap2/tests/data/overlay/AndroidManifestStatic1.xml index 39336cc7e76b3..1c4dae6cf69c7 100644 --- a/cmds/idmap2/tests/data/overlay/AndroidManifestStatic1.xml +++ b/cmds/idmap2/tests/data/overlay/AndroidManifestStatic1.xml @@ -18,6 +18,7 @@ package="test.overlay.static1"> diff --git a/cmds/idmap2/tests/data/overlay/AndroidManifestStatic2.xml b/cmds/idmap2/tests/data/overlay/AndroidManifestStatic2.xml index e1cc1758d8cc9..70efc86036708 100644 --- a/cmds/idmap2/tests/data/overlay/AndroidManifestStatic2.xml +++ b/cmds/idmap2/tests/data/overlay/AndroidManifestStatic2.xml @@ -18,6 +18,7 @@ package="test.overlay.static2"> diff --git a/cmds/idmap2/tests/data/overlay/build b/cmds/idmap2/tests/data/overlay/build index cba108674005b..e60da803388bc 100644 --- a/cmds/idmap2/tests/data/overlay/build +++ b/cmds/idmap2/tests/data/overlay/build @@ -23,6 +23,20 @@ aapt2 link \ -o overlay.apk \ compiled.flata +aapt2 link \ + --no-resource-removal \ + -I "$FRAMEWORK_RES_APK" \ + --manifest AndroidManifestNoName.xml \ + -o overlay-no-name.apk \ + compiled.flata + +aapt2 link \ + --no-resource-removal \ + -I "$FRAMEWORK_RES_APK" \ + --manifest AndroidManifestNoNameStatic.xml \ + -o overlay-no-name-static.apk \ + compiled.flata + aapt2 link \ --no-resource-removal \ -I "$FRAMEWORK_RES_APK" \ diff --git a/cmds/idmap2/tests/data/overlay/overlay-no-name-static.apk b/cmds/idmap2/tests/data/overlay/overlay-no-name-static.apk new file mode 100644 index 0000000000000..18ee43dc57a47 Binary files /dev/null and b/cmds/idmap2/tests/data/overlay/overlay-no-name-static.apk differ diff --git a/cmds/idmap2/tests/data/overlay/overlay-no-name.apk b/cmds/idmap2/tests/data/overlay/overlay-no-name.apk new file mode 100644 index 0000000000000..7d23c09473ce5 Binary files /dev/null and b/cmds/idmap2/tests/data/overlay/overlay-no-name.apk differ diff --git a/cmds/idmap2/tests/data/overlay/overlay-static-1.apk b/cmds/idmap2/tests/data/overlay/overlay-static-1.apk index 9a0f487522c84..642ab90d00ae7 100644 Binary files a/cmds/idmap2/tests/data/overlay/overlay-static-1.apk and b/cmds/idmap2/tests/data/overlay/overlay-static-1.apk differ diff --git a/cmds/idmap2/tests/data/overlay/overlay-static-2.apk b/cmds/idmap2/tests/data/overlay/overlay-static-2.apk index 3fc31c7d11b0a..2ec56020c4aac 100644 Binary files a/cmds/idmap2/tests/data/overlay/overlay-static-2.apk and b/cmds/idmap2/tests/data/overlay/overlay-static-2.apk differ diff --git a/cmds/idmap2/tests/data/overlay/overlay.apk b/cmds/idmap2/tests/data/overlay/overlay.apk index b4cd7cfc32489..5842da4f432e2 100644 Binary files a/cmds/idmap2/tests/data/overlay/overlay.apk and b/cmds/idmap2/tests/data/overlay/overlay.apk differ diff --git a/cmds/idmap2/tests/data/system-overlay/AndroidManifest.xml b/cmds/idmap2/tests/data/system-overlay/AndroidManifest.xml index 8af9064ba64fe..5dacebded5297 100644 --- a/cmds/idmap2/tests/data/system-overlay/AndroidManifest.xml +++ b/cmds/idmap2/tests/data/system-overlay/AndroidManifest.xml @@ -14,8 +14,9 @@ limitations under the License. --> + xmlns:android="http://schemas.android.com/apk/res/android" + package="test.overlay.system"> + android:targetPackage="test.target" + android:targetName="TestResources"/> diff --git a/cmds/idmap2/tests/data/system-overlay/system-overlay.apk b/cmds/idmap2/tests/data/system-overlay/system-overlay.apk index 90f30eb68c157..a0fba4378b57b 100644 Binary files a/cmds/idmap2/tests/data/system-overlay/system-overlay.apk and b/cmds/idmap2/tests/data/system-overlay/system-overlay.apk differ diff --git a/cmds/idmap2/tests/data/target/build b/cmds/idmap2/tests/data/target/build index 8569c4ff0a6b3..137ddb5ecaa1a 100644 --- a/cmds/idmap2/tests/data/target/build +++ b/cmds/idmap2/tests/data/target/build @@ -15,3 +15,7 @@ aapt2 compile --dir res -o compiled.flata aapt2 link --manifest AndroidManifest.xml -A assets -o target.apk compiled.flata rm compiled.flata + +aapt2 compile res/values/values.xml -o . +aapt2 link --manifest AndroidManifest.xml -A assets -o target_no_overlayable.apk values_values.arsc.flat +rm values_values.arsc.flat \ No newline at end of file diff --git a/cmds/idmap2/tests/data/target/target-no-overlayable.apk b/cmds/idmap2/tests/data/target/target-no-overlayable.apk new file mode 100644 index 0000000000000..8676cbb9dc3f8 Binary files /dev/null and b/cmds/idmap2/tests/data/target/target-no-overlayable.apk differ diff --git a/libs/androidfw/LoadedArsc.cpp b/libs/androidfw/LoadedArsc.cpp index 70ce9bc705ef3..bdd47061054a2 100644 --- a/libs/androidfw/LoadedArsc.cpp +++ b/libs/androidfw/LoadedArsc.cpp @@ -633,6 +633,7 @@ std::unique_ptr LoadedPackage::Load(const Chunk& chunk, overlayable_info.actor = actor; overlayable_info.policy_flags = policy_header->policy_flags; loaded_package->overlayable_infos_.push_back(std::make_pair(overlayable_info, ids)); + loaded_package->defines_overlayable_ = true; break; } diff --git a/libs/androidfw/include/androidfw/LoadedArsc.h b/libs/androidfw/include/androidfw/LoadedArsc.h index be62f30617bf2..b5f4006dbb00a 100644 --- a/libs/androidfw/include/androidfw/LoadedArsc.h +++ b/libs/androidfw/include/androidfw/LoadedArsc.h @@ -223,7 +223,7 @@ class LoadedPackage { } } - // Retrieve the overlayable properties of the specified resource. If the resource is not + // Retrieves the overlayable properties of the specified resource. If the resource is not // overlayable, this will return a null pointer. const OverlayableInfo* GetOverlayableInfo(uint32_t resid) const { for (const std::pair>& overlayable_info_ids @@ -235,6 +235,13 @@ class LoadedPackage { return nullptr; } + // Retrieves whether or not the package defines overlayable resources. + // TODO(123905379): Remove this when the enforcement of overlayable is turned on for all APK and + // not just those that defined overlayable resources. + bool DefinesOverlayable() const { + return defines_overlayable_; + } + private: DISALLOW_COPY_AND_ASSIGN(LoadedPackage); @@ -248,6 +255,7 @@ class LoadedPackage { bool dynamic_ = false; bool system_ = false; bool overlay_ = false; + bool defines_overlayable_ = false; ByteBucketArray type_specs_; ByteBucketArray resource_ids_;