Commit graph

563 commits

Author SHA1 Message Date
Elliott Hughes
0e71e3ab9c am 9cae50b3: Merge "Bound the ADB connect time with a non-blocking connect"
* commit '9cae50b38d6a58efe0799ef3697f594cb4b100f9':
  Bound the ADB connect time with a non-blocking connect
2014-05-19 23:22:21 +00:00
Ken Lierman
aecc6a6657 Bound the ADB connect time with a non-blocking connect
After a disconnect, the initial blocking connect takes
a long time to return, while subsequent calls return
quicks.  Switch to a non-blocking connect to make the
re-connect time more consistent and faster overall.

Change-Id: I21d02b22a8eb9a457c2f1fa95eb17894d5612ccd
Signed-off-by: Ken Lierman <ken.lierman@windriver.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
2014-05-19 16:16:42 -07:00
Kenny Root
c563c38d06 am 905874ab: Merge "adb: avoid compilation errors for unused results"
* commit '905874abe45279d7c668e590d404880dd91b1869':
  adb: avoid compilation errors for unused results
2014-05-13 16:21:12 +00:00
Kenny Root
1bd41b1399 adb: avoid compilation errors for unused results
The BIO_CTRL_FLUSH function for files doesn't return anything useful
from the underlying fflush call, so it is safe to ignore this.

Change-Id: If33a7efbbaaf158e3da1cd72d0a56da1d3b82fd9
2014-05-13 09:12:54 -07:00
Mark Salyzyn
328746da80 am 129e9dad: Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb
* commit '129e9dada707d66eb3242b666b6187a031dc410a':
  adb: turn on -Werror
  netcfg: turn on -Werror
  mkbootimg: turn on -Werror
  gpttool: turn on -Werror
2014-05-07 23:12:57 +00:00
Mark Salyzyn
129e9dada7 Merge changes Idfd1a114,If725a1cb,I61211165,If9a05ccb
* changes:
  adb: turn on -Werror
  netcfg: turn on -Werror
  mkbootimg: turn on -Werror
  gpttool: turn on -Werror
2014-05-07 23:10:40 +00:00
Ying Wang
1e6cd741fd am 803fb62b: Merge "Remove unused LOCAL_LDLIBS."
* commit '803fb62bb49b551afff546b4748d2d3e9ec54af1':
  Remove unused LOCAL_LDLIBS.
2014-05-07 22:54:26 +00:00
Ying Wang
9f437d7181 Remove unused LOCAL_LDLIBS.
Change-Id: I42aeb7668183e7a06207ee063f6eee4d37d66c6e
2014-05-07 15:36:05 -07:00
Mark Salyzyn
60299dfd6a adb: turn on -Werror
- Deal with some -Wunused issues

Change-Id: Idfd1a114e68ae637978b52fde5144d0dca0ec79f
2014-05-05 10:30:06 -07:00
Bill Yi
1333e012ee Merge commit '4102af05a86aae36d2560fd8b3f740a52399342c' into HEAD 2014-04-29 16:07:40 -07:00
DanielMo
76b526a2ca adb: Add USB vendor ID for Prestigio
Change-Id: Ib9e79043961b9b1fa27d87f5bc815000e7965706
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-04-16 12:15:21 +08:00
DanielMo
2b6612ff96 adb: Add USB vendor ID for Intermec Technologies Corp.
Change-Id: I6429bca087523829a13f905ae9dfa5f43b7abf8b
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-03-26 15:33:23 +08:00
JP Abgrall
5a5ab405cd am 4db6ce8e: Merge "Adding documentation on the sync part of the adb protocol previously missing."
* commit '4db6ce8e353458de751394102084bb3a304a7ff6':
  Adding documentation on the sync part of the adb protocol previously missing.
2014-03-20 22:12:43 +00:00
JP Abgrall
4db6ce8e35 Merge "Adding documentation on the sync part of the adb protocol previously missing." 2014-03-20 21:25:42 +00:00
Samuel Carlsson
912d5dddf8 Adding documentation on the sync part of the adb protocol previously missing.
In the SERVICES.TXT a missing documentation file is mentioned - SYNC.TXT. This file is supposed to contain all the godie bits of the adb protocol for pushing and pulling files. I've read the source code and documented this in the file SYNC.TXT. I've used my own documentation to create a java implementation to verify the documentation here: https://github.com/vidstige/jadb

