adb has been built without -Wnon-virtual-dtor because Soong doesn't turn
the flag for the host targets, and the flag can't coexist with
-Wexit-time-destructors.
However, the new host target linux_bionic_arm64 turns the flag on,
because it inherits most of the cflags from the device config.
That is forcing us to implement the virtual destructor, which isn't
possible due to -Wexit-time-destructors.
Solving the issue by explicitly turning -Wnon-virtual-dtor off so that
it is disabled also for the linux_bionic_arm64 target.
Bug: 159685774
Test: HOST_CROSS_OS=linux_bionic HOST_CROSS_ARCH=arm64 m \
out/soong/host/linux_bionic-arm64/bin/adb
Test: run the adb on an ARM emulator
Change-Id: I655b340e4f199a3a75b7df7cc3fe18832e26a7ae
block->payload and its size are not valid when it is used to check
against bytes_left due to std::move() performed on its just prior
to the check. Hence check will always fail to detect the case where
received data is more than expected. To detect this condition and
allow error handling with std::move(), remove extra payload variable
and directly use block->payload.
Bug: http://b/168917244
Change-Id: I992bbba9d9a9861a195834f69d62e69b90658210
Document the internals of adb pipeline. In particular the fdevent,
smart socket, and transport flow.
Bug: NA
Test: NA
Change-Id: Ia8fd8a6da843b8e91ca3005545f33bd0a82cc0c3
Previously, when push --sync was used with multiple files, we tried to
stat a remote file with pending acknowledgements still in the socket
buffer, which leads to an abort when we read ID_OKAY instead of the
response we were expecting.
This patch changes the behavior to always wait for acknowledgements if
we're pushing with --sync (or `adb sync`). This results in a ~100ms
regression during a 10 second sync of every file on the system image,
but that's not very much, so perhaps we should consider doing this
always.
Bug: http://b/166155032
Test: test_device.py
Change-Id: I7110243071ba5fbaa77dcc76f42a19d9ed2b4195
When use_version_lib is set to true, but build::GetBuildNumber() isn't
used, the library can't be processed by symbol_inject. For example,
$ m out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/arm64_armv8-a_shared/versioned/libadb_sysdeps.so
FAILED:
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so
out/soong/host/linux-x86/bin/symbol_inject -i
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/unstripped/libadb_sysdeps.so
-o
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so
-s soong_build_number -from 'SOONG BUILD NUMBER PLACEHOLDER' -v $(cat
out/soong/build_number.txt)
symbol not found
17:09:10 ninja failed with: exit status 1
This is because the visibility of the symbol `soong_build_number` in
libbuildversion.a is hidden via the -fvisibility=hidden flag for the
library. In addition, -Wl,--gc-sections strips the hidden symbol when
it is not referenced.
This fortunately hasn't caused a problem because, for the device target,
the output of symbol_inject was used only for dist outputs.
libadb_sysdeps wasn't registered as dists. So
versioned/libadb_sysprops.so never had a chance to be built. For the
host target, in the other hand, the output of symbol_inject is used
always, but --gc-sections is not used for host targets. So the symbol
wasn't stripped and therefore symbol_inject could always find the
symbol.
This however is expected to cause a problem when the support for
LinuxCross is added. It is one of the host targets, therefore
symbol_inject is always used. However, unlike other host targets,
--gc-sections is turned on because it inherits most of the flags from
Android/ARM64.
To avoid the problem, we might want to disable --gc-sections for the
target. But regardless of the decision, having a build rule that always
fails is not desirable - even though the build rule is essentially never
triggered. Therefore, we choose to not use version lib for
libadb_sysdeps because GetBuildNumber() is not used in the lib.
Bug: 159685774
Test: m \
out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/\
arm64_armv8-a_shared/versioned/libadb_sysdeps.so
Change-Id: Ide1056b5b55e409ab809e302a697d10d759c92ce
On devices without sdcardfs, these are only writable by the owning UID,
and/or the ext_data_rw/ext_obb_rw groups respectively.
Bug: 161134565
Bug: 162810387
Test: try to write to /sdcard/Android/data/ from shell uid
Change-Id: Idb4e07f967c8e888d95afa6c4a71595e0910ba0e
This reverts commit c935d0c450.
Reason for revert: invalid test, let's change it instead of breaking incremental installations
Change-Id: Ie5fb318c26d3a74cd2dbb16e09bda018efece211
This will hopefully identify misusage of the erase-remove idiom.
Test: "foo.erase(std::remove_if(...))" produces error.
Test: mmm system/core/adb -j (no warnings)
Change-Id: Iba0a6fc40cb6e7c65a7a3926d915874dc89a60c6
If std::remove_if is a no-op (no service name match), then
std::vector::erase would crash.
Bug: 160025305
Test: test_adb.py
Test: Manual.
1) Enable wireless debugging on multiple devices
2) Disable wireless debugging on all devices
Change-Id: If58b0dda0bb698fd3fd225d9b6a6726a88ae47e0
When multiple auth requests come in (e.g. if someone connects over TCP
and USB, or if we send a USB request, and then kill adb and try again),
we need to disambiguate.
Bug: http://b/159061108
Test: manual
Change-Id: I0768dc3c1830456cb8cbd4395c23ef8f193cc420