Commit Graph

14446 Commits

Author SHA1 Message Date
Daniel Rosenberg e20a4194b8 am 516d30d5: Merge "rootdir: Create symlinks in Android.mk"
* commit '516d30d5029c101ef32b600d3143513d3ce16933':
  rootdir: Create symlinks in Android.mk
2015-08-04 01:06:03 +00:00
Daniel Rosenberg 516d30d502 Merge "rootdir: Create symlinks in Android.mk" 2015-08-04 01:00:48 +00:00
Elliott Hughes f7af90c9df am 3cf2a8e0: Merge "Fix a comment typo."
* commit '3cf2a8e0ee7dbf504763cc446d5cf1ee451158fc':
  Fix a comment typo.
2015-08-04 00:58:39 +00:00
Elliott Hughes 1da90f0c14 am feacf20d: Merge "adb: win32: file descriptor reliability improvements"
* commit 'feacf20d1eb797c0edfc3c7a487fd93c63e8fd4a':
  adb: win32: file descriptor reliability improvements
2015-08-04 00:58:37 +00:00
Daniel Rosenberg 390876539e am 13d62278: Merge "Skip mounting /, just mark block device as ro if needed."
* commit '13d62278f4ecbd5ea29b7f3e0d43b9ced7aae439':
  Skip mounting /, just mark block device as ro if needed.
2015-08-04 00:58:36 +00:00
Elliott Hughes 3cf2a8e0ee Merge "Fix a comment typo." 2015-08-04 00:51:38 +00:00
Daniel Rosenberg 595003a3d0 rootdir: Create symlinks in Android.mk
system.img may contain the root directory as well. In that case, we
need to create some symlinks init.rc would during the build.

Change-Id: I4e7726f38c0f9cd9846c761fad1446738edb52c0
2015-08-04 00:51:19 +00:00
Elliott Hughes feacf20d1e Merge "adb: win32: file descriptor reliability improvements" 2015-08-04 00:50:43 +00:00
Daniel Rosenberg 13d62278f4 Merge "Skip mounting /, just mark block device as ro if needed." 2015-08-04 00:50:40 +00:00
Daniel Rosenberg 31a4fafc15 Skip mounting /, just mark block device as ro if needed.
Change-Id: I7fbb636d296abc1caab6c7bf88017684c9df7759
2015-08-04 00:47:04 +00:00
Yusuke Sato 69386e33b6 am 81fd50c3: Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags"
* commit '81fd50c3974f3fca37d4119477e11dc3f40b7172':
  perfboot.py: ignore tags not listed in /system/etc/event-log-tags
2015-08-04 00:13:07 +00:00
Yusuke Sato 81fd50c397 Merge "perfboot.py: ignore tags not listed in /system/etc/event-log-tags" 2015-08-04 00:08:24 +00:00
Elliott Hughes bfa7c7d9e2 Fix a comment typo.
Change-Id: Ifacb19b9c31ac81fbf02c8382eb0324ea79075b9
2015-08-03 16:26:13 -07:00
Yusuke Sato e801cc0b4e perfboot.py: ignore tags not listed in /system/etc/event-log-tags
This is a follow-up CL for http://ag/739815/.

Bug: 22207911
Change-Id: Ie5f529abc4b18454cea8a75a1438a5ea65dd90ab
2015-08-03 15:56:53 -07:00
Elliott Hughes eee501ece6 am 6b940e13: Merge "adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc"
* commit '6b940e1349da720bdba4c5eeb9741e5fffe30913':
  adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc
2015-08-03 21:28:15 +00:00
Elliott Hughes 6b940e1349 Merge "adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc" 2015-08-03 21:16:26 +00:00
Elliott Hughes 14c08745ac am 6355f2c1: Merge "adb: win32: call SystemErrorCodeToString() from more places"
* commit '6355f2c1400b531fb71a46351a0c26e666af2e88':
  adb: win32: call SystemErrorCodeToString() from more places
2015-08-03 21:09:43 +00:00
Elliott Hughes c783e1a3f3 am 0fac7fd1: Merge "Leave the evidence lying around if an adb test fails."
* commit '0fac7fd15266f5d9ae0eddc76313d4383e31dfac':
  Leave the evidence lying around if an adb test fails.
2015-08-03 21:09:41 +00:00
Elliott Hughes 6355f2c140 Merge "adb: win32: call SystemErrorCodeToString() from more places" 2015-08-03 21:04:01 +00:00
Elliott Hughes 0fac7fd152 Merge "Leave the evidence lying around if an adb test fails." 2015-08-03 21:03:35 +00:00
Elliott Hughes 3841a9f7cb Leave the evidence lying around if an adb test fails.
Not seeing the full output from the failed adb command is probably
the biggest issue when debugging a test failure, but this doesn't
help either.

Change-Id: Ic42cbced8be252185a799b27c210a744188a4201
2015-08-03 13:58:49 -07:00
Yusuke Sato 5e34b3abdb am 72488aa0: Merge "perfboot.py: warn if dm-verity is disabled"
* commit '72488aa0fe060d9bb56c23e585e5aad55288c5ea':
  perfboot.py: warn if dm-verity is disabled
2015-08-03 20:35:02 +00:00
Elliott Hughes 6eb9aa62d3 am 6bf93400: Merge "adb: fix mkdirs / adb pull with relative paths, fix win32 issues"
* commit '6bf93400f344f4d438e3bc6f1bf3d6a7704ea2b5':
  adb: fix mkdirs / adb pull with relative paths, fix win32 issues
2015-08-03 20:35:00 +00:00
Yusuke Sato 72488aa0fe Merge "perfboot.py: warn if dm-verity is disabled" 2015-08-03 20:26:47 +00:00
Elliott Hughes 6bf93400f3 Merge "adb: fix mkdirs / adb pull with relative paths, fix win32 issues" 2015-08-03 20:25:41 +00:00
Spencer Low 22191c30a6 adb: fix mkdirs / adb pull with relative paths, fix win32 issues
Relative paths were being prefixed with OS_PATH_SEPARATOR on unix and
win32 causing adb to incorrectly try to make directories at the root.
Plus, absolute paths didn't work on win32 (C: got prefixed into \C:).

This fix is to use dirname (available on win32 via mingw's crt) to do
the messy parsing.

I added a test for the relative path case.

Change-Id: Ibb0a4a8ec7756351d252a4d267122ab18e182858
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-03 13:24:18 -07:00
Elliott Hughes c376691617 am 8c61e029: Merge "adb_test/libbase_test: win32: get some tests working"
* commit '8c61e0297c95a61bd3891704e7530ca1436a6421':
  adb_test/libbase_test: win32: get some tests working
2015-08-03 19:53:14 +00:00
Elliott Hughes 8c61e0297c Merge "adb_test/libbase_test: win32: get some tests working" 2015-08-03 19:45:08 +00:00
Spencer Low cf168a82e9 adb_test/libbase_test: win32: get some tests working
adb_test:

* Fix adb_utils directory_exists test for Windows. The test actually
fails because directory_exists() is not aware of junctions or symlinks,
but I'm not really sure if that is a bad thing (since these are rare on
Windows to begin with).

* Fix crash during transport tests due to mutex not being initialized.

* io tests fail for various reasons (see adb_io_test.cpp for more info).

libbase_test:

* Get it building on Win32 by implementing mkstemp() and mkdtemp().

* Run StringPrintf %z test on Windows because it passes because we build
with __USE_MINGW_ANSI_STDIO which implements %z.

* I didn't fixup the logging tests: some logging tests fail because when
abort() is called on Windows, by default it pops up UI asking whether a
crash dump should be sent to Microsoft. To some degree this makes sense,
as I think LOG(FATAL) does crash dumping in Chromium. This should be
revisited in the future.

Change-Id: Iaa2433e5294ff162e0b2aa9fe6e4ec09a6893f7a
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-03 12:44:43 -07:00
Yusuke Sato b6c66dc0a3 perfboot.py: warn if dm-verity is disabled
Disabling the feature sometimes skews benchmark results.

Bug: 22207911
Change-Id: Idedc7eb14e3cc4e8687b0c0e2975f10a3c4154e5
2015-08-03 11:36:21 -07:00
Elliott Hughes 07522aae91 am bb3b45d2: Merge "libbase_test: win32: get some tests working"
* commit 'bb3b45d27c9ef67c66efdec687325fa9707c6665':
  libbase_test: win32: get some tests working
2015-08-03 18:04:46 +00:00
Tom Cherry 0070026c1b am 4247ebfd: Merge "init: use std::vector<std::string> for argument passing"
* commit '4247ebfd2faefcfd7abf7a4cc4c85ce6c8b5125c':
  init: use std::vector<std::string> for argument passing
2015-08-03 17:59:46 +00:00
Elliott Hughes bb3b45d27c Merge "libbase_test: win32: get some tests working" 2015-08-03 17:55:12 +00:00
Spencer Low 40d0c7aead libbase_test: win32: get some tests working
* Get it building on Win32 by implementing mkstemp() and mkdtemp().

* Run StringPrintf %z test on Windows because it passes because we build
with __USE_MINGW_ANSI_STDIO which implements %z.

Change-Id: Ia01f94e8258503381a1df6d3da6e40de59e57125
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-03 10:54:17 -07:00
Tom Cherry 4247ebfd2f Merge "init: use std::vector<std::string> for argument passing" 2015-08-03 17:51:39 +00:00
Todd Kennedy 1f6204a885 am 6782ca0b: Merge "Add a trace constant for PackageManager"
* commit '6782ca0b766c777ae285d2b7bcfcd8232ffe34d9':
  Add a trace constant for PackageManager
2015-08-03 17:50:14 +00:00
Todd Kennedy 6782ca0b76 Merge "Add a trace constant for PackageManager" 2015-08-03 17:44:46 +00:00
Todd Kennedy da106ad28c Add a trace constant for PackageManager
Change-Id: Iff63b3d31ba9b997bd61c58c9df5afe2dfd7be7a
2015-08-03 09:58:01 -07:00
Elliott Hughes d29849007a am 11ca81fc: Merge "Remove adb\'s unused get_my_path for Windows."
* commit '11ca81fc3cff887091b0dfa8cdaa246b444f6ea4':
  Remove adb's unused get_my_path for Windows.
2015-08-03 15:37:36 +00:00
Elliott Hughes 11ca81fc3c Merge "Remove adb's unused get_my_path for Windows." 2015-08-03 15:32:43 +00:00
Spencer Low 8df9032176 adb: win32: call SystemErrorCodeToString() from more places
Improve some error messages, or trace output.

Change-Id: Ib09fac33a296f090d37f125cad7556fc5b5e928e
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-02 18:50:17 -07:00
Spencer Low e347c1dd47 adb: win32: define UNICODE/_UNICODE, Unicode error messages, misc
Define the UNICODE and _UNICODE preprocessor symbols to make passing
char* to Ansi/Unicode-agnostic Windows and C Runtime APIs break the
build. The solution is to call wide Windows and C Runtime APIs and use
widen(utf8).c_str(). Most code was already calling wide APIs. Defining
these symbols makes a call to CreateEvent() (which previously mapped to
CreateEventA()) turn into a call to CreateEventW().

Make SystemErrorCodeToString() use Unicode.

Add various comments.

Change-Id: I9b212412348a29826718e897a486489e1f142d16
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-02 18:13:54 -07:00
Spencer Low a5b06b0ff8 adb: win32: fix USB device hang when resuming from sleep/hibernation
After resuming Windows from sleep or hibernation, USB connections are not
automatically disconnected. Writing to the USB connections does not return any
errors, but read never returns. My theory is that the device saw the host
sleep/hibernation as a disconnect, so the device is waiting for re-auth from the
host as if the host was just connected.

To solve this, detect resume from sleep/hibernation, disconnect all USB
connections and let the device poll thread re-detect the USB devices in 1 sec.

This is done by using a hidden window that receives power notifications. The
hidden window code is based on Chromium's similar code (platform-tools already
includes the Chromium Authors license).

This depends on a change to AdbWinUsbApi.dll that makes AdbCloseHandle(endpoint)
abort any pending IOs and wait for those IOs to be aborted.

I expect that this should solve many adb and Android Studio related bugs
regarding hangs or errors.

Also in this change:

 - Add D() logging for any errors from AdbWinApi.dll API calls.

 - Stop setting errno to Win32 error values which the caller can't really do
   anything with. Stop calling SetLastError() because the callers don't check
   GetLastError() anyway.

 - Check the return value from writing zero length packets.

 - If the full amount of data isn't written, return an error.

 - Upon any usb_read/usb_write error, kick the connection instead of only
   kicking when ERROR_INVALID_HANDLE is encountered.

 - Restructure some code from nested-if-trees to goto-fail to make it easier
   to follow.

 - Delete usb_name() since it isn't thread-safe and it isn't used.

Change-Id: Iffcf5315ad8593d0c7e93012afaabe6fae354ac1
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-01 19:19:09 -07:00
Yabin Cui 20e8b384c6 am c70ac57d: Merge "adb: poll for emulator connection."
* commit 'c70ac57db0df9736f50a6b1fe29b151292b09e6b':
  adb: poll for emulator connection.
2015-08-01 00:57:27 +00:00
Elliott Hughes 16d79c7318 Remove adb's unused get_my_path for Windows.
Change-Id: I3cfb4677acaf6acaf512b3cdce6c11bdb2bd0578
2015-07-31 17:54:24 -07:00
Yabin Cui c70ac57db0 Merge "adb: poll for emulator connection." 2015-08-01 00:50:39 +00:00
Jorge Lucangeli Obes 45ca3d54e0 am a336cbcd: Merge "Reserve new UID range for OEM."
* commit 'a336cbcd5c05e693d5c52951ce2ee49dd8c617fe':
  Reserve new UID range for OEM.
2015-08-01 00:47:59 +00:00
Jorge Lucangeli Obes a336cbcd5c Merge "Reserve new UID range for OEM." 2015-08-01 00:40:37 +00:00
Elliott Hughes b8b7118614 am 367fb503: Merge "adb: win32: Unicode path names, env vars, some console support"
* commit '367fb50333a449f14636f5dc7cd4bc1c81323f59':
  adb: win32: Unicode path names, env vars, some console support
2015-07-31 23:57:22 +00:00
Elliott Hughes 367fb50333 Merge "adb: win32: Unicode path names, env vars, some console support" 2015-07-31 23:50:52 +00:00