Windows restricts the return value of threads to 32-bits, even on 64-bit
platforms. Since we don't actually return meaningful values from thread,
resolve this inconsistency with POSIX by making adb's thread abstraction
only take void functions.
Change-Id: I5c23b4432314f13bf16d606fd5e6b6b7b6ef98b5
(cherry picked from commit b5fea14e13)
Fix pathological case where the directory to be created can't be created
because there is already a file there. This was previously returning
success because the wrong var was passed to directory_exists().
Fix test to exercise this situation. Also clarify tests.
Change-Id: I0dc0f14084e0eda4e1498874d4ab2a6445d322ac
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
(cherry picked from commit 85c45bd5a1)
To create a daemon for adb host server, we should call setsid()
for the daemon process. However, previously we call setsid() for
the adb client process, which results in nothing but EPERM error.
Bug: 26982628
Change-Id: I2763ae3d5a243706927d7ef6af5095138c0ce2d8
(cherry picked from commit 6bf323b97a)
Previously, using ctrl-c in a command that needs to spawn a daemon
because one isn't already available would kill the daemon along with the
foreground process.
Bug: http://b/26982628
Change-Id: I7fefc531c3e4895423e7b466322b5426d01dc9ef
(cherry picked from commit b72b3f8c92)
The behavior of mkdirs was changed a while ago, without updating the
test.
Change-Id: I2aaa73818933b281e911c42a14e3c843d8bd972a
(cherry picked from commit 1172b2ec71)
Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.
Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname/.
Add a method to get the shared app gid from an uid or appid.
Bug: 26719109
Bug: 26563023
Change-Id: I89601d7dbeb3041df882c141a9127dac200a645e
Add libart.so to the list of public libraries only for
apps targeting android M and below.
Bug: http://b/27210062
Bug: http://b/26436837
Change-Id: I1ed3b0335a343044a76273741ea8770dcce12ebe
Currently the TCP handshake fails if the device TCP protocol version
doesn't match the host exactly, but the protocol is supposed to allow
for forwards compatibility by accepting any protocol version >= itself.
That way the other side can potentially lower its protocol to match and
keep going.
This CL fixes the protocol version check and adds corresponding unit
tests.
Bug: http://b/27220700
(cherry picked from commit aad72a533f)
Change-Id: Ib17f0a55eb910105a27609bc94bf76a30442e92e
Implements a UDP protocol for fastboot, documented in
fastboot_protocol.txt.
This version of the protocol does not include multi-packet windowing,
which will likely be needed to achieve reasonable speeds over WiFi.
Since we don't have any WiFi use cases yet, we'd like to get this in
now and update the protocol later if it becomes necessary.
Usage:
fastboot -s udp:<hostname>[:port] <command>
Bug: http://b/26154914
(cherry picked from commit 4601c978ca)
Change-Id: Ia5bbae6bcd6405671f594d7120b3994746d234d3
UDP fastboot will require re-transmission in the case of datagrams
getting lost. This CL adds Socket functionality to easily distinguish
between a normal timeout and a socket failure.
I also found some Windows docs that indicate sockets may become
invalid after a call to recv() times out. This has never occurred in
my testing, but to be safe this switches the timeout implementation
to use select() instead of SO_RCVTIMEO.
Bug: http://b/26154914
(cherry picked from commit c742a7f174)
Change-Id: I339d42fc40d853ee48d1b457d06b67faf5799d91
When an interface is deleted (which can happen, for example, to
the tun interfaces used for VPN and 464xlat), the kernel sends
RTM_DELADDR messages for all its IP addresses.
Currently we ignore these because we cannot fetch the interface
name. Instead, pass them up with an empty interface name so that
NetlinkHandler can do something useful for them, such as destroy
connections on the IP addresses that are being deleted.
Bug: 26976388
Change-Id: I2ced7e389228f9d665d0a87d97bd3452c8c0c98b
This is necessary to match the mapping in the internal infrastructure.
Bug: 21724738
Change-Id: I292166ff5c0dea7f3d771627120f16af4c56073b
(cherry picked from commit 6f74c0b843)
When packages change, existing package-specific directories may have
gained/lost a UID mapping, so we need to update the permissions for
any in-memory nodes.
This allows an app to deliver data for another package before that
package is installed, which is the typical pattern of how OBB files
are delivered.
Also fix bug by re-deriving permissions when files are moved.
Bug: 25399427
Change-Id: I06f38a24ad7dee5f5099ba81429aef03208e5683
(cherry picked from commit f7aad11c1c)
This value is read from the ro.boot.bootreason system property.
Bug: 21724738
Change-Id: I43bef3d85ba9c8d87669a91da1aa675d9a86e348
(cherry picked from commit a4a1a4ac85)
Preload libraries needed by the public namespace
at the earlier stage. This saves time on
InitPublicNamespace and saves memory because
the libraries are linked before zygote fork.
Bug: http://b/26409579
Change-Id: I59153a4180b930f31b542d8d2cb17b5d63c36774
Don't look for breadcrumb files like convert_fde unless the fstab
flags indicate we actually care whether they are present or absent.
Bug: 26989796
Change-Id: I3cde9896b22fc6f5a4b63dc3f97ac4e3588b5568
The recent uapi header update moved all the interesting constants
out into another file. Track that, and add the missing makefile
dependency.
Bug: http://b/27073568
(cherry picked from commit bd02a47b22)
Change-Id: I9323a995511b12905949cba22c59cc28623068f3
This will make sure we get invoked in time,
and combined with a kernel change to increase
the window size (and thus rate-limit the
notifications) based on the amount of memory
on the device, this should provide a nice
balance between receiving too many notifications
vs getting notified too late.
Change-Id: I2f5e92390b94e582aaa06d88763a232e39673496
libprocessgroup checks whether it can use memory
cgroups for keeping track of forked processes by
seeing whether /dev/memcg/apps is writable. However,
on systems with memory cgroups disabled, SELinux
(correctly) no longer classifies this directory as a cgroup,
and starts denying zygote access. To fix this,
first check whether /dev/memcg/apps/tasks exists to
see if the cgroup is mounted; only then check whether
we can write to the directory.
Bug: 27046965
Change-Id: I6e44cd62d8c396e20ceb162c50606b3e86f2cb3e
The Shell app that stores bugreports now lives under DE storage for
all devices, both FBE and non-FBE.
Bug: 26668510
Change-Id: Iead1dcb98181a5caccf4d0c1e86de62abc6dc990
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.
Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.
Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b