Commit graph

3827 commits

Author SHA1 Message Date
Jiyong Park
ee989fcb4d Turn off -Wnon-virtual-dtor explicitly
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
2020-09-25 11:56:04 +09:00
Josh Gao
596f3b5384 Merge "adbd: Fix check against valid payload size" 2020-09-18 23:01:18 +00:00
Mayank Rana
71a33cfa67 adbd: Fix check against valid payload size
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
2020-09-18 19:26:45 +00:00
Bill Yi
34ecedbcc8 Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: Ib2a6c8b5cc127d4aab61a454f47f3cce410d674e
Change-Id: Ief5996d70b59986c15a1b8056c678a6ef35a72d3
2020-09-17 21:57:28 -07:00
Josh Gao
190921ed5c Merge "ADB internals documentation" 2020-09-16 05:54:40 +00:00
Fabien Sanglard
59c0640fb0 ADB internals documentation
Document the internals of adb pipeline. In particular the fdevent,
smart socket, and transport flow.

Bug: NA
Test: NA
Change-Id: Ia8fd8a6da843b8e91ca3005545f33bd0a82cc0c3
2020-09-15 22:50:59 -07:00
Elliott Hughes
ebd07cc5d0 Merge "adb: switch to ZipEntry64." 2020-09-15 22:59:41 +00:00
Elliott Hughes
0016ffc516 adb: switch to ZipEntry64.
Test: treehugger
Change-Id: I1eba8c641912e46ed243deddd19f367ae40a5d46
2020-09-15 14:31:08 -07:00
Treehugger Robot
316298d7b0 Merge "adb: fix push --sync with multiple inputs." 2020-09-11 04:55:49 +00:00
Josh Gao
1b65ebe2e0 adb: fix push --sync with multiple inputs.
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
2020-09-08 18:07:47 -07:00
Xin Li
15144fd1ec Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:04:21 +00:00
Xin Li
0a112d52f8 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id18cb0e2d2f3e776a42b566c4a1af2e250890896
Change-Id: Iba7cab32ab3aa6f47952c840ff6dc8492e8d0704
2020-08-29 01:42:13 -07:00
Jiyong Park
4c57596b81 Don't enable version lib for libadb_sysdeps
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
2020-08-28 13:30:34 +09:00
Treehugger Robot
0297fef2f9 Merge "Allow shell to write to /sdcard/Android/data and /sdcard/Android/obb." 2020-08-21 22:25:37 +00:00
Martijn Coenen
4da604ba4e Allow shell to write to /sdcard/Android/data and /sdcard/Android/obb.
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
2020-08-19 09:04:52 +02:00
Alex Buynytskyy
2698b8ddeb Revert "[adb] fix signature check"
This reverts commit c935d0c450.

Reason for revert: invalid test, let's change it instead of breaking incremental installations

Change-Id: Ie5fb318c26d3a74cd2dbb16e09bda018efece211
2020-08-14 23:45:00 +00:00
Songchun Fan
c935d0c450 [adb] fix signature check
BUG: 163543633
Test: atest CtsIncrementalInstallHostTestCases
Change-Id: Ie65d4639d5fb5b2dc100f1d17e3dd1c843510325
2020-08-14 11:49:58 -07:00
Joshua Duong
a65d905b4a Merge "[adb] Correctly read host/user name on Windows." 2020-08-05 15:25:47 +00:00
Joshua Duong
62a42ec8ca [adb] Correctly read host/user name on Windows.
Bug: 162111908

Test: On linux/mac:
HOSTNAME="" adb keygen mykey; cat mykey.pub # Also LOGNAME
HOSTNAME="测试" adb keygen mykey; cat mykey.pub
HOSTNAME="test" adb keygen mykey; cat mykey.pub

Test: On Windows:
set COMPUTERNAME=&& adb keygen mykey
&& powershell -command "get-content -encoding utf8 mykey.pub" # Also USERNAME
set COMPUTERNAME=测试&& adb keygen mykey
&& powershell -command "get-content -encoding utf8 mykey.pub"
set COMPUTERNAME=test&& adb keygen mykey
&& powershell -command "get-content -encoding utf8 mykey.pub"

Change-Id: I62c952c511a620286aa4e05b1763361406e9f89a
2020-08-03 18:55:17 -07:00
Jeff Sharkey
7b21637782 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Change-Id: Iafcccbdbdf3ff1078e87000e2ce560ff09b43f68
2020-07-31 16:36:06 -06:00
Treehugger Robot
1c5a205fda Merge "[incremental/adb] fix signature size check" 2020-07-30 22:27:27 +00:00
Songchun Fan
34d65037e9 [incremental/adb] fix signature size check
Should check signature block size, not file size

Test: manual
BUG: 157077910
Change-Id: I6f03af58532b3c518c447f6e7407ebfc0ba37b44
2020-07-27 09:45:35 -07:00
Joshua Duong
25baf12af9 Merge "[clang-tidy] Add bugprone-inaccurate-erase check." am: 4aa073337d am: 27cb133608
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1365228

Change-Id: I8e0f3c623c695e48f61f141e63ceda6eea783fc7
2020-07-17 23:47:19 +00:00
Joshua Duong
89169a372f [clang-tidy] Add bugprone-inaccurate-erase check.
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
2020-07-17 14:50:45 -07:00
Treehugger Robot
3cffdba0fe Merge "Fix quoting of paths in auth code." am: b371af9e0f am: f898aade18
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1363936

