summaryrefslogtreecommitdiffstats
path: root/adb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_system_core ↵Wolfgang Wiedmeyer2016-12-124-46/+179
|\ | | | | | | into replicant-6.0
| * Merge tag 'android-6.0.1_r66' into HEADJessica Wagantall2016-09-074-46/+179
| |\ | | | | | | | | | | | | | | | Android 6.0.1 release 66 Change-Id: I5ccc6e68283e30b8d0419eb7512c7183e58ec5ed
| | * adb: use asocket's close function when closing.Josh Gao2016-07-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | close_all_sockets was assuming that all registered local sockets used local_socket_close as their close function. However, this is not true for JDWP sockets. Bug: http://b/28347842 Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e (cherry picked from commit 53eb31d87cb84a4212f4850bf745646e1fb12814) (cherry picked from commit 014b01706cc64dc9c2ad94a96f62e07c058d0b5d)
| | * adb: switch the socket list mutex to a recursive_mutex.Josh Gao2016-07-214-45/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sockets.cpp was branching on whether a socket close function was local_socket_close in order to avoid a potential deadlock if the socket list lock was held while closing a peer socket. Bug: http://b/28347842 Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3 (functionally a cherrypick of 903b749f + 9b587dec, with windows disabled)
* | | Merge branch 'cm-13.0' of https://github.com/CyanogenMod/android_system_core ↵Wolfgang Wiedmeyer2016-03-182-3/+5
|\ \ \ | |/ / | | | | | | into replicant-6.0
| * | Merge tag 'android-6.0.1_r22' of ↵Steve Kondik2016-03-112-3/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/core into cm-13.0 Android 6.0.1 release 22 Change-Id: Ia61f8e863f7413a67fe65f41ea2a30c086528df4
| | * | Backport missing null check in "adb get-state".Elliott Hughes2015-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=184011 Bug: http://b/23709037 Change-Id: Ia33814bd2adc310c2471cd6a12b9a73f27d77182
| | * | Minimal fix for adb backup.Elliott Hughes2015-08-261-2/+4
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | In master this code has been completely rewritten. This is the minimal fix against the mnc-sdk-release source. Bug: http://b/23015233 Bug: https://code.google.com/p/android/issues/detail?id=183490 Change-Id: Iac30993bd2b1b354f8518d8ea2a9ae680ebe4177
| | * adbd: enable USB SuperSpeed (again)Jack Pham2015-08-241-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The descriptors to enable USB 3.0 SuperSpeed support had previously been added in commit d6ee9f26a5163af4121f4380264fcbd4e6851a17 but were removed when the v1/v2 descriptor handling was refactored in commits ab3446dd3400652ecf50682d0e5c4184628e9930 and again in c49f51c451516bf06afc6d71947eb11cc4627273. Now that the dust has settled, add back the SS descriptors to re-enable USB 3.0. Bug: 23385314 Change-Id: I8de7c7e50d9216a7492ce7863e3aaf92ff805eff (cherry picked from commit a190c800bf562c2fd2fb113782ff83c1d475ea61)
* | | strrchr() returns const char*, so casting is necessaryWolfgang Wiedmeyer2016-01-073-8/+8
|/ / | | | | | | | | | | | | fixes build errors with custom toolchain Change-Id: I6aeddf8007a467b3e08af0e86d0016db7dd8ac9e Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* | adb: host: Provide better sideload statusTom Marshall2015-12-011-15/+30
| | | | | | | | | | | | | | | | | | | | | | * Show data transfer in MB and in multiple of the file size. * Show a spinner to indicate liveness, which is updated at least once per second regardless of data transfer. * Do not allow sideload of zero sized files. Change-Id: I1bd0df6a8183fad5a502fc26a7e789c27d24f71a
* | adb: Fix recovery_modeTom Marshall2015-12-012-4/+6
| | | | | | | | | | | | * adb_trace_init() exits early, put the banner check in main(). Change-Id: I83d0b83076a3d97fdec41b2cf02ee45805a53c6f
* | Merge branch 'LA.BF64.1.2.2_rb4.7' of ↵Steve Kondik2015-11-161-32/+27
|\ \ | | | | | | | | | git://codeaurora.org/platform/system/core into cm-13.0
| * | Revert "adbd: Don't close/reopen FFS ep0 on disconnect"Mayank Rana2015-10-261-32/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b5d385f1ef38ad0c163598c3a4e167d4ae9df3c6. Commit b5d385f "adbd: Don't close/reopen FFS ep0 on disconnect" fixes USBCV chapter 9 failures due to re-enumeration as part of reopening FFS ep0 handle. This was done from usb_kick function which gets invoked whenever adb read/write fails. But, not allowing USB re-enumeration on real IO failures results in adb to go offline and only way to recover is by re-connecting USB cable. As ADB function is used for debugging and USBCV tests are not mandatory, hence, revert original change to allow USB enumeration on any read/write failures. CRs-fixed: 689512 Change-Id: Ic0b38223761b7c0eb3e2c54328e88010297318fb
* | | adb: Fix compilation issueSteve Kondik2015-10-181-2/+1
| | | | | | | | | | | | Change-Id: Ia3284d5b8e428474726f64231f8142cf2474b17f
* | | adb: Changes for factory modeTom Marshall2015-10-171-1/+3
| | | | | | | | | | | | | | | | | | * Always insecure in factory mode Change-Id: Ic5b6e83ef816240521424814d66294fd786966cd
* | | adb: Allow configuring the adb shell with a persistent property.rbox2015-10-171-1/+6
| | | | | | | | | | | | | | | | | | To set to bash: setprop persist.sys.adb.shell /system/xbin/bash Change-Id: I24e65f4592aaf23356c13db02c9869076df3b841
* | | adb: Fix compilation warningSteve Kondik2015-10-171-0/+2
| | | | | | | | | | | | Change-Id: Iab0cb977f81824338a37ecba233b45883c0bc13b
* | | adb: Look for bu in /sbin when in recovery modeTom Marshall2015-10-173-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Restore global variable recovery_mode. This is set based on the commandline parameter --banner. * Use recovery_mode to select path to 'bu' binary for both backup and restore services. Change-Id: Ie4c945d00601514d7f16357bae10ff7f232633e1
* | | fix up adb to prefer /sbin/sh if it existsKoushik K. Dutta2015-10-171-2/+14
| | | | | | | | | | | | Change-Id: I5c15731c95d123488e90aaeac5b497f556b53363
* | | adb: Add a few more wait-for commandsSteve Kondik2015-10-173-2/+13
| | | | | | | | | | | | | | | | | | | | | * wait-for-recovery is obvious. * wait-for-online will wait for recovery || device Change-Id: I70f747bcd201a4157b988d7ed49bcc8e5ff4c85f
* | | adb: Add "wait-for-sideload" commandSteve Kondik2015-10-171-0/+3
| | | | | | | | | | | | | | | | | | * Waits for connected device to enter sideload mode Change-Id: I65b4ad86456c13a3bbc48880e12ab7a034707b88
* | | adbd: Disable "adb root" by system property (2/3)Steve Kondik2015-10-171-0/+13
|/ / | | | | | | | | | | * Require persist.sys.root_access=1 on non-eng debuggable builds Change-Id: Iedab030e81ffb525fed64aed80cf0014f3e07073
* | adbd: enable USB SuperSpeed (again)Jack Pham2015-10-061-1/+49
|/ | | | | | | | | | | The descriptors to enable USB 3.0 SuperSpeed support had previously been added in commit d6ee9f26a5163af4121f4380264fcbd4e6851a17 but were removed when the v1/v2 descriptor handling was refactored in commits ab3446dd3400652ecf50682d0e5c4184628e9930 and again in c49f51c451516bf06afc6d71947eb11cc4627273. Now that the dust has settled, add back the SS descriptors to re-enable USB 3.0. Change-Id: I8de7c7e50d9216a7492ce7863e3aaf92ff805eff
* fs_config: replace getenv('OUT') by new fs_config parameterThierry Strudel2015-07-091-2/+2
| | | | | | | | | | | | | | Using a getenv('OUT') in such a deep down function is a wrong design choice. Replacing with explicit parameter that may be NULL in case device specific files can be accessed from /. Since TARGET_COPY_OUT_SYSTEM may be defined to something different than system we also ensure that we use a path relative to TARGET_OUT to compute path to fs_config_* files. Bug: 21989305 Bug: 22048934 Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b Signed-off-by: Thierry Strudel <tstrudel@google.com>
* Ignore ro.adb.secure in user builds.Elliott Hughes2015-06-195-11/+11
| | | | | | | | | | Require authorization by default, and remove the ability to override that in user builds. (userdebug and eng are still free to do whatever they want.) Bug: http://b/21862859 Change-Id: Ibf8af375be5bf1141c1ad481eee7a59fb10a7adb (cherry picked from commit 5cba504215ea91187cc36ec7aec5dce1b0f4b0fe)
* adb: win32: fix key files reading/writingSpencer Low2015-06-121-3/+3
| | | | | | | | | | | | | | | | | | 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 9b9603148b0a42ee9b4fc2df76bfde31ba29c311)
* Improve adb install help.Svetoslav2015-06-011-0/+7
| | | | | Bug: 21365060 Change-Id: I0a4ea5cf3a2f37a82161b30f7eec5781d175aa8f
* Document the -g option to adb install.Lorenzo Colitti2015-05-281-2/+3
| | | | Change-Id: I012165df343c24953f1c1cfcdce379bf1b67c624
* Fix ' escaping in adb.Elliott Hughes2015-05-153-8/+29
| | | | | | | | | You can't just use \' inside a single-quoted string. Bug: http://b/20323053 Bug: http://b/3090932 Change-Id: I73754b097671d02dc11c35052f0534b6dd789e4f (cherry picked from commit 84b0bf22644b35d6b3d3f7dc96311a484c3519b3)
* Failure to find an oem partition should not be a remount failure.Elliott Hughes2015-05-113-31/+20
| | | | | | | | | | | | Many devices don't have an /oem partition, so find_mount should be expected to fail, but shouldn't cause the overall remount to fail. Also clean up all the error handling and reporting, and remove the dead int* globals. Bug: http://b/21024141 Change-Id: Ie31021b03c9cab8e972269d7d1ffe383cd30ee9e (cherry picked from commit 9aa4fda4e64c1882faf019cc2a483ee4917e0c85)
* Fix "adb remount" for devices without an oem partition.Elliott Hughes2015-05-082-53/+37
| | | | | | | | | | | | | | | | On a device without an oem partition, we now have an /oem directory anyway. This causes find_mount to fail, and that was returning nullptr from a std::string-returning function. Boom! Also clean up the bits of code I had to trace through between "adb remount" on the host to the crash on the device as I debugged this. The only other meaningful change is the error checking in adb_connect_command --- adb_connect can also return -2. Bug: http://b/20916855 Change-Id: I4c3b7858e13f3a3a8bbc7d30b3c0ee470bead587 (cherry picked from commit 5677c23e8d0c085be8d8429a5d125147d11e9bb2)
* Merge "Be tolerant of devices that don't report serials." into mnc-devBenson Leung2015-05-082-28/+30
|\
| * Be tolerant of devices that don't report serials.Dan Albert2015-05-072-28/+30
| | | | | | | | | | | | | | | | The USB spec explicitly says this is optional, so we shouldn't be relying on it. Bug: http://b/20883914 Change-Id: Icf38405b00275199bcf51a70c47d428ae7264f2b
* | Try to include the SHA in a ddmslib-compatible way.Elliott Hughes2015-05-081-2/+2
|/ | | | | | Bug: http://b/20918202 Change-Id: I0c1a48459372b0d28aaf9d09d82540e44b438c9c (cherry picked from commit f3bbfa6a216669c4cd91d5f936662e89e0ae07ca)
* Include the git sha in the adb version.Dan Albert2015-05-063-21/+34
| | | | | | | Also add --version to adbd to display the same thing. Change-Id: I47dfbad16c892c42ea938aedd085ba77492791ba (cherry picked from commit 1ba1d7c1ee644967ff4743b0d257290cbeca7a83)
* Implement the ssh(1) escaping rules.Elliott Hughes2015-05-052-70/+50
| | | | | | | | | | | | | | | The first rule of ssh(1) escaping is that there is no escaping. This doesn't undo any of my recent security fixes because they're all calling escape_arg themselves. This fixes "adb shell rm /data/dalvik-cache/arm/*". Also remove do_cmd which caused concern during code review. Bug: http://b/20564385 Change-Id: I4588fd949d51e2a50cff47ea171ed2d75f402d0d (cherry picked from commit 2b10111d25adcfe3627103b73edad22f188c97ba)
* Add WriteFdFmt and clean up more code.Elliott Hughes2015-05-0114-158/+110
| | | | | | | | Also say *which* device wasn't found. Bug: http://b/20666660 Change-Id: I50e234ad89e39ae0a8995083c0b642c61275c5a3 (cherry picked from commit ab52c181fa4c1c9891644635dc5653cda5b90e2b)
* More adb buffer fixes.Elliott Hughes2015-05-0122-599/+306
| | | | | | | | | | | | | | This patch factors out a lot of the basic protocol code: sending OKAY, sending FAIL, and sending a length-prefixed string. ADB_TRACE has been non-optional for a long time, so let's just remove the #ifs. Also actually build the device tracker test tool (and remove its duplicate). Bug: http://b/20666660 Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6 (cherry picked from commit e67f1f87d9b1188ec8617035db7006c37ee7b21e)
* More fixed-length buffer removal.Elliott Hughes2015-04-306-272/+153
| | | | | | Bug: http://b/20666660 Change-Id: I0c738e9fed2defed48a9cf2d0a4f7b99c08dcf3d (cherry picked from commit 6452a89aa8934231e12ab77e0d90f12c3e892ad1)
* Add missing 'else' to fix all devices showing up as "host".Elliott Hughes2015-04-291-2/+3
| | | | | | Bug: http://b/20705355 Change-Id: I4f7830278f0c2bc87d95d148d85455b8da894645 (cherry picked from commit 3ce9575af76fa6dc110506080434303b9459abf4)
* Fix Win32 build.Elliott Hughes2015-04-291-1/+1
| | | | | | (cherry-pick of 1b600a902cc0b3a6065c962293292a5ac689fafe.) Change-Id: Icf2c8df99b4b88bbf85a4097731733c5795fba44
* Move __adb_error to std::string, and improve various errors.Elliott Hughes2015-04-294-179/+185
| | | | | | | | | | Also remove an sprintf. Also fix various bits of code that were reporting stale adb_error values when they meant strerror. (cherry-pick of 078f0fcf4c63b8d8e8c10a18855eae04ca321e06.) Bug: http://b/20666660 Change-Id: Ibeb48b7bc21bb0ec30ba47889d1d671ee480e1b7
* Remove strtok from adb.Elliott Hughes2015-04-284-189/+57
| | | | | | | | Also fix android::base::Split to behave like Java, Python, and google3. (cherry picked from commit 8d5fa6da44d56511b3e173bc463cbc65ff221b4a) Change-Id: I9388ae37ee8dd4a4a6c2a9a19f068b70d9a78353
* Support the full length of USB serial numbers.Elliott Hughes2015-04-273-89/+45
| | | | | | | | | | | | Two bugs: we couldn't report the serial number correctly if it was long enough, and it wasn't possible to connect to a device whose serial number was long enough to overflow a different fixed-length buffer. Bug: http://b/20317730 (cherry picked from commit 9309ecbcec428edfcb487ef697862bce59a1aed5) Change-Id: I04c160a215418a57bd4fb27b7f63060c8be6f12e
* Improve logging of USBDEVFS_CLAIMINTERFACE failures.Elliott Hughes2015-04-251-24/+20
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=170054 Change-Id: I9b11eb019093e3322da0a8e70d6e17de4c25ab75
* Merge "Add missing null checks after allocations."Elliott Hughes2015-04-226-10/+26
|\
| * Add missing null checks after allocations.Elliott Hughes2015-04-216-10/+26
| | | | | | | | | | Bug: http://b/20317729 Change-Id: I62bb761d48ee59a1f4ddd0cdd0632432305ca2ca
* | Plumb more of the error reporting through.Elliott Hughes2015-04-211-7/+4
|/ | | | | | | | | This doesn't fix the bug, but it does flatten the bug to the well-known and long-standing "adb shell" doesn't return exit statuses, so when we fix that, this one will fix itself. Bug: http://b/20423886 Change-Id: I48351e46f05dd3f2f6e57f0df1d851333458d0ef
* Add a couple more adb shell regression tests.Elliott Hughes2015-04-211-0/+4
| | | | | Bug: http://b/15479704 Change-Id: Id3e7f0df101ad61db509df313c13210a8bd8b124