Commit graph

450 commits

Author SHA1 Message Date
Jean-Baptiste Queru
007b70023b am 2ae9878c: am c5d5a5e8: Merge "Kindle Fire USB ID"
* commit '2ae9878cd5dc517cc7338aaca81f0eb3127b4a53':
  Kindle Fire USB ID
2012-05-02 15:11:08 -07:00
Scott Anderson
76e47e0ec8 am 9526a788: Merge "adb: Add ability to specify device path" into ics-aah
* commit '9526a788a6bd528e14622404e8750bdcc147d15a':
  adb: Add ability to specify device path
2012-05-01 19:33:41 -07:00
Anonymous Coward
4474ac4081 Add encryption parameters to adb install
Change-Id: I92e5f6ace1bc9e711c14cb83533aeb99ab9ab9f7
2012-04-27 13:48:54 -07:00
Scott Anderson
e109d266c1 adb: Add ability to specify device path
For manufacturing and testing, there is a need to talk to
whatever device is connected to a given port on the host.  This
change modifies adb's "-s" option to take either a serial
number or a device path.  The device paths of the connected
devices can be listed using "adb devices -l" whose output
will resemble:

    List of devices attached
    016B75D60A00600D	usb:2-5	device
    3031D0B2E71D00EC	usb:1-4.3	device

The second column lists the device paths.  If the -l option is
not given, the output from "adb devices" will be the same as
it used to be (i.e. the paths will not be printed).

The device path can also be obtained with the get-devpath
command:

    $adb -s 3031D0B2E71D00EC get-devpath
    usb:1-4.3

Note that the format of the device paths are platform dependent.
The example above is from Linux.  On OS-X, the paths will be
"usb:" followed by hex digits.  For other platforms, the device
paths will be printed as "????????????" and the -s option will
not be able to select a device until someone implements the
underlying functionality.

Change-Id: I057d5d9f8c5bb72eddf5b8088aae110763f809d7
Signed-off-by: Scott Anderson <saa@android.com>
2012-04-20 11:21:14 -07:00
Jon Sawyer
775ab9c99e Kindle Fire USB ID
Adds Lab126's USB id to the known USB Devices

Change-Id: I3cd5d90bba68123d5d3d2d67e1ab7d60137eb388
Signed-off-by: Jon Sawyer <jon@cunninglogic.com>
2012-04-15 12:39:59 -07:00
Nick Kralevich
eb68fa8153 adb: set umask to 000
Init is going to be modified to set the umask to 077.
This will impact adb, as "adb install" and "adb sync"
assume that files will be world-readable / writable.

Keep adb's umask at 000 for now.

Bug: 3272072
Change-Id: I75978e8dd7bbdf4dbe7c9a691ef516235f207da2
2012-04-02 14:10:56 -07:00
JP Abgrall
f91259a8f0 adb: fix non-linux builds. tcpip:, root:, usb: are not for ADB_HOST
The handling of adb root:/tpcip:/usb: is normally only for non-ADB_HOST.
This avoids getuid() being invoked on windows builds.

Change-Id: I365b81d9f70de99b9347d3eac82e690a8ac5e747
2012-03-30 13:19:11 -07:00
JP Abgrall
d7f1feb5c8 adb: fix exit of "adb root" when it is a no-op.
"adb root" creates a socket, then starts the service.
Socket creation should not set the exit_on_close when the service will be
a no-op.

Bug: 6259353
Change-Id: Ie526d2fad64f39a48051ed0ff6fb3405c2802ced
2012-03-30 11:19:16 -07:00
Kenny Root
9a7611fefa Merge "Revert "add IP checking for adb over TCP"" 2012-03-28 15:45:16 -07:00
Kenny Root
9a77f55aad Revert "add IP checking for adb over TCP"
This reverts commit dca76e6187
2012-03-28 15:45:08 -07:00
Kenny Root
29dc792bcd Merge "add IP checking for adb over TCP" 2012-03-28 15:15:29 -07:00
Kenny Root
60733e9280 Make sure "adb install" work is cleaned after error
If an error occurs during the verification of an APK, it could be left
in the temporary installation directory.

Change-Id: I4afa5535fc0b978532b31d5b8fb63776963c39db
2012-03-26 16:14:07 -07:00
Benoit Goby
4d668e013b Merge "adb: Don't synchronize with transport using sleep" 2012-03-26 12:56:56 -07:00
Benoit Goby
62e5cbaebc Merge "Revert "Reimplement the "adb root" command to more closely match its previous behavior"" 2012-03-26 12:56:49 -07:00
Andrew Hsieh
8ee361cb01 Remove duplicated VENDOR_ID_INTEL
VENDOR_ID_INTEL defined and appear in builtInVendorIds[] twice.
Remove the 2nd one.

Change-Id: I62f7bba392012aafb8ea9730959362db4bc6c669
2012-03-23 15:28:56 +08:00
Benoit Goby
f366b3698b adb: Don't synchronize with transport using sleep
Services that cause adbd to reboot are currently implemented this way:
    write(fd, response)
    close(fd)
    sleep(1)
    exit(1)
sleep(1) is necessary to leave time for the transport to transmit
the response before the daemon exits. This is slow and unreliable.
Instead, add a flag to the asocket to make it exit the daemon only
after the socket is closed.

Change-Id: I9df45ea6221f0d9b828703b9b2316a5d4fe59352
2012-03-16 15:30:05 -07:00
Benoit Goby
7941cf87f6 Revert "Reimplement the "adb root" command to more closely match its previous behavior"
This reverts commit 535164e9d9.
2012-03-16 15:30:05 -07:00
Benoit Goby
9f1af8cde9 adb: Remove unused flags
BUILD_ADBD is always true

ANDROID_GADGET is not used in the code anymore. adbd now checks at
runtime if /dev/android_adb is present

Change-Id: If6c3278606c79cc74d1ef5978e7b8e3a4513aef8
2012-03-16 15:29:34 -07:00
Wei Zhong
dca76e6187 add IP checking for adb over TCP
whitelist connection for
1) emulator
2) "eng" or "tests" build, or
3) IP matches with "persist.service.adb.client_ip"

