The lint rule google-default-arguments ensures that virtual or override
methods do not have default arguments, because different default values
across the hierarchy chain (e.g. Base::foo(int a=0) v.s.
Derived::foo(int a=10)) can cause confusions.
However, since the uses of the default arguments in libbinder don't lead
to such problem, suppress the warnings.
Test: WITH_TIDY=true WITH_TIDY_CHECKS=google-default-arguments m
libbinder does not show any warning about google-default-arguments
Change-Id: Ica41034ab0ad1037a0facc447ee47e0c77fa9c55
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
sp<>::clear() presents the same risks of heap corruption in the presence
of data races as does assignment. Add the same data race check.
Bug: 112651574
Test: Build and boot AOSP
Change-Id: I75d4eedd756d521920e61ff9187509f9145d4235
This reverts commit b9d0753d2b.
Reason for revert: Re-land with MacOS workaround.
Test: Build (on Linux) and boot AOSP, with weak symbols enabled and disabled.
Change-Id: I5150cd90367178f3b039761dca3bccc9c2987df1
This reverts commit 9d3146af22.
Reason for revert: It appears that weak symbols don't work as expected on MacOS, breaking the MacOS aapt build.
Change-Id: Ica0955106485a7bf2e2c3f09ff7910e230eb4139
Move towards crashing if a normally configured RefBase object is
destroyed without ever incrementing the reference count. We've been
threatening to do this for a long time. The previously last known
violation had been fixed.
This also fixes stack trace printing from RefBase, which had previously
been broken, and which we found necessary to track down further
violations of this rule.
Unfortunately, we found several more violations with the aid of
that fix. After existing CLs are submitted, there are
still some failures, but they are no longer numerous. Thus this CL
doesn't actually crash in the event of a violation, but does log a
verbose stack trace if it encounters one.
Bugs have been filed against the remaining known RefBase client offenders.
We plan to enable crashing on usage violations once those are fixed.
The fix for the stack trace printing breakage unfortunately requires
the use of weak symbols in order to avoid a circular build dependency.
We expect to eventually replace this with execinfo.h functionality.
Some random reformatting, driven by consistency with current formatting
requirements.
Add missing include to BacktraceMap.h.
Bug: 79112958
Bug: 30292291
Test: Boot AOSP, Master
Change-Id: I8151c54560c3b6f75ffc4c48229f0388a2066958
Switch Looper to using unique_fd for its owned file descriptors, to
benefit from fdsan.
Bug: http://b/111560345
Test: treehugger
Change-Id: I8efff7741ed19fd71f82f7e604b4f1c66fc5ea2b
adbd has been built as a static executable since the same binary was
copied to the recovery partition where shared library is not supported.
However, since we now support shared library in the recovery partition,
adbd is built as a dynamic executable.
In addition, the dependency from adbd to libdebuggerd_handler is removed
as debuggerd is handled by the dynamic linker.
A few more modules in /system/core are marked as recovery_available:
true as they are transitive dependencies of the dynamic linker.
This change also includes ld.config.recovery.txt which is the linker
config file for the recovery mode. It is installed to /etc/ld.config.txt
and contains linker namespace config for the dynamic binaries under
/sbin.
Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.
Change-Id: I363d5a787863f1677ee40afb5d5841321ddaae77
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. toybox) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.
Bug: 67916654
Bug: 64960723
Test: m -j
Change-Id: Ie59155c08890e96ce1893fa3687afcf763d7aea3
These warnings are triggered by -Wextra-semi (and not -Weverything, as
incorrectly mentioned in I49b6e6af483e011632e6a34c0663c93e5c385aa6).
This warning is added to Hidl-generated libs.
To appease clang-format, this patch also fixes some extra newlines.
Test: Build
Change-Id: I63cf5d8ecba46ad87876ff21848bfff04b12ec6e
Upcoming clang update to r328903 adds a new warning:
warning: extra ';' outside of a function is incompatible with C++98
[-Wc++98-compat-extra-semi]
which is included in -Weverything.
We can just delete the extra semicolon (even though we use gnu99), and
save the extra byte.
Test: Build
Change-Id: I49b6e6af483e011632e6a34c0663c93e5c385aa6
CallStack.cpp was part of libutils, but has been separated into a new
library libutilscallstack [1] and then made invisible to vendors [2].
However, this is causing problem to the vendors who have been using
the CallStack class from libutils, because the class is no longer
available to them.
In order to support them, marking libutilscallstack as
'vendor_available: true'.
This reverts commit a32678df55.
[1] https://android-review.googlesource.com/c/platform/system/core/+/591954
[2] https://android-review.googlesource.com/c/platform/system/core/+/599754
Bug: 74600214
Test: m -j
Test: 2016/2017 pixel devices boots to the UI and Photo Editing works
Change-Id: Iaa232ed978378b566a4710e2320ee6ed04572e14
The library isn't intented to be exposed to vendors. It is a platform
private library.
Bug: 72471487
Test: Pixel 2016/2017 boots to the UI. Photo editing works.
Change-Id: Ib0479a43d66d988c2f882688240746bed3213dad
Providing alternative suggestions for using C++ stdlib types
instead of libutils types:
- higher interoperability
- fewer "legacy" quirks
- ability to use stl algorithms
- high optimization levels
Test: none
Change-Id: If81aa9982ca0ad229fa13c8142387906981b054d