Added line breaks at 78 characters. Added comments about remote files might be deleted.

Change-Id: I48c87c2a9fb5b59b85c72679124dfbbfa9a701bc
Signed-off-by: Samuel Carlsson <samuel.carlsson@gmail.com>
2014-03-20 20:36:46 +01:00
David 'Digit' Turner
7cb1504e8a am ee223d50: Merge "adb: Increase the max number of emulator instances to 64"
* commit 'ee223d50a009af39be577c30cc35257c751f05a1':
  adb: Increase the max number of emulator instances to 64
2014-03-14 20:34:26 +00:00
JP Abgrall
648f4113bc am 5fb1a34a: Merge "Added transfer progress reporting for push and pull commands."
* commit '5fb1a34af4128bfe7332b02e31b146a82bc2872d':
  Added transfer progress reporting for push and pull commands.
2014-03-13 15:54:17 +00:00
David 'Digit' Turner
094fd86b14 adb: Increase the max number of emulator instances to 64
When the ADB server starts, it probes the localhost ports to find
existing emulator instances, starting from 5555 with increments of
2, and stopping after ADB_LOCAL_TRANSPORT_MAX tries, which was
set to 16.

This means that the ADB server could not detect on startup more
than 16 existing emulator instances.

This increases the limit to 64, to match a corresponding change
on the emulator side.

  See https://android-review.googlesource.com/#/c/83553/

Change-Id: I35c69f8017298c3e5797bd396b8d788d44eaa00f
2014-03-13 11:21:58 +01:00
Mark Lindner
76f2a93b18 Added transfer progress reporting for push and pull commands.
Added a new '-p' switch to the 'push' and 'pull' commands that outputs
the file transfer progress (bytes transmitted, total bytes, and % done).
This provides useful feedback when transferring large files, and also
makes it possible for other tools to easily monitor the progress of a
forked push/pull command.

Change-Id: Iee6f42f5bd41292e5bc80fba779f526f0072e356
2014-03-11 19:31:26 -07:00
JP Abgrall
66146c40f7 am 44390474: Merge "adb: Don\'t unlink special files on sync failure."
* commit '443904746301e4d519e51075487ea4c8b9a860e3':
  adb: Don't unlink special files on sync failure.
2014-03-11 18:51:48 +00:00
JP Abgrall
8a00ce939a am b2c34ece: Merge "adb: Don\'t clobber block devices during push"
* commit 'b2c34ece647c212baa30c474394c498a2d6dd61f':
  adb: Don't clobber block devices during push
2014-03-11 18:51:48 +00:00
JP Abgrall
40b735f9b9 am 1367854a: Merge "adb: fix windows build after "forward --list" fix."
* commit '1367854a891090d1be1edfb12515691b20b350cf':
  adb: fix windows build after "forward --list" fix.
2014-03-11 18:42:20 +00:00
JP Abgrall
a4a9e64668 am 66e95d76: Merge "Fix adb forward --list when forwarding a lot"
* commit '66e95d76c47a3a099931bbebe7f4a0af4d3f7fbb':
  Fix adb forward --list when forwarding a lot
2014-03-11 18:42:18 +00:00
JP Abgrall
55b6c843a6 adb: Don't unlink special files on sync failure.
adb push some_disk_image /dev/block/mmcblk0p9
should not unlink the dev just because adb was ctrl-c'd.

Change-Id: I1b6669e8dba1f80fc1438b8deb618180b7e9a1b2
Signed-off-by: JP Abgrall <jpa@google.com>
2014-03-07 17:31:25 -08:00
JP Abgrall
4ce2f838e7 adb: Don't clobber block devices during push
In the past, an adb push would ALWAYS unlink the target path.
Now, we only links and regular files (and links).
This allows the following to work:

   adb shell ls -l /dev/block/mmcblk0p8
     # brw------- root     root     179,   8 2013-11-28 07:43 mmcblk0p8
   adb push n7.jpa.mda.post_jb_encryption.raw  /dev/block/mmcblk0p8

Bug: 11984121
Change-Id: I982c7a1cd87986621f2bebdcb41c4e281f67f772
2014-03-07 17:29:39 -08:00
JP Abgrall
5b0bb4898c adb: fix windows build after "forward --list" fix.
EWOULDBLOCK is not there on windows.
It gets translated by the adb_write() wrapper into EGAIN.
But the Linux one does not translate EWOULDBLOCK into EGAIN.
Without EWOULDBLOCK, it works just fine.

Change-Id: Ic293be392aa4364637428ea94ef87890ffa09b9b
Signed-off-by: JP Abgrall <jpa@google.com>
2014-03-06 19:40:45 -08:00
Nick Kralevich
6e94c5764b am 2e7347d6: Merge "Convert all selinux_android_restorecon and _setfilecon calls to new API."
* commit '2e7347d617b02b13d227bb4cecf6bd69b7b20fa9':
  Convert all selinux_android_restorecon and _setfilecon calls to new API.
2014-03-07 02:29:38 +00:00
Nick Kralevich
3530b9cd46 am 02916aa2: Remove obsolete vdc call.
* commit '02916aa20e3ffbe4b738bb12dc1607a7ec6a8c37':
  Remove obsolete vdc call.
2014-03-04 08:23:06 +00:00
Nick Kralevich
02916aa20e Remove obsolete vdc call.
Since ca8e66a8b0, init has
been handling reboots and filesystem unmounts. Remove obsolete
call to vdc.

Bug: 12504045
Change-Id: If8704ca042cb3a68857743b9973e48c52e7eb881
(cherry picked from commit 225459a5da)
2014-03-04 04:54:00 +00:00
Snild Dolkow
2264e7cfef Fix adb forward --list when forwarding a lot
The list action had some problems with large numbers of forwards:
 * adb_query() limited replies to 1024 B (and the print was useless)
 * the reply header's length could overflow (also in other commands)
 * ...and the client had no way of detecting it
 * writex() didn't retry on EAGAIN ("Resource temporarily unavailable")

This patch makes all "OKAY%04x" replies use a common function which
checks the length and limits it to 0xffff. This means that the client
can easily check for truncated replies.

Before: forward --list starts failing at 15-30 forwards (depending on
device serial and forward spec lengths).

After: no problems with forward --list.

Change-Id: Ie1e82c4d622f5c56e51abb26533ba17d40459914
2014-02-21 14:57:02 +01:00
Stephen Smalley
27a93650c0 Convert all selinux_android_restorecon and _setfilecon calls to new API.
libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-07 09:38:32 -05:00
Mark Salyzyn
d2acdd82e6 Merge changes I70ab37d5,I716f89c0,I34c96adf,I77650923,I35b0d1ee, ...
* changes:
  libsysutils: SocketListener export release
  libsysutils: Add iovec/runOnEachSocket
  liblog: support struct logger_event_v2 format
  liblog: update timestamp on NOTICE file
  libcutils: resolve warning in iosched_policy.c
  liblog: Add const pedantics
  logcat: Add -T flag (-t w/o assumption of -d)
  logcat: Add logcat test suite
  liblog: Add cpu utilization test
  liblog: Add liblog test suite
  debuggerd: Support newline split in log messages
  liblog: deprecate export LOGGER ioctl definitions
  liblog: deprecate export of LOGGER_LOG_* defines
  liblog: Add README
  liblog: resolve build warning messages
  liblog: high CPU usage from logcat
  liblog: fix build again
  liblog: drop use of sys/cdefs.h
  liblog: git_master@964770 build problem
  logcat: Incorporate liblog reading API
  debuggerd: Incorporate liblog reading API
  liblog: Interface to support abstracting log read
  adb: deprecate legacy log service interface
  adb: regression from Move list.c to inlines
  liblog: whitespace cleanup
  libcutils: bug str_parms.c:str_parms_get_float().
  libcutils: UNUSED argument warnings
  libsysutils: Get rid of warnings
  libcutils: Move list.c to inlines on list.h
2014-01-28 21:09:37 +00:00
Benoit Goby
6ddabb7a1c Merge "adbd: Don't close/reopen FFS ep0 on disconnect" 2014-01-28 00:07:15 +00:00
Mark Salyzyn
7aa39a7b19 adb: deprecate legacy log service interface
(cherry picked form commit c66a7537df)

Change-Id: If96019cc13b3d7a4dcd7785c7137e0cbcc622981
2014-01-27 15:09:59 -08:00
Mark Salyzyn
c788278abc adb: regression from Move list.c to inlines
(cherry picked from commit 5f64d528be)

Change-Id: I057dbe3db80b1460f774e9f9ade11e0929529ec6
2014-01-27 15:09:22 -08:00
Nick Kralevich
75e0645921 Fix overflow in adb_client
Credit: Joshua Drake
Bug: 12060953

(cherry picked from commit e89e09dd2b)

Change-Id: I8a9b2592a5e4f7527c607abfe4ea6df6eb550aa8
2014-01-27 14:12:34 -08:00
Nick Kralevich
d49aa2537c adbd: switch to su domain when running as root
When adbd runs as root, it should transition into the
su domain. This is needed to run the adbd and shell
domains in enforcing on userdebug / eng devices without
breaking developer workflows.

Introduce a new device_banner command line option.

Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
2014-01-22 14:20:17 -08:00
Nick Kralevich
72917837e6 Fix "adb push /sdcard/filename"
Don't assume that calling chown(filename, getuid(), getgid())
will always succeed. In the case of /sdcard, a file you create
will be owned by root, so the chown call will fail.

Instead, use uid=gid=-1 so that the chown call is truly a no-op.

Ignore the results of calling chmod. Again, for /sdcard, the
chmod call will never succeed, because the file isn't owned by
the shell user.

Bug: 12441485
Change-Id: I11eaf1d6f6049c1158afc29754fbb7af2baf2c78
2014-01-17 16:16:42 -08:00
Elliott Hughes
ccecf14254 system/core 64-bit cleanup.
This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.

Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
2014-01-16 12:54:18 -08:00
Colin Cross
e76343ef72 Merge "Emerson USB ID" 2014-01-12 07:05:04 +00:00
Jon Sawyer
6e39bace17 Emerson USB ID
Adds Emerson's USB id to the known USB Devices.

Change-Id: If6115c2551c1f30a5c190690f2aeaaf2adff7ee1
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
2014-01-11 22:59:18 -08:00
Jon Sawyer
5ff167ca11 HP USB ID
Adds HP's USB id to the know USB Devices

Change-Id: I975126f3ae5e53f25e18dea7cc43c29076bfc965
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
2014-01-08 08:14:26 -08:00
Jack Pham
4cbf1d8822 adbd: Don't close/reopen FFS ep0 on disconnect
In case of bulk read/write failure or disconnect, transport_usb
calls usb_ffs_kick in order to force the daemon to re-open the
FunctionFS ep files as a way to soft restart the kernel driver.

However, there's no reason to always close the ep0 file, as it
would need to be reopened and the descriptors rewritten--this
is unnecessary, especially in the simple/frequent case of cable
disconnect, and causes the kernel driver to unbind and bind *all*
of the function drivers. This is causing USB Chapter 9 tests to fail.

Thus, try to reuse the same ep0 file handle across reconnects. In
case there is a failure, the ep1/ep2 opens would fail and all the
file handles get dropped. For the adb root case, the entire daemon
gets restarted anyway.

Change-Id: I0840085c52a0795dcb2d751c39aa4a436c039ee2
2014-01-07 15:04:09 -08:00
DanielMo
c1b6b153dc adb: Add USB vendor ID for YotaDevices
Change-Id: Id8bec8a35edd0d21ae52e8469f7a65b5f4433bc2
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:40 -08:00
DanielMo
402c2b9888 adb: Add USB vendor ID for TechFaith
Change-Id: Ied42e4d011b736ee990ed75e7d81bc6a16db47f9
2014-01-06 12:16:40 -08:00
DanielMo
d0057c006b adb: Add USB vendor ID for Rockchip
Change-Id: Iea3f7cc6ed463684fe30a73c39445b3ca36854d9
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
fdd189c64e adb: Add USB vendor ID for EMERGING Technology (Holdings) Ltd.
Change-Id: Ic7f7c984db19050d2ce4da8ae87683ce42dc9094
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
63f0f5117b adb: Add USB vendor ID for Allwinner
Change-Id: Ic77d5f71c9e329e33cd31fa0854e692ad794a609
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
DanielMo
d5dab6d5f8 adb: Add USB vendor ID for Amlogic
Change-Id: I35fad82214f2b5a82b0150821326aaea15784de1
Signed-off-by: DanielMo <DanielMo@fih-foxconn.com>
2014-01-06 12:16:39 -08:00
Volker Moesker
319d8c1d1f added Gigaset's USB vendor ID
Change-Id: Iebb0f352eec4530ee1e972527fc76bbb9dad5cc3
Signed-off-by: Volker Moesker <volker.moesker@gigaset.com>
2014-01-06 12:16:29 -08:00