Change-Id: I8ac149149873f3bd206bd4d5abc063e5274fb468
Signed-off-by: Wei Zhong <wzhong@google.com>
2012-03-15 14:40:11 -07:00
Dianne Hackborn
50458cf76e Add AID_SDCARD_R.
Change-Id: I47f650e415e06c0b69790ffefea7f208c910ebd7
2012-03-08 14:30:32 -08:00
Vladimir Chtchetkine
28781b0a52 Enables ADBD tracing in the emulator.
When running inside the emulator, guest's adbd can connect to 'adb-debug' qemud
service that can display adb trace messages on condition that emulator has been
started with '-debug adb' option.

This CL enables that functionality in ADB code.

Change-Id: I59b4a76d3c887ad28b8aa8e2a01dfa814e75faa1
2012-02-27 10:41:53 -08:00
Anatol Pomazau
fc656103db Fix 'extra tokens at end of #endif directive' warning
Change-Id: I464ede415e64cf7db845bb441754120974bcf855
2012-02-13 18:12:18 -08:00
Xavier Ducrohet
46f86f11d4 am 0c054095: am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.
* commit '0c05409510037fd7372c3fe7ab240ebf33b15831':
  Add USB vendor IDs for Quanta, INQ and Sony.
2012-01-24 11:32:19 -08:00
Xavier Ducrohet
05025357e6 am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.
* commit '746f3243f6d30ab51a36dcfea76eac3ba29ac625':
  Add USB vendor IDs for Quanta, INQ and Sony.
2012-01-24 11:29:52 -08:00
Xavier Ducrohet
0c05409510 am 746f3243: Add USB vendor IDs for Quanta, INQ and Sony.
* commit '746f3243f6d30ab51a36dcfea76eac3ba29ac625':
  Add USB vendor IDs for Quanta, INQ and Sony.
2012-01-24 11:29:50 -08:00
Xavier Ducrohet
746f3243f6 Add USB vendor IDs for Quanta, INQ and Sony.
Change-Id: I224e067d9a64e8e9e7afbad0760a4b07f965bf83
2012-01-24 11:18:50 -08:00
Jean-Baptiste Queru
38412163da am 70580b20: am 149ae11f: Merge "adb,fastboot: add USB support for Intel Vendor ID"
* commit '70580b20bc8485002df0b3e89e42754c8c9796ff':
  adb,fastboot: add USB support for Intel Vendor ID
2012-01-24 08:49:05 -08:00
Jean-Baptiste Queru
70580b20bc am 149ae11f: Merge "adb,fastboot: add USB support for Intel Vendor ID"
* commit '149ae11fb63818b470156e1652abfad0e08d486d':
  adb,fastboot: add USB support for Intel Vendor ID
2012-01-24 08:42:49 -08:00
Andrew Hsieh
a8748d3b2a am daafb531: am 4779e934: Add Intel\'s vendor ID to adb
* commit 'daafb531484a35a63e229e14d8a81b412e506670':
  Add Intel's vendor ID to adb
2012-01-20 15:52:03 -08:00
Nick Kralevich
5890fe3314 Don't allow adb to run as root in user builds.
Change-Id: I4fbd7beb7f76c68fead1a89b745f0dfb931b4597
2012-01-19 15:06:14 -08:00
Nick Kralevich
bd9206bc73 Move permission checking code to it's own function.
Change-Id: Ibe46ca3043791f3b3815080f9e23ac307b1f5900
2012-01-19 15:02:41 -08:00
Andrew Hsieh
80d50a4c99 am 4779e934: Add Intel\'s vendor ID to adb
* commit '4779e9344bb62208e4772ff6486b6df564f434b8':
  Add Intel's vendor ID to adb
2012-01-19 09:55:28 -08:00
Andrew Hsieh
4779e9344b Add Intel's vendor ID to adb
Change-Id: I81da3ea11bfd44395f6895fe51e477ff1e7fa25b
2012-01-18 14:30:11 -08:00
Wu, Hao
f60e863828 adb,fastboot: add USB support for Intel Vendor ID
This patch adds Intel USB Vendor ID into the support
list for adb and fastboot.

Signed-off-by: Wu, Hao <hao.wu@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
2012-01-17 12:08:06 -08:00
Xavier Ducrohet
a33c6ee92b am e0b55791: am 07ad9f2a: Add USB Vendor ID for Fujitsu and Lumigon.
* commit 'e0b557915123b7ad022ff5d0a7a3d4dd2ee7c2fe':
  Add USB Vendor ID for Fujitsu and Lumigon.
2012-01-11 12:05:16 -08:00
Xavier Ducrohet
95ec1ca903 am 07ad9f2a: Add USB Vendor ID for Fujitsu and Lumigon.
* commit '07ad9f2a127b2836c7d45a503a5f3ef7517218f3':
  Add USB Vendor ID for Fujitsu and Lumigon.
2012-01-11 12:03:32 -08:00
Xavier Ducrohet
07ad9f2a12 Add USB Vendor ID for Fujitsu and Lumigon.
Change-Id: Icd013b362366815527834cbf54aa4ecac2b7750d
2012-01-11 11:55:45 -08:00
Vladimir Chtchetkine
b125671921 am ae429828: Cherry-picked from c4f37eed7 in master. Do not merge.
* commit 'ae4298286896cbef22b2af285a3f651e8f498185':
  Cherry-picked from c4f37eed7 in master. Do not merge.
2012-01-10 16:28:43 -08:00
Vladimir Chtchetkine
9f55988343 am 74159657: Cherry-picked from c13daef7b on master. Do not merge.
* commit '74159657687aadab4c82e4fd7e7a54d16c045d95':
  Cherry-picked from c13daef7b on master. Do not merge.
2012-01-10 16:19:42 -08:00
Vladimir Chtchetkine
ae42982868 Cherry-picked from c4f37eed7 in master. Do not merge.
Fix the build.

