The various atomic operations are declared as inline in the header files
to cut the function call overhead. However, the plain inline keyword is
just a suggestion to the compiler which makes its own decision on whether
to inline them or not. Worst, if they are not inlined, the
-fvisibility-inlines-hidden compiler flag will render them as hidden
symbols in the object file. If they are picked up by the linker over the
ones supplied in libcutils.so the following warning will be reported:
warning: hidden symbol 'android_atomic_inc' in foo.o is referenced by
DSO bar.so
One way is to add __attribute__((visibility("default"))) to those inline
functions to suppress the linker warnings. A better way is to force
inlining as with this patch.
Change-Id: Ie4fcfdfaaf06f42d351619a0d89671a9df15ca2f
The device should be power off when disconnecting from charger.
If the device enter to suspend, the device couldn't handle the power off
process. So the device shouldn't suspend to handle the power off at that time
Bug: 7429504
Change-Id: I9a0a60e53f315cd83550dc730a33bc7bd464ef67
Looks like libsuspend is not available on all platforms.
Change-Id: Ic32dc93221f3c488e846da35235f247f4ddb4c69
Signed-off-by: Iliyan Malchev <malchev@google.com>
To reduce power consumption after charging completion, enable suspend when LCD
is turned off.
Bug: 7429504
Change-Id: I34731dc392661c9051a20cea74f70d94a8aaeb42
Signed-off-by: Iliyan Malchev <malchev@google.com>
fastboot_protocol.txt used to live in bootable/bootloader/legacy
which was old, obsolete code. However, fastboot_protocol.txt is
a useful file and belongs with the fastboot code.
Change-Id: Iea50c3219f9ff9dd0c394fc6028c456fa948ffd9
Signed-off-by: Scott Anderson <saa@android.com>
On encrypted devices, persistent properties are loaded after the device
is decrypted. To properly change sys.usb.config to its persistent value,
it must first be set to "none" and then to ${persist.sys.usb.config}.
Bug: 7678835
Change-Id: I4f91245cedc04e3178ce9cee21390f5b657733c9
Compile libsuspend as a static library as well, currently needed by the charger
code in some cases.
Related-to-bug: 7429504
Change-Id: I113017c2c855f915b77c76d8934b6e57c0bb532c
Signed-off-by: Iliyan Malchev <malchev@google.com>
With inline atomics, trace functions have no non-inline function calls
in the fast (tracing off) path. To enable this, ANDROID_SMP must be
defined for the project. Otherwise, normal (non-inline) atomics are
used.
Change-Id: Id1f75bdf7db2f5d319a389ad411f55073d78c48c
Adds a function to read the current trace system property value, and
sets the trace tags to it, do be used as a sysprop change callback.
Change-Id: Ia6336652173aa5b07188898736c2c795a69fe79a
Basic tracing functionality to cutils, which can be turned on at start,
or dynamically controlled by the frameworks. The goal is for hardware
modules to add tracing that will be controlled by their respective
services.
Change-Id: I84eeb7d6be0038f734e719074fa4a2fae4ffe9c0
Changing __android_log_write so the tag warns users relying on the
tag to direct log output to the radio buffer to instead use Rlog or RLOG.
Change-Id: I04b7bb5e620c1ab22b9b495382a252b539947e28
Prevents possible SIGSEGV on second autosuspend_enable attempt when
first intialization attempt fails. autosuspend_inited should only
be set once autosuspend_ops has been assigned.
Consider the first call to autosuspend_enable().
autosuspend_init() sets its inited flag to true, and attempts to
set autosuspend_ops. If all the other autosuspend_*_init() attempts
fail, autosuspend_init() returns -1, which autosuspend_enable()
will return as a failure. A second call to autosuspend_enable()
will check autosuspend_init() and see that autosuspend has already
been initialized. It will attempt to access autosuspend_ops, which
were not set in the first initialization attempt, causing a SIGSEGV.
Change-Id: Ib2d3ee62fee4c3b6d0323e5b7f3709a23c6b923f