Clang-tidy expects modernized code to prefer deleting copy constructors
and assignment operators to legacy macros.
/disk/android_trees/aosp-master-plus-llvm/frameworks/base/cmds/idmap2/tests/ResultTests.cpp:263:3: error: prefer deleting copy constructor and assignment operator over using macro 'DISALLOW_COPY_AND_ASSIGN' [modernize-replace-disal low-copy-and-assign-macro,-warnings-as-errors]
DISALLOW_COPY_AND_ASSIGN(NoCopyContainer);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bug: http://b/155835175
Test: mm in idmap2
Change-Id: I3bb29b48a478a67cbda959f47b271ccf8543a768
I unfortunately missed in the original testing that
`tidy_checks_as_errors` isn't sufficient by itself. Instead we need to
have both places with the same variables. A future change will make
Soong expand `tidy_checks_as_errors` into both locations appropriately.
Bug: 119328308
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,-google-readability-*,-google-runtime-references,-cppcoreguidelines-*,-modernize-*,-llvm-*,-bugprone-narrowing-conversions,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-hicpp-*,-fuchsia-* mm
Change-Id: If69f69bf7861ba3569756270381f3f737366f2f0
Merged-In: If69f69bf7861ba3569756270381f3f737366f2f0
(cherry picked from commit 56af59395e0cdcebeb9b01813f752cc22468c4c0)
This fixes a build break due to new code from
http://ag/I96f970e82b5243be01b205ac2cb6ab249c6100bc that inadvertently
triggers some false positives with other clang-tidy flags. Builds that
use a wider set of tidy flags (as specified in the test below) will
break since `-warnings-as-errors=*` turns all warnings into errors,
rather than just the ones that were specified as part of this
Android.bp. The preferred way of checking this is to use
`tidy_checks_as_errors`
Bug: 119328308
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,-google-readability-*,-google-runtime-references,-cppcoreguidelines-*,-modernize-*,-llvm-*,-bugprone-narrowing-conversions,-misc-non-private-member-variables-in-classes,-misc-unused-parameters,-hicpp-*,-fuchsia-* mm
Change-Id: I941b3c89402e2cfa290b3829e2ac8ff7ea67ca3d
Merged-In: I941b3c89402e2cfa290b3829e2ac8ff7ea67ca3d
(cherry picked from commit 0bc64543270b16e1953b399dc73fa739132a6e5f)
Some primitives were not initialized to a default value causing
--ignore-overlayable and --verbose to default to true.
Bug: 148181123
Test: idmap2_tests
Change-Id: If87ba76b7d24803f46b71ef36befa12f25916680
Merged-In: Ic9dbd3e9a768beb39ac677ff294b0fca5ee8f9d2
AIDL generates optional<T> for nullable T types for C++, which is more
efficient and idomatic and easy to use.
Bug: 144773267
Test: build/flash/boot
Merged-In: I90cf2ce1193c479179687d71a5c1416f6cdf0b16
Change-Id: I90cf2ce1193c479179687d71a5c1416f6cdf0b16
(cherry picked from commit ff7f4279bd7fa33577f5f4d46aa9de322fb625d4)
Exempt-From-Owner-Approval: CP from master
When there is overlay package in system_ext, turn on POLICY_SYSTEM_PARTITION.
In other words, overlay pacakge in /system_ext is considered as system's one
Test: mv vendor/overlay/framework-res__auto_generated_rro.apk system_ext/overlay
and then check if it works properly.
Bug: 136715327
Change-Id: Ib225368eae41203a8630f4310d26e9cf1afa706a
Merged-In: Ib225368eae41203a8630f4310d26e9cf1afa706a
(cherry picked from commit cba9579158cc70bf8eadb6e8a239e0ab2dc073d2)
Reducing device/host differences. This is now required since libutils
Trace.h always calls the libcutils functions, instead of before where
it only called these functions on device.
Bug: 124524556
Test: build & boot
Change-Id: Ic096ed7caf8ca59292b3427a16c4e2545d12dfd9
Upcoming clang update introduced the new modernize-use-trailing-return-type
check which is not useful. Disable this warning for now (even before the
new clang update lands) since clang-tidy doesn't complain about flags it
doesn't know.
Test: build with new clang-tidy
Bug: 131328001
Change-Id: I7fbc10fb9044904f85f9a1ec6cf712ce3cec0a79
Merged-In: I7fbc10fb9044904f85f9a1ec6cf712ce3cec0a79
Exempt-From-Owner-Approval: Trivial, no functionality change
(cherry picked from commit fc8e666d67afef241ddb6491ddc13948c3b837c0)
(cherry picked from commit a0914d81ef9f4d7258f1530dc3bfdd575f6e448d)
In order for the build system to track updates to the header files
during incremental builds, always specify the src files using the same
path as the package for C++ compilations.
Bug: 112114177
Test: treehugger
Change-Id: I584f43a0386840ce3d066479e9e4035de81da144
Idmap now checks if the version of the vendor partition is greater than
or equal to 29 or a development codename to enable enforcement of
overlayable resources.
Bug: 119390857
Test: manual
Change-Id: Ica25800432993beb7464436d4fba7cb391e621ef
idmap2 scan was not allowing oem and odm overlays to fulfill the oem and
odm overlayable policies.
Bug: 129735590
Test: manual
Change-Id: I230f72b37b95a997d32f2ef136b6301d970a413c
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.
Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
If one static overlay fails to have its idmap generated, continue
scanning other overlays.
Bug: 130324774
Test: idmap2_tests and manual
Change-Id: I06a74c844ebc81dcfb5b50e8c9a30a68c7e4ffb0
When printing warning messages while generating idmaps, put the vertical
bar chracater in between the policies.
Bug: none
Test: manual
Change-Id: I8efee753d9ed7ce99ccafd49b6c8744eea031839
Passing policy flags to the Verify command of idmap2 was causing the
command to fail to parse and run create again even when the target and
overlay did not change. This change allows verify in scan to work
correctly again.
Bug: 127860892
Test: confirmed that create is not run on a successive reboot
Change-Id: I7b9c9d81c7aef6b4c80fb8b87a1e929e82fc3b84
Change the signatures of Idmap::FromApkAssets and
Idmap::FromBinaryStream from
std::unique_ptr<const Idmap> func(..., std::ostream& out_error);
to
Result<std::unique_ptr<const Idmap>> func(...);
The returned pointer is still a unique pointer to ensure the dynamically
allocated memory is automatically released when no longer used. This
means that using the returned value of either function requires one of
two patterns:
const auto idmap = func(...);
if (!idmap) {
return Error(...);
}
(*idmap)->accept(...);
or
auto result = func(...);
if (!result) {
return Error(...);
}
const auto idmap = std::move(*result);
idmap->accept(...);
Note that in the second example, result must be non-const or
the call to std::move(*result) will not compile.
With this change, the entire idmap2 project has been converted to use
Result.
Test: make idmap2_tests
Change-Id: I533f4e03b99645523d94dd5f446ad76fb435f661
- Add hasCode=false to overlay packages as a workaround for b/124375490
- Sprinkle Thread.sleeps in InstallOverlayTests in an attempt to make
the tests less flakey when executed on emulator
Test: atest OverlayDeviceTests OverlayHostTests
Change-Id: I745a8477ed5e72db572737a0af0e59478893e42b
Idmap2 is not enforcing overlayable on Q overlays and instead on P
overlays. This corrects this behavior.
Test: idmap2_tests
Bug: 128932015
Change-Id: I7e45a965d3b165dae7ed7377d0911afd62f63983
Change the signature of the idmap2 commands (Create, Dump, ...) to
return Result<Unit> instead of bool. This removes the need to pass in an
ostream for error messages: instead, those messages are part of the
returned Result.
Consolidate error messages: texts in Error objects should not be
prefixed with "error:", that is the responsibility of the outer-most
caller (i.e. main()).
Test: make idmap2_tests
Change-Id: I074881b3d1982ea8f4be5752161ac74b14fcba95
Overlayable policies were not being passed correctly to idmap2 create
from scan. This fixes that and adds better error messages for when
policy failures occur.
Bug: 127860892
Test: manual
Change-Id: I8fae20884a75f4c57a0eb4aafdb4e09da3ebaf93
In order to lift the signature/preinstalled install restrictions on overlays,
we must protect packages that have not migrated to <overlayable> from
being overlaid. If a resources is not specified as overlayable and the
overlay does not define an <overlayable>, require the overlay to be
preinstalled or signed with the same signature as the target.
Bug: 121016681
Bug: 125933494
Test: idmap2_tests
Change-Id: I38f520929031b743e4bbe0366a9be55aac5795c5
Remove the old std::optional based Result class, replace uses with the
new std::variant based Result class.
Test: make idmap2_tests
Change-Id: I401cb36e5af06133a2872d835cf29bfb0b106597
Handles the new signature policy for overlayable resources.
Bug: 119402606
Test: idmap2_tests target
Change-Id: I7961e04a879c40c240ed9097bb510addb8b56680