Conditionally compile code that is intended to run inside the emulator only.

Change-Id: Ie82e415b2ff52395616f85871dddb38e65b0ed55
2012-01-10 16:19:09 -08:00
Vladimir Chtchetkine
7415965768 Cherry-picked from c13daef7b on master. Do not merge.
Use QEMU pipe for ADB communication when running in emulator.

Change-Id: I7934b6272c2a9825d244ce76ff65dbce6e54ebff
2012-01-10 16:03:17 -08:00
Doug Zongker
447f061da1 add "adb sideload" and sideload connection state
Recovery will soon support a minimal implementation of adbd which will
do nothing but accept downloads from the "adb sideload" command and
install them.  This is the client side command (mostly resurrected out
of the old circa-2007 "adb recover" command) and the new connection
state.

Change-Id: I4f67b63f1b3b38d28c285d1278d46782679762a2
2012-01-10 10:09:07 -08:00
Christopher Tate
bffa4ca9ad Tell the user to unlock/confirm backup & restore operations
People are being confused about the silent failure of backup/restore
when they didn't know they had to unlock the device & confirm the
backup/restore operation, so now adb prints a brief reminder.

Change-Id: I1b32913f0ad0cf6e30bf235dc975b9e983b533fd
2012-01-06 15:43:03 -08:00
Vladimir Chtchetkine
c4f37eed73 Fix the build.
Conditionally compile code that is intended to run inside the emulator only.

Change-Id: Ie82e415b2ff52395616f85871dddb38e65b0ed55
2011-12-13 12:19:29 -08:00
Vladimir Chtchetkine
c13daef7bd Use QEMU pipe for ADB communication when running in emulator.
Change-Id: I7934b6272c2a9825d244ce76ff65dbce6e54ebff
2011-12-13 08:19:15 -08:00
Christopher Tate
1f4bada667 am 650307df: am b1dfffe6: Fix \'adb backup\' on Windows
* commit '650307df33fc834c251df71c78b00cc0ae6529b7':
  Fix 'adb backup' on Windows
2011-12-12 15:39:07 -08:00
Christopher Tate
1131c1644f am b1dfffe6: Fix \'adb backup\' on Windows
* commit 'b1dfffe6bb506313a3bc9146d2f6f8c533213193':
  Fix 'adb backup' on Windows
2011-12-09 16:55:38 -08:00
Christopher Tate
b1dfffe6bb Fix 'adb backup' on Windows
Use the same call sequence that 'adb pull' uses for creating the
output file.  adb_open_mode() apparently does not work on Windows
hosts.

Bug 5733007

Change-Id: I48d719c4657c93e19f6790cf1c6da610d49f5806
2011-12-09 15:29:30 -08:00
Joe Onorato
ae868a4045 Allow adb to listen both on usb and tcp.
Change-Id: I98db594241631fa17e39686727392afc8b3124bc
2011-12-07 17:50:28 -08:00
Christopher Tate
c6b07d94fa Merge "Tweak logcat parameters" 2011-12-07 16:02:37 -08:00
Christopher Tate
db0a880c46 Tweak logcat parameters
Change-Id: If97ee1eb682d95fa05b5e2003a204a628bd6ae4d
2011-12-07 16:01:59 -08:00
Vladimir Chtchetkine
ce48083fc9 Fixes ADB crash on Windows due to large number of connections. do not merge.
The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.

(cherry picked from commit ac52833e48)

Change-Id: I8ad264765e5b38d01a31e42b445f97ea86e49948
2011-12-05 13:14:23 -08:00
Vladimir Chtchetkine
ac52833e48 Fixes ADB crash on Windows due to large number of connections.
The reason for the crash is that ADB on Windows uses WaitForMultipleObjects to
wait on connection events. When number of connections exceeds 64, ADB crashes,
because WaitForMultipleObjects API doesn't support more than 64 handles. This
CL contains a fixer routine that allows waiting on an arbitrary number of
handles.

Change-Id: I83f712e552018df308318154c27df184015a16ee
2011-12-01 08:47:35 -08:00
JP Abgrall
61b90bd211 adb: grant it AID_NET_BW_STATS for full /proc/net/xt_qtaguid/stats
Normally only bandwidth stats for the uid reading .../stats is returned.
With the extra group, adb shell will be able to read stats from
all UIDs.
This is to be used to offer data usage profiling to developers.

Change-Id: If3d2941ce5aa4dbb1a23947b97b893149ba224f7
2011-11-09 10:30:08 -08:00
Christopher Tate
56885094b6 Add command line help for the new 'adb backup -all -nosystem'
Documentation-only change that supports the new framework-side
feature to omit system packages when you're using adb backup -all.
Bug 5361503.

Change-Id: I86bca8883a7fb8c713ca352ad5980e92fd640d18
2011-10-03 18:27:01 -07:00
Kenny Root
a031a91b95 Skip argument when parsing adb install
A command line flag with an argument was checked in the Pm.java code,
but it wasn't being checked by "adb install" so attempts to use it
failed.

Change-Id: I0b84a4203a416f7323fa823c0f1f1750670d0c76
2011-09-23 13:36:00 -07:00
Xavier Ducrohet
dd52e8c57b Add Positivo's vendor ID to adb.
Change-Id: Ida6fc323d766249f4f12708bae1c50ae5d937b2c
2011-09-16 13:48:50 -07:00
Mike Lockwood
aa61854645 adb: Add USB vendor IDs for K-Touch, Pegatron and Archos
Change-Id: Idbc212abfb7d4d0a53e6b8ecd55134b81f4e960d
Bug: 5182028
Bug: 5157478

Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-09-13 13:20:12 -04:00
Christopher Tate
bb86bc5892 Fix 'adb backup' command line validation
The host side wasn't properly checking for argument-list sufficiency
*after* removing any [-f filename] sequence.

Fixes bug 5164135