Change-Id: I28cf44911b232af339eb6f685fe5f8a3e7ef0641
2020-07-16 17:14:57 +00:00
Treehugger Robot
b371af9e0f Merge "Fix quoting of paths in auth code." 2020-07-16 16:47:20 +00:00
Alex Buynytskyy
0f04bf05dd Merge "install-multi-package fix" am: 35f3169c5c am: 5f3ced82f4
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1362351

Change-Id: I8eaef439a60e323c94ce5797ab93970d4f48937a
2020-07-16 06:00:22 +00:00
Alex Buynytskyy
71afeb9a5e install-multi-package fix
Fixes: 158851500
Test: adb install-multi-package -d -g $HOME/tmp/base-master.apk:$HOME/tmp/base-en.apk
Change-Id: I92e034c0a8c27eab6d5a82e96817af4a7555388f
Merged-In: I92e034c0a8c27eab6d5a82e96817af4a7555388f
2020-07-16 04:57:07 +00:00
Elliott Hughes
bdb5233f0c Fix quoting of paths in auth code.
Noticed looked at the log in http://b/160831491.

Test: builds
Change-Id: I95c595ba433a868dedeee8059cfba4c6de8ba91b
2020-07-15 11:55:40 -07:00
android-build-team Robot
1c8a65fb80 Make change and version bump to r_aml_300900700 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Iee1c8aa627a6e21d31d29070a3327db43bb6e91f
2020-07-09 03:15:03 +00:00
android-build-team Robot
0ef6809189 Make change and version bump to r_aml_300900600 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I9453dcf13b0432e45a71c732ee82bce5551d13d5
2020-07-08 03:15:31 +00:00
android-build-team Robot
f4e7ecca06 Make change and version bump to r_aml_300900500 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I53fcd7d569bc73a028e2e6fe6495763eb54008f8
2020-07-07 03:15:20 +00:00
Josh Gao
8c2fc237f7 Merge "[adb] Fix crash in mdns service removal." am: 7229923bcd am: d6fcfc8099
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1352926

Change-Id: Id4c47e039124a66231b7db534b4fb02e9de212fe
2020-07-06 20:42:24 +00:00
android-build-team Robot
44fda127d1 Make change and version bump to r_aml_300900400 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ia5f2939ef9ca26a06e91f3b82418562327398102
2020-07-06 03:15:26 +00:00
android-build-team Robot
1a8d88fab3 Make change and version bump to r_aml_300900300 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I7d813955dda3646575546b6346d7d16bc7071b79
2020-07-04 03:15:14 +00:00
android-build-team Robot
03ff3bc87a Make change and version bump to r_aml_300900200 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ic456daed0a2a998459585e1d5ec1cfd25f68d635
2020-07-03 03:15:45 +00:00
android-build-team Robot
0927bcff9e Make change and version bump to r_aml_300900100 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I40457010d98290fd8bc6c29884e8fc13f6f3f168
2020-07-02 03:15:03 +00:00
Joshua Duong
1922ad0dd4 [adb] Fix crash in mdns service removal.
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
2020-07-01 15:06:33 -07:00
android-build-team Robot
d62c0e7015 Make change and version bump to r_aml_300900000 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ibb2e300b4d44ac1c065e481440265eb99a1e346e
2020-07-01 03:15:12 +00:00
Akshay Thakker
d3adefcbcb Version bump to r_aml_309999900 [adb/apex/apex_manifest.json]
Change-Id: Ie1a02f8de348d7aa4cb2409d200795afdde9eca9
Exempt-From-Owner-Approval: Version bump only
2020-06-30 05:27:23 +00:00
android-build-team Robot
27f34c8a99 Make change and version bump to r_aml_300803100 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I034db3ede9445afe530139d81901414e7642ec3f
2020-06-30 03:15:19 +00:00
android-build-team Robot
f32c0862c0 Make change and version bump to r_aml_300803000 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I84ff51106e5a56686835f6ef6bf5f8a08fef832d
2020-06-29 03:15:58 +00:00
android-build-team Robot
9f801c2054 Make change and version bump to r_aml_300802900 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Ibe5237d97cbd821ce052dbaa42c4974a55e6dd53
2020-06-27 03:30:07 +00:00
android-build-team Robot
340ad8a612 Make change and version bump to r_aml_300802800 for mainline module file: adb/apex/apex_manifest.json
Change-Id: Iffcf3b70c83e67142600fecf899d1d838cc40378
2020-06-26 03:15:15 +00:00
Josh Gao
9634c0f40c Merge "adbd: check auth id." into rvc-dev am: d389d983bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/11988040

Change-Id: Ide36da6503d0e4f96a2f7b7e67beab61a847e884
2020-06-25 23:10:12 +00:00
android-build-team Robot
9ccd27ecff Make change and version bump to r_aml_300802700 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I789140f4f9a6e86e876485a988f66fa603952636
2020-06-25 03:20:03 +00:00
Josh Gao
a5c24c323d adbd: check auth id.
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
2020-06-24 16:25:49 -07:00
android-build-team Robot
2a4f9a3faa Version bump to r_aml_300802600 [adb/apex/apex_manifest.json]
Change-Id: Ide7c0d333abd042892716facef373aa2ff3a5772
2020-06-24 16:53:22 +00:00
android-build-team Robot
5a073667df Make change and version bump to r_aml_300802500 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I9f1cc1af57de4fbe2384577de2a9d90ee74ddb9c
2020-06-24 03:15:47 +00:00
android-build-team Robot
f1db70008a Make change and version bump to r_aml_300802400 for mainline module file: adb/apex/apex_manifest.json
Change-Id: I6bd0d2709a2d06a7cc49c28ddbdf37b643af8e94
2020-06-23 03:15:35 +00:00