15 Commits

Author SHA1 Message Date
Steven Moreland
598bda8624 Host users of libutils trace use libcutils.
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
2019-09-20 11:27:59 -07:00
Yi Kong
fbafa5162a Disable modernize-use-trailing-return-type clang-tidy check
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)
2019-08-22 22:33:37 +00:00
Dan Willemsen
d1a5aa6a00 Match src paths with aidl package name
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
2019-06-08 15:43:36 +00:00
Ryan Mitchell
bcc179acf9 Enable presubmit for idmap2_tests
Bug: 128831971
Test: presubmit
Change-Id: Id68d717412045bc2e26abbe1050b3478019a2bea
2019-03-29 14:55:51 -07:00
Mårten Kongstad
4cbb00752b idmap2: add systrace logs
Thanks to the ART team for art/libartbase/base/systrace.h which served
as inspiration for the SYSTRACE macro.

Bug: 119761810
Test: run idmap2_tests on device while capturing systrace
Change-Id: I81112ae8e58daf20ebed33ef8b0f5a0caa4dbc73
2019-02-08 07:28:41 -08:00
Mårten Kongstad
1e99b1783d idmap2: introduce improved Result class
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
2019-02-06 16:54:25 -08:00
Ryan Mitchell
198234502b Enforce overlayable API when defined
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
2019-02-05 07:56:50 -08:00
Ryan Mitchell
9853845074 Merge "Add enforcement of idmap policies" 2019-01-18 00:41:11 +00:00
Pirama Arumuga Nainar
4b2d55b082 Disable modernize-avoid-c-arrays clang-tidy check
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
2019-01-17 12:17:31 -08:00
Mårten Kongstad
d10d06d0b0 Add enforcement of idmap policies
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
2019-01-16 11:47:24 -08:00
Todd Kennedy
044803f44d Turn all warnings into errors
Bug: 121388682
Test: idmap2 builds
Change-Id: I6992c4d9b123a5e3d6cea91b1c83a90e57266837
2018-12-21 15:28:45 -08:00
Mårten Kongstad
3c9bc617ca idmap2: improve Android.bp
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
2018-12-20 14:55:49 -08:00
Mårten Kongstad
b87b507248 Switch to idmap2
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
2018-11-27 13:37:34 -08:00
Andreas Gampe
d3196be41a Idmap2: Disable tidy errors
Temporarily only emit warnings.

Exempt-From-Owner-Approval: Build fix
Bug: 120024673
Test: N/A
Change-Id: Ia85fca04cc4fe7c4fd7a5d551abb8e00bbec820b
2018-11-26 09:47:04 -08:00
Mårten Kongstad
0275123eef idmap2: initial code drop
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
2018-10-30 04:37:41 -07:00