Change-Id: I7bc49e37ef168182088e0e664b6897dd2a088ebf
2011-08-22 17:12:08 -07:00
Kenny Root
75ae424629 Merge "Add install arg for verification" 2011-08-16 08:36:17 -07:00
Mike Lockwood
22268c720b am 549bfcda: am 003771d1: am 80d508fd: Merge "correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)"
* commit '549bfcda6df30dd00db254b3717fc8df463ce710':
  correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)
2011-08-15 10:29:03 -07:00
Mike Lockwood
549bfcda6d am 003771d1: am 80d508fd: Merge "correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)"
* commit '003771d1c0ad6c3c6cd0c82f787636111c9e193c':
  correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)
2011-08-15 10:25:47 -07:00
zhangclb
c11f99f40a correct VID of Lenovo(0x2006 is for LenovoMobile,0x17EF is for Lenovo)
Change-Id: I3466fdf7b03cf5da189efe4efb563d09f14b467a
2011-08-15 14:18:02 +08:00
Christopher Tate
de034ec83e Change default backup filename and terminology
We now use "backup.ab" as the default backup archive filename, and no longer
refer to "tar" or "tarfiles" in the help text.  The underlying format may
be tar, but we're certainly not interoperable even with ustar/pax thanks
to our compression & encryption layers and our custom header.

Change-Id: I3e74af96cfc102e94848c969eb36af54304bfd9b
2011-08-09 17:05:29 -07:00
Kenny Root
597ea5b63f Add install arg for verification
Allow "adb install" to transfer the file for the verification argument
to the package manager "pm install" command.

Change-Id: I4834f45019eb1387a5d2b205b53a67e91d5fa67e
2011-08-06 13:19:56 -07:00
Kenny Root
9ff99f6536 Merge "Default to secure mode" 2011-08-05 10:16:21 -07:00
Kenny Root
ff9d3484e6 Default to secure mode
If ro.secure is not set for some reason, default to secure mode.

Change-Id: Id0ce3ea5507a3f9690332fb5a2daef7d3303481d
2011-07-31 09:15:46 -07:00
Nick Kralevich
514b40bafa am 189de0c1: am adabe566: am 810cf41b: Merge "Fixed memory leak when using transport:serial."
* commit '189de0c1f4339abd7b938b4905775163d2a94bbe':
  Fixed memory leak when using transport:serial.
2011-07-29 16:51:35 -07:00
Nick Kralevich
189de0c1f4 am adabe566: am 810cf41b: Merge "Fixed memory leak when using transport:serial."
* commit 'adabe566906aa5e8ce791327559aeb10c139b365':
  Fixed memory leak when using transport:serial.
2011-07-29 16:47:31 -07:00
Nick Kralevich
810cf41b6d Merge "Fixed memory leak when using transport:serial." 2011-07-29 16:32:21 -07:00
Tom Marlin
3175c8e9bf Fixed memory leak when using transport:serial.
Fixed memory leak when using transport:serial. Code was previously
using strdup() to make a copy of the serial number which was not
necessary. Instead, just set serial=service.

Change-Id: Ifa8fe7999c6fb88955d2c6bdfcd3cd724ec1f020
Signed-off-by: Tom Marlin <tomm@bsquare.com>
2011-07-29 13:38:56 -05:00
Mike Lockwood
ea839db289 am b1cfa672: am 7d39463e: am d1015de9: Merge "adb: Add USB vendor ID for Vizio"
* commit 'b1cfa672014d197d6d4d12fca0d40cd59de436bc':
  adb: Add USB vendor ID for Vizio
2011-07-29 06:22:44 -07:00
Mike Lockwood
b1cfa67201 am 7d39463e: am d1015de9: Merge "adb: Add USB vendor ID for Vizio"
* commit '7d39463eff2a9002208f34f1d2ce4d62546f6c3a':
  adb: Add USB vendor ID for Vizio
2011-07-29 06:20:10 -07:00
Mike Lockwood
fb34e98bdd adb: Add USB vendor ID for Vizio
Change-Id: I280ff83d7f1fda1ed811bd42cb6fd65036525559
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-29 08:59:43 -04:00
Mike Lockwood
b32904a9ea am 01acea11: am 1f72fe99: am 7df080b2: am 3ddaa0ad: Merge "adb: Add USB vendor ID for Lenovo"
* commit '01acea112501f7d140f100591319781e59b90d0e':
  adb: Add USB vendor ID for Lenovo
2011-07-18 09:23:23 -07:00
Mike Lockwood
01acea1125 am 1f72fe99: am 7df080b2: am 3ddaa0ad: Merge "adb: Add USB vendor ID for Lenovo"
* commit '1f72fe991dc2e48c13518015c523f9e3ea048af2':
  adb: Add USB vendor ID for Lenovo
2011-07-18 09:18:58 -07:00
Jean-Baptiste Queru
7076831c7d am f75a2ed2: Merge from gingerbread-plus-aosp
* commit 'f75a2ed2138cd8b74597bd57e13d12e1f0b815c2':
  adb: Add vendor IDs for iRiver, Compal and T & A Mobile Phones
  Add Gigabyte's USB vendor ID to adb.
  Add Funai's USB vendor ID to adb.
2011-07-14 10:49:22 -07:00
Mike Lockwood
7c17d0932c adb: Add USB vendor ID for Lenovo
Change-Id: I1c2423f567272493067fae04e64fdcb651b0af62
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-14 09:00:33 -04:00
Jean-Baptiste Queru
f75a2ed213 Merge from gingerbread-plus-aosp
Change-Id: I55b84eda30edf0eade8b43712ab011cd3f65f0d9
2011-07-12 14:41:38 -07:00
Jeff Brown
29e1e7393d Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I2fcf31af681d92880e5d31a46d5f6777f7ca1977
2011-07-11 22:12:32 -07:00
Mike Lockwood
292e86230e adb: Add vendor IDs for iRiver, Compal and T & A Mobile Phones
Change-Id: I4dafc43aa76049dd0075e1d70ba05d899e545c8d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-11 09:39:39 -04:00
Joe Bass
7a5c1463ba Add Gigabyte's USB vendor ID to adb.
Bug #4452872

Change-Id: Ib97548d121d40e96ccc519323a335fc90f3b32b9
2011-07-11 09:39:02 -04:00
Xavier Ducrohet
cbe19cec61 Add Funai's USB vendor ID to adb.
Change-Id: Idc2974d4437ab1c79cfea5aade98b599a877aad3
2011-07-11 09:37:43 -04:00
Mike Lockwood
535164e9d9 Reimplement the "adb root" command to more closely match its previous behavior
The adb gadget driver used to reset the USB bus when the adbd daemon exited,
and the host side adb relied on this behavior to force it to reconnect
with the new adbd instance after init relaunches it.  The new gadget
drivers no longer automatically reset the USB bus when adbd is restarted
which caused adb to hang since it was no longer forced to reconnect with the
device.  We attempted to work around this on the host side adb, but that
work around has not been reliable.

This change adds a property trigger on the service.adb.root system property
which will reset the USB bus and restart the adbd daemon when adbd sets
the property to 1.  This should be much closer to the previous behavior
and will hopefully fix some problems with automated testing.

Change-Id: I177c37400009a3d83f21a5f9431f94fd1cc19b9b
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-22 08:36:53 -04:00
Mike Lockwood
07edefe4ce Revert "adb: kick the transport after sending the "adb root" command"
This reverts commit d15e6ac95d.

Also increment adb version to 1.0.29

Change-Id: I890643f0c18a2fe90f170134df039c54116cecda
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-22 07:15:44 -04:00
Mike Lockwood
693e78b9b6 Merge "Fix hang after end of backup" 2011-06-21 16:44:32 -07:00
Christopher Tate
10f129ca8e Fix hang after end of backup
The buggy behavior was that the 'adb backup ....' host command line
invocation would hang forever, even after the backup finished and
the forked device-side subprocess had been reaped.  The reason for
this is that the device adbd end of the socketpair used to send
the data back from the forked subprocess was still stuck readable
even after the remote end of it had been closed.

With this patch, the thread whose job it is to waitpid() in order
to harvest the forked child process also closes the local (adbd)
end of the socketpair.  This makes the fdevent logic notice that
the socket is dead, at which point it cleans up everything including
the communication back to the host.

Change-Id: I90e7e4e5db36c5a6f7363708b29a6d2c56d1250e
2011-06-21 16:05:17 -07:00
Mike Lockwood
b0bd6024e3 adb: Update version to 1.0.28
Change-Id: Ib8a98d3840abf24cf062112aca7ce462a0f44bc5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-21 17:26:11 -04:00
Christopher Tate
5b811fa5dd Tidy up the end-of-data handling in backup
* Increase transfer buffer size to 32K
* Add logging about error conditions and fd teardown
* Pass the fd number as a command line option to the 'bu' subprocess
* Properly harvest the 'bu' subprocess after it's done

Change-Id: Id44dde25778ecf43c5604fd9d01d726ba58861e5
2011-06-20 16:19:42 -07:00
Kenny Root
b0a8aae3ed Use adb_sleep_ms for Cygwin compat
Change-Id: Iabb2cddfb6740a35e4b6b1563a81b64972c29453
2011-06-15 20:03:49 -07:00
Mike Lockwood
d15e6ac95d adb: kick the transport after sending the "adb root" command
This is needed because the USB driver on the device no longer resets the bus
when exits and restarts.
Since the host side adb no longer detects that adbd has restarted we need
to reset the connection on the host side now.

Change-Id: I1a8eabd292e8b45c34fa07a8a8b8c609cc15648d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-06-12 16:09:27 -04:00
Nick Kralevich
37b9fc6e7c am 4ba5a8ac: am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"
* commit '4ba5a8acba033127befd184f2f78cf0580995b07':
  Fixed adb crash due to accessing freed memory
2011-06-09 11:27:11 -07:00
Nick Kralevich
4ba5a8acba am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"
* commit 'eafcbe109f97e5a687cc944e65c383fa45d71c8f':
  Fixed adb crash due to accessing freed memory
2011-06-07 16:28:09 -07:00
Tom Marlin
49f1857dd8 Fixed adb crash due to accessing freed memory
Reset peers to NULL after closing them down. This prevents
other code from attempting to access that freed memory
(which prevents crashes). Previously, it left pointers to
freed memory and the "if (s->peer)" guards could not block
the attempt to access that memory later. Resolves many
crashes seen while taking repeated screenshots on WinXP.

Change-Id: I32553f4d19f6ddc9b05b6ab4dc1e9efe69e5be4f
2011-06-03 11:29:17 -05:00
Christopher Tate
c9cd3b9761 Make 'adb backup' -f handling more bulletproof and more flexible
* "adb backup" as the entire command line no longer crashes

* The "-f filename" option can now appear anywhere in the command line.
  A trailing "-f" at EOL prompts an error message and usage summary.

Change-Id: I040ed73c2ca3687e265e35600eb3ab2b3c879695
2011-06-01 17:56:23 -07:00
Joe Bass
2bc503e6a9 am 0efe2f2f: am b27c682e: am f5144d34: Add Gigabyte\'s USB vendor ID to adb.
* commit '0efe2f2f11d79060962f35a3fb4db525d3f12e9e':
  Add Gigabyte's USB vendor ID to adb.
2011-05-21 21:35:49 -07:00
Joe Bass
0efe2f2f11 am b27c682e: am f5144d34: Add Gigabyte\'s USB vendor ID to adb.
* commit 'b27c682e28a01b18f7506a9b35222453058107ad':
  Add Gigabyte's USB vendor ID to adb.
2011-05-20 16:14:13 -07:00
Christopher Tate
5526ee0831 Merge "Add 'adb restore' to parallel 'adb backup'" 2011-05-20 15:36:55 -07:00
Joe Bass
f5144d34fa Add Gigabyte's USB vendor ID to adb.
Bug #4452872

Change-Id: Ib97548d121d40e96ccc519323a335fc90f3b32b9
2011-05-19 11:40:23 -07:00
Xavier Ducrohet
aff5d7870e am 44c336bf: am 830fc9af: am 30d916c3: Add Funai\'s USB vendor ID to adb.
* commit '44c336bfe9bbd400461b9b28a449a67145eaeeb8':
  Add Funai's USB vendor ID to adb.
2011-05-19 08:57:55 -07:00
Xavier Ducrohet
44c336bfe9 am 830fc9af: am 30d916c3: Add Funai\'s USB vendor ID to adb.
* commit '830fc9afbe3e83b3b39278d67a9680bb2068098a':
  Add Funai's USB vendor ID to adb.
2011-05-18 17:41:21 -07:00
Xavier Ducrohet
30d916c360 Add Funai's USB vendor ID to adb.
Change-Id: Idc2974d4437ab1c79cfea5aade98b599a877aad3
2011-05-18 16:57:26 -07:00
Christopher Tate
702967afb1 Add 'adb restore' to parallel 'adb backup'
It won't actually do anything until the 'bu' tool and framework are
updated to respond properly, but this is the adb side of the
necessary infrastructure: we copy the tarfile into the socket pointed
at the device, using the existing mechanisms.

Change-Id: Ic3b5779ade256bd1ad989a94b0685f7b1a7d59d2
2011-05-17 15:52:54 -07:00
Christopher Tate
024447c3c3 Use the new 'bu' syntax for backup vs restore operation
Change-Id: Ib007705ee562a41869f8add3408101b3a53aa2d7
2011-05-16 16:28:59 -07:00
Omari Stephens
35e6a003ca Merge "Add a 1000msec timeout for adb's USB control packets" 2011-05-16 15:42:26 -07:00
Christopher Tate
574ebc41f8 Merge "Add 'adb backup' for pulling a full backup tarfile to the host" 2011-05-11 12:51:14 -07:00
Omari Stephens
8bbae23915 Add a 1000msec timeout for adb's USB control packets
Includes a version bump to make it possible to determine if a given
binary has this fix or not.

Bug: 4111855
Change-Id: I86d902a7fa0c4b906264141d2467b7bdddb61801
2011-05-09 19:14:24 -07:00
Christopher Tate
d2f5415c60 Add 'adb backup' for pulling a full backup tarfile to the host
The direct command interfaces with the 'bu' binary in /system/bin
on the device.

Change-Id: I4cd69eedfe5144c47277573c5626c6ad8755d70b
2011-04-27 15:27:23 -07:00
Mike Lockwood
224f9485f1 am 81ce51da: am 55537c34: am 2f7995ee: Merge "adb: fix typo in helptext"
* commit '81ce51dae95deb0dc6b07cbd96bd07d08aad5178':
  adb: fix typo in helptext
2011-04-26 16:06:04 -07:00
Mike Lockwood
81ce51dae9 am 55537c34: am 2f7995ee: Merge "adb: fix typo in helptext"
* commit '55537c347bb31d0e2b176ca2550d2054877f9d54':
  adb: fix typo in helptext
2011-04-26 16:00:55 -07:00
Bernhard Reutner-Fischer
6715a4390f adb: fix typo in helptext
s/ocmmand/command

Change-Id: I4ed17e8df9dc71a28e1caef5a21f6351e92628af
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-04-26 12:53:55 +02:00
JP Abgrall
112445b8a7 adb: Don't allow a forced exit if data is still in the socket
Fixes the  http://b/4271011 "adb shell cat /init.rc output gets truncated"


Change-Id: I6df64374b60789595fb18f96d429315dec032443
Signed-off-by: JP Abgrall <jpa@google.com>
2011-04-12 22:01:58 -07:00
Mike Lockwood
0ffe483a6a am e4bcf830: am d37e0840: Merge "In serial, skip over port as well if numbers found after colon."
* commit 'e4bcf8305748e8799df9047fb0f6881553dd43b5':
  In serial, skip over port as well if numbers found after colon.
2011-04-11 14:55:01 -07:00
Terence Haddock
e994f18c53 In serial, skip over port as well if numbers found after colon.
Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
2011-04-06 16:18:25 +02:00
JP Abgrall
b40367e7bc adb: keep mac build happy
Use FIONREAD instead of TIOCINQ

Change-Id: Ic9db0228a51c546a798c70f08f2e644a1a376120
2011-03-29 12:36:22 -07:00
JP Abgrall
408fa57864 adb: fix subprocess exit handling, oom adjust fixes, extra debugging.
* Add support for correctly handling subprocess termination in shell service  (b/3400254 b/3482112 b/2249397)
 - have a waitpid() track the subprocess, then notify the fdevent via a socket
 - force an eof on the pty master in fdevent's new subproc handler.
 - modify fdevent to force-read the pty after an exit.
* Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections, where it
 belongs.
* Fix the race around OOM adjusting.
  - Do it in the child before exec() instead of the in the parent as the
   child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
  - Allow locks across object files.
  - Add lock within D()
  - Make sure sysdesp init (mutex init also) is called early.
* Add some missing close(fd) calls
  - Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.
* Fix some errno handling and make D() correctly handle it.
* Add new adb trace_mask: services.
* Make fdevent_loop's handle BADFDs more gracefully (could occur some subproc closed its pts explicitely).
* Remove obsolete commandline args reported in help. (b/3509092)


Change-Id: I928287fdf4f1a86777e22ce105f9581685f46e35
2011-03-28 14:12:22 -07:00
Terence Haddock
28e1390e68 In serial, skip over port as well if numbers found after colon.
Change-Id: Icd45f570a9527790eb0cd614a3f77da1a72375b1
2011-03-16 09:43:56 +01:00
Ken Sumrall
e3aeeb4de3 Try to unmount writable filesystems when rebooting
Ext4 filesystems like to be unmounted before rebooting.  The Android system
doesn't have a traditional Linux init setup, and shutting down the system
was not much more than calling sync(2) and reboot(2).  This adds a new
function to libcutils called android_reboot().  By default, it calls sync()
and then remounts all writable filesystems as read-only and marks them clean.
There is a flag parameter in which the caller can ask for sync() not to be
called, or to not remount the filesystems as read-only.  Then it will call
reboot(2) as directed by the other parameters.  This change also updates
adb, init and toolbox to call the new android_reboot() function.
Fixes bugs 3350709 and 3495575.

Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7
2011-03-10 18:11:46 -08:00
JP Abgrall
0e7c4274c6 Revert "Fix adb hang when subprocess dies early."
This is for http://b/3482112 "adb interactions with device causing test harness failures".

This reverts commit 69c5c4c45b.

Change-Id: I630bf2e04d2ecf0223bd2af4e87136754ff880d3
2011-02-23 18:49:00 -08:00
JP Abgrall
69c5c4c45b Fix adb hang when subprocess dies early.
* Handling of the subprocess and its FD.
  This fixes http://b/3400254 "Many bugreports getting hung at the end in monkey"
  -  Start up a service thread that waits on the subprocess to terminate,
then closes the FD associated with it.
  -  Have the event handler select() with a timeout so that it can
  detect the closed FD. Select() with no timeout does not return when an FD is closed.
  - Have the event handler force a read on the closed FD to trigger the close sequence.
  - Migrate the "shell:blabla" handling to "#if !ADB_HOST" sections.
* Fix the race around OOM adjusting.
  - Do it in the child before exec() instead of the in the parent as the
   child could already have started or not (no /proc/pid/... yet).
* Allow for multi-threaded D() invocations to not clobber each other.
  - Allow locks across object files.
  - Add lock within D()
* Add some missing close(fd) calls
  - Match similar existing practices near dup2()
* Add extra D() invocations related to FD handling.
* Warn about using debugging as stderr/stdout is used for protocol.

Change-Id: Ie5c4a5e6bfbe3f22201adf5f9a205d32e069bf9d
Signed-off-by: JP Abgrall <jpa@google.com>
2011-02-18 14:16:59 -08:00
Mathias Agopian
0909af57d5 am c1fbf7c1: fix [3374821] Cannot take screenshot of HC preview
* commit 'c1fbf7c1638cb4f1f139edf74562fcfbaa6f3435':
  fix [3374821] Cannot take screenshot of HC preview
2011-02-09 13:22:39 -08:00
Mathias Agopian
c1fbf7c163 fix [3374821] Cannot take screenshot of HC preview
don't hardcode the pixelformat to RGBA_8888 when taking
screenshots.

Change-Id: I3a76b49275acfce9a2994436f521b76310cd8fb2
2011-02-09 12:56:25 -08:00
Mike Lockwood
67afaad585 am d4894f4b: am 034117e4: Merge changes I8df51128,Ie922b3e7,I31f78419,I7e8df44d,I6067857b,Ifd35587c,Ie8d66740
* commit 'd4894f4be608c28ef0f39c7794ba865ac812dff9':
  Fix adb leaking file descriptors to forked processes
  adb: Fix command-line parser.
  adb: Increase device descriptor buffer size in Linux host USB support
  adb: improve debug traces readability.
  adb: Don't report negative number of bytes after pushing file > 2 gigabytes
  Adding Texas Instruments to the VID list.
  Support an additional alias for 'adb shell.'
2011-02-03 12:59:03 -08:00
Benoit Goby
3b4a0c81c4 Fix adb leaking file descriptors to forked processes
accept() creates a new file descriptor that should be closed on exec so
that forked processes don't keep a fd opened on the socket.

This also fixes b/3297070 where adb hangs after running adb on the
target.

Change-Id: I8df511289e5549ae49b4824c9dfb71a3bf85eae8
2011-02-03 15:26:45 -05:00
David 'Digit' Turner
eb5df470e6 adb: Fix command-line parser.
This fixes the command-line parser to accept both "daemon server"
and "server nodaemon". Before the patch, the second string would
ignore the "nodaemon" flag.

Fixes b/2191598

Change-Id: Ie922b3e7bf57a6e334fc448cec33fb340ca6abc4
2011-02-03 15:26:43 -05:00
Mike Lockwood
a5d4694846 adb: Increase device descriptor buffer size in Linux host USB support
256 bytes wasn't big enough for some complicated USB configurations

Change-Id: I31f7841953d73b06958f44040f58166b159faff4
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-03 15:26:41 -05:00
David 'Digit' Turner
3e42db23fb adb: improve debug traces readability.
This patch makes the traces easier to read. For example transports are
displayed by name/serial instead of their hex address.

Change-Id: I7e8df44ddbec19754d63d989bd56485998b4627b
2011-02-03 15:26:37 -05:00
Mike Lockwood
487009ef5e adb: Don't report negative number of bytes after pushing file > 2 gigabytes
BUG: 3198322

Change-Id: I6067857b9490984a21b597f6ee338446a9decaf5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-02-03 15:26:35 -05:00
Alex Sakhartchouk
1d3fbed348 Adding Texas Instruments to the VID list.
Change-Id: Ifd35587c93ae7d5c8253f477a92cca2345dc8bb5
2011-02-03 15:26:33 -05:00
Daniel Sandler
9c73d17e87 Support an additional alias for 'adb shell.'
Change-Id: Ie8d667407fef8ee5a6c7ab86b30307fb61869170
2011-02-03 15:26:29 -05:00
Mike Lockwood
b596608f09 adb: Increase device descriptor buffer size in Linux host USB support
256 bytes wasn't big enough for some complicated USB configurations

Change-Id: I31f7841953d73b06958f44040f58166b159faff4
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-01-07 23:18:14 -05:00
Mike Lockwood
ee878753f9 adb: Don't report negative number of bytes after pushing file > 2 gigabytes
BUG: 3198322

Change-Id: I6067857b9490984a21b597f6ee338446a9decaf5
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-12-14 23:08:43 -08:00
Alex Sakhartchouk
ffe55f760d Adding Texas Instruments to the VID list.
Change-Id: Ifd35587c93ae7d5c8253f477a92cca2345dc8bb5
2010-12-13 14:26:18 -08:00
Ying Wang
1c061b9ea9 dist for dist_files
Change-Id: I665572a2212f1239b02b7816e37ada210afbdb48
2010-12-09 10:33:27 -08:00
Jean-Baptiste Queru
5fa7fcf89a am 34961b26: am 6713a2e0: Merge "Fix USB endianness bugs on Linux."
Merge commit '34961b266773006ec6643446e7b5a1558d82e4f4'

* commit '34961b266773006ec6643446e7b5a1558d82e4f4':
  Fix USB endianness bugs on Linux.
2010-10-21 13:45:39 -07:00
Jean-Baptiste Queru
5985f6ceee am 89463984: am 81347d27: Merge "adb: Improved detection of big endian architecture"
Merge commit '89463984f5576d7ab61303e08f81eb9175afed59'

* commit '89463984f5576d7ab61303e08f81eb9175afed59':
  adb: Improved detection of big endian architecture
2010-10-21 10:55:02 -07:00
Jean-Baptiste Queru
34961b2667 am 6713a2e0: Merge "Fix USB endianness bugs on Linux."
Merge commit '6713a2e0c659be9d992e75ab420da5680f522658' into gingerbread-plus-aosp

* commit '6713a2e0c659be9d992e75ab420da5680f522658':
  Fix USB endianness bugs on Linux.
2010-10-20 15:33:57 -07:00
Jean-Baptiste Queru
89463984f5 am 81347d27: Merge "adb: Improved detection of big endian architecture"
Merge commit '81347d2764b32ec7224d4e2ab3348103816400b2' into gingerbread-plus-aosp

* commit '81347d2764b32ec7224d4e2ab3348103816400b2':
  adb: Improved detection of big endian architecture
2010-10-20 13:34:01 -07:00
Mike Lockwood
12ddbea0fd am a8b8c0e2: am d02e521d: adb: Add support for Philips\'s USB vendor ID
Merge commit 'a8b8c0e21ac4bdb7838c8c1b8e7d60f632eda79b'

* commit 'a8b8c0e21ac4bdb7838c8c1b8e7d60f632eda79b':
  adb: Add support for Philips's USB vendor ID
2010-10-18 09:32:38 -07:00
Xavier Ducrohet
5ca7509f5b am fa5c690d: am 89aff1d2: Add Asus USB vendor ID to adb.
Merge commit 'fa5c690d93b92ccf57a0522c498ca2076a7ad98d'

* commit 'fa5c690d93b92ccf57a0522c498ca2076a7ad98d':
  Add Asus USB vendor ID to adb.
2010-10-16 09:43:26 -07:00
Marcus Comstedt
6f703a2e85 Fix USB endianness bugs on Linux.
The fields device->idVendor and device->idProduct should not be
converted from little endian to native byteorder, because the
kernel has in fact done so already!

On the other hand, the descriptors read using raw ioctl:s in
register_device() do need to be converted.

Change-Id: I5fe08b626b14ead56a592b68d026690e343c2656
2010-10-16 14:35:34 +02:00
Marcus Comstedt
d340d2f57d adb: Improved detection of big endian architecture
Instead of testing for the (compiler specific) define
__ppc__ explicitly, use the define HAVE_BIG_ENDIAN provided by
AndroidConfig.h.  That way, it should work on all big endian
systems.

Change-Id: Ic4d62afcefce4c8ad5716178ebfcb2b055ac73ce
2010-10-16 14:35:28 +02:00
Mike Lockwood
a8b8c0e21a am d02e521d: adb: Add support for Philips\'s USB vendor ID
Merge commit 'd02e521d79a49471b3f1dc3717e842948df64789' into gingerbread-plus-aosp

* commit 'd02e521d79a49471b3f1dc3717e842948df64789':
  adb: Add support for Philips's USB vendor ID
2010-10-15 18:25:27 -07:00
Mike Lockwood
d02e521d79 adb: Add support for Philips's USB vendor ID
Change-Id: Iaf2e3f6f111198740703b5c3581d95756f797224
Signed-off-by: Mike Lockwood <lockwood@google.com>
2010-10-15 18:14:22 -04:00
Xavier Ducrohet
3b5d79b78c am 1693c32f: am 6c263694: Fix KT Tech\'s usb vendor ID.
Merge commit '1693c32f42e69634b52df1bf827fd81dc3abda46'

* commit '1693c32f42e69634b52df1bf827fd81dc3abda46':
  Fix KT Tech's usb vendor ID.
2010-10-15 14:01:53 -07:00
Xavier Ducrohet
fa5c690d93 am 89aff1d2: Add Asus USB vendor ID to adb.
Merge commit '89aff1d22662c64cc2de384e7e2c699e4d1d5d47' into gingerbread-plus-aosp

* commit '89aff1d22662c64cc2de384e7e2c699e4d1d5d47':
  Add Asus USB vendor ID to adb.
2010-10-15 11:57:14 -07:00
Xavier Ducrohet
89aff1d226 Add Asus USB vendor ID to adb.
Bug: 3099385

Change-Id: Ic068fbf58abd23f4bddfe13ae33854a8b4053cf8
2010-10-15 10:26:50 -07:00
Xavier Ducrohet
1693c32f42 am 6c263694: Fix KT Tech\'s usb vendor ID.
Merge commit '6c2636947c43c2950488d8d82bfc691cb907518d' into gingerbread-plus-aosp

* commit '6c2636947c43c2950488d8d82bfc691cb907518d':
  Fix KT Tech's usb vendor ID.
2010-10-14 11:35:01 -07:00
Xavier Ducrohet
6c2636947c Fix KT Tech's usb vendor ID.
Change-Id: I77a6de8c11d490e2427f704ff64e7c09874a5d14
2010-10-14 10:06:13 -07:00
Benoit Goby
dff0237430 Don't build adb for sdk only builds
Change-Id: I0c56213e81a889fd3a7c5e72c4a6e63544a2a3bd
Signed-off-by: Benoit Goby <benoit@android.com>
2010-10-06 18:30:55 -07:00