Add a new version of the Result class that functions like the old
Result, but in case of an error, also encodes a string detailing the
error. This will allow us to write the following type of code:
Result<Foo> CreateFoo() {
if (...) {
return Error("errno=%d", errno());
}
return Foo(...);
}
auto foo = CreateFoo();
if (!foo) {
std::cerr << "error: " << foo.GetErrorMessage() << std::endl;
abort();
}
std::cout << "foo=" << *foo << std::endl;
This commit only adds the new Result class. A later change will replace
uses of the old version.
Test: make idmap2_tests
Change-Id: I674d8a06866402adedf85f8514400f25840d5eda
If a package defines overlayable resources, then do not allow resources
that are not defined as overlayable to be overlaid.
Bug:123600120
Test: idmap2_tests and cts-tradefed run cts -m CtsRROTestCases
Change-Id: I35120a97ccf4650e67c7ba65a60f4f3c51b0e627
Bug: http://b/122481018
Upcoming clang update has a clang-tidy warning about using c arrays and
instead use std::array:
warning: do not declare C-style arrays, use std::array<> instead
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.
Change-Id: I971b84301e6cd1180326bc54711d0be193f09ccb
Teaches idmap2 to recognize policy restrictions put on overlayable
resources. If overlayable enforcement is turned on for an overlay, then
any resources defined within the overlayable api of the target will have
policy restrictions imposed on them. All resources without overlayable
definitions will continue to be overlayable without policy restrictions.
Bug: 119390857
Test: atest idmap2 and booting
Co-authored-by: Ryan Mitchell <rtmitchell@google.com>
Change-Id: I7e435648eb6e4a87b0b90a7b2a0c3f33c1516ea6
Improve Android.bp in a few ways:
- add cc_defaults
- remove the tidy_flag "-warnings-as-errors=*"
A note on warnings-as-errors: the default set of tidy checks are
inherited from the lists in build/soong/cc/config/tidy.go. This set is
modified by the local Android.bp's tidy_checks. If a new check is
enabled as default, and idmap2 specifies warnings-as-errors, idmap2 will
potentially break the build. In light of this, keep warnings as
warnings.
Also add a few non-default tidy checks. This version of idmap2 doesn't
compile cleanly: fixes will come in future CLs.
Also exempt the auto-generated code from IIdmap2.aidl from clang-tidy by
containing it in a separate cc_library_static block.
Bug: 120024673
Test: mmm frameworks/base/cmds/idmap2
Change-Id: I589fce792075a44a77b79117aa16b63ef0bec142
Switch from idmap to idmap2.
This CL is the safety pin for idmap2. If idmap2 causes issues during
dogfooding it is easy go back to idmap by reverting this CL.
Once idmap2 has proven itself during a suitable period of time, the
FEATURE_FLAG_IDMAP2 flag and the obsolete idmap code will be removed.
Also add an .rc file to tell init to launch idmap2d.
Bug: 78815803
Test: atest OverlayDeviceTests OverlayHostTests
Change-Id: I5ca1388ac2f8a9379fed0c257247d351a5c7a3c4
idmap2 is a reboot of the idmap project. The project aims to
- use modern C++
- greatly improve test and debug support
- interface towards AssetManager2 (instead of AssetManager)
- provide a solid foundation to add support for new features
To make it easier to verify correctness, this first version of idmap2 is
feature equivalent to idmap. Later versions will add support for new
features such as <overlayable>.
Bug: 78815803
Test: make idmap2_tests
Change-Id: I1d806dc875a493e730ab55d2fdb027618e586d16