The issue is that adb uses fopen() with "e" (presumably to open the file
with O_CLOEXEC), but that flag causes MSVCRT.DLL to return an error. So
when adb_auth_host.cpp goes to read or write the adbkey files, it fails.
The quick fix is to not use the "e" option on adb host code since it
isn't necessary there, compared to adbd.
An alternative fix would be to have a fopen() wrapper on Windows that
filters out the "e" option.
Bug: http://b/21806456
Bug: https://code.google.com/p/android/issues/detail?id=175077
Change-Id: I7d8ba2847dab0ed558ffe156e79093251eb253c9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 9b9603148b)
1. Calculate AID for spawned process as (100000 * $user) + uid_from_packages.list
2. Use /data/user/$user/$packageDir as a root of a new process if $user != 0.
Change-Id: I761dfb481114bd51e5a950307fcaf403e96eef10
(cherry picked from commit da31778f3b)
This new property is used as a control verb for running a recursive
restorecon at the path contained in the property value.
Shifts both SELinux actions to occur before the actual property set
occurs, so setters can watch for completion.
Bug: 21121357
Change-Id: I3db3eb876ae66e144b3bfd648349b66a028511fd
mode_t is a uint16_t on darwin, which causes
sb.st_mode & ~S_IFMT
to produce an int when the uint16_t is promoted for the operator.
Cast to unsigned int before comparing against 0660U.
Change-Id: Ib1439c08d9e2b297eeeba701891508d269c19a3d
(cherry-pick from commit 56b37345d9)
sched_batch implies only a penalty to latency in scheduling, but
does not imply that the process will be given less cpu time. Increase
the nice level to 10 to prioritize it below ui threads.
Bug: 21696721
Change-Id: I075af059dc755402f7df9b0d7a66cca921ff04b2
(cherry pick from commit 2c3b300fd8)
- look for cases where one log line contains two without a newline.
- rare condition, occurs when a printk does not have
a terminating newline under certain race conditions.
- the newline may be performed broken up as a second call
- the timestamps can be reversed (showing the race effects).
- driver(s) should really have the newline in their log messages.
Change-Id: Ibfb56b32047da3d6513db059ca6edad0f0105168
This allows the video encoding subsystem inform the camera what format
and dataspace should be used for metadata-mode buffers.
This is necessary to allow software encoders and other generic
consumers that cannot interpret
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED buffers.
Bug: 13222807
Change-Id: I01090dc4dce11f075f7d3cd86daca5ecf3d9e995
Windows' tmpfile(3) implementation requires administrator rights because
it creates temporary files in the root directory. Write an alternative
that uses the user's temporary directory instead.
Bug: http://b/21558406
Change-Id: Ic9aece5c69429797a332a97681a76b76ac3551bf
(cherry picked from commit a26fbeeaa4)
(cherry pick from commit 047cc0729f)
- Cleanup resulting from experience and feedback
- When filtering inside logd, drop any leading expire messages, they
are cluttering up leading edge of tombstones (which filter by pid)
- Increase and introduce EXPIRE_RATELIMIT from 1 to 10 seconds
- Increase EXPIRE_THRESHOLD from 4 to 10 count
- Improve the expire messages from:
logd : uid=1000(system) too chatty comm=com.google.android.phone,
expire 2800 lines
change tag to be more descriptive, and reduce accusatory tone to:
chatty : uid=1000(system) com.google.android.phone expire 2800
lines
- if the UID name forms a prefix for comm name, then drop UID name
Change-Id: Ied7cc04c0ab3ae02167649a0b97378e44ef7b588
* changes:
Don't say "update package missing" unless we mean it.
'usb' doesn't need to be global in fastboot.
Add "fastboot --version".
libziparchive: fix fallocate failures
Use base::WriteFully in zip_archive.
libziparchive: fix clang build
Avoid mapping output to memory while writing to a file.
unzip_to_file reports failures itself these days, so there's it's unhelpful
of the caller to just guess what might have gone wrong.
Bug: http://b/21558406
Change-Id: I1e3d06c6cf902b8c6ef333dc60fd8f49680a493b
(cherry picked from commit acdbe92c60)
So bug reporters can actually tell us what they're running.
Bug: http://b/21558406
Bug: http://b/21583225
Change-Id: If2a4ae97b4792aa321566603ce2c354a72d32307
(cherry picked from commit 379646b2ca)
The objective of fallocate call seems to be to
make sure that we have enough enough space left
in the disk to house the uncompressed file.
But, fallocate is only supported in the following
file systems:
btrfs, ext4, ocfs2, and xfs
Return error only when fallocate fails due to
lack of space. The immediate ftruncate call is
going to take of the majority of other errors.
Bug: http://b/21558406
Bug: 21561449
Change-Id: I7083f3c7e5d745bd6e8a190ac9020297d638d9d4
(cherry picked from commit a68d0d1fe4)
We're already linking against libbase but we'll have to add
a libbase dependency to every target that includes libziparchive
as a STATIC_LIBRARY dependency, given that there's no way to
express that what we want (except by adding a LOCAL_WHOLE_STATIC_LIBRARY
dependency on libbase to libziparchive but that seems bad too)
Bug: http://b/21558406
Change-Id: I294ad389a9c61a1134a7bc323da25b0004a8f1e0
(cherry picked from commit e97e66ea7c)
It's unnecessary, and causes issues when the uncompressed
output is large.
Bug: http://b/21558406
Change-Id: I99cfb3933b094c2826c7e6c6de9aab03478fcc53
(cherry picked from commit f899bd534b)
(charry pick from commit 511338dd57)
BasicHashtable is relatively untested, move over to
a C++ template library that has more bake time.
Bug: 20419786
Bug: 21590652
Bug: 20500228
Change-Id: I926aaecdc8345eca75c08fdd561b0473504c5d95
(cherry pick from commit b932b2f8ba)
- added printable format modifier:
logcat -v printable
- opencoded borrowed individual utf8 validity checking algorithm
from utf8_length() in libutils/Unicode.cpp
- if considered basic one-character ASCII, use popular \x escape
sequences for non-printable
- logprint convert to C comments to drop mixed-mode
Bug: 19000361
Change-Id: I122a5b8fb41216fc0bc816178c0b768f3df56586
In order to prevent this bug from happening, we must allow vold cryptfs
commands to complete while a long running mount is underway.
While waiting for vold to be changed to a binder interface, we will simply
create two listeners, one for cryptfs and one for everything else.
Bug: 19197175
Change-Id: Ie3d9567819ced7757b0a8f391547f27db944153c
An automatic domain transition is already defined by SELinux
policy. Avoid having redundant information on the exec line.
This commit depends on commit 17fff893c0
which made the SELinux process label optional.
(cherrypicked from commit 221fca7ddd)
Change-Id: I89464f2bd218c7d6e8db08aa6bed2b62ec6dad2a
Previously, the map printing in tombstones for 64 bit devices uses
a variable length value. This means that the maps are not lined up.
The new format is to print the map as 00000000'00000000 in all ways.
Also fix a bug where the backtrace_map_t did not initialize all
parameters.
Add unit tests for all of the dump_all_maps function.
Bug: 20950813
(cherry picked from commit 862fe02919)
Change-Id: Ife5c48bddeb19006a98f9e87520474e97b97f6d9
Previously, the map printing in tombstones for 64 bit devices uses
a variable length value. This means that the maps are not lined up.
The new format is to print the map as 00000000'00000000 in all ways.
Also fix a bug where the backtrace_map_t did not initialize all
parameters.
Add unit tests for all of the dump_all_maps function.
Bug: 20950813
(cherry picked from commit 862fe02919)
Change-Id: I4269d2b96ebadcc405f478265a07a830aaf9713c
(cherry pick from commit 100658c303)
- logpersistd is defined as a thread or process in the context of the
logd domain. Here we define logpersistd as logcat -f in logd domain
and call it logcatd to represent its service mechanics.
- Use logcatd to manage content in /data/misc/logd/ directory.
- Only turn on for persist.logd.logpersistd = logcatd.
- Add logpersist.start, logpersist.stop and logpersist.cat debug
class executables, thus only in the eng and userdebug builds.
ToDo: Wish to add Developer Options menu to turn this feature on or
off, complicated by the fact that user builds have no tools with
access rights to /data/misc/logd.
Bug: 19608716
Change-Id: I57ad757f121c473d04f9fabe9d4820a0eca06f31
(cherry pick from commit 3ef730c57f)
- if saving to file, set SP_BACKGROUND policy
- if saving to file, set BATCH priority
- sort include files
Bug: 19608716
Change-Id: I00acb8b8db0d2ff9ff36c97f9e74604d31938376
(cherry pick from commit f3555d9427)
On startup, check the current logging content, then grab logs from
that time forward rather than restarting from the beginning. Add
support for reading tail time down to the nano-second.
Bonus, permits us to create a logcatd logpersist daemon
Bug: 19608716
Change-Id: Iaab58de4c02b7f97c69de12cf954fedc2163059e
(cherry pick from commit 5921276a16)
Code in 833a9b1e38 was borken,
simpler approach is to simply check last entry (to save a
syscall) minus EXPIRE_HOUR_THRESHOLD. This does make longer logs
less likely to call upon the spam detection than the algorithm
being replaced, but sadly we ended up with a log entry in the
future at the beginning of the logs confounding the previous
algorithm.
Bug: 21555259
Change-Id: I04fad67e95c8496521dbabb73b5f32c19d6a16c2
If the signal to dump a thread is never delivered, then it's
possible for a deadlock. The signal handler is responsible for
unlocking and deleting the ThreadEntry created for the pid/tid
combination. This means if the signal is lost, the ThreadEntry
gets stuck locked and never deleted. If a second attempt to get
a backtrace of this thread occurs, there is a deadlock.
Also, decrease the timeout from 10 seconds to 5 seconds. The original
10 seconds was because the unwind was actually done in the signal
handler. Now the signal handler does nothing but copy the ucontext
structure and let the caller do the unwind.
Bug: 21086132
(cherry picked from commit 2d09171758)
Change-Id: I414c500eb08983a5017caf3fce4f499465575a9d
Add a callback function to retrieve "signal handler" from the bridge,
if the bridge wants it to be managed by the runtime. The signal handler
will be invoked after the runtime's own one, and before any other
chained handler.
Add a callback function to check compatibility of the bridge with the
library.
Add a function to expose the native bridge version. Add a test for this
function.
Bug: 20217701
(cherry picked from commit a6ac9ce98b)
Change-Id: Ic23a60b949f119c7d8b0e7cb27a61e6c16532a23