Commit Graph

14037 Commits

Author SHA1 Message Date
David Zeuthen d906b2973b Merge "fs_mgr: Error out if unable to determine slot_suffix" 2015-09-14 15:33:35 +00:00
Daniel Erat 3fa97b3cc3 Merge "Add libbinderwrapper." 2015-09-12 20:37:05 +00:00
Elliott Hughes c372a77862 Merge "libbase_test: get it building for Windows" 2015-09-12 03:16:51 +00:00
Spencer Low b2d4949cee libbase_test: get it building for Windows
Add to whitelist.

For some reason, when compiling, parseint_test.cpp would encounter
errors like the following:

host cross C++: host_cross_libbase_test <= system/core/base/parseint_test.cpp
In file included from external/gtest/include/gtest/gtest.h:1929:0,
                 from system/core/base/parseint_test.cpp:19:
system/core/base/parseint_test.cpp: In member function ‘virtual void parseint_signed_smoke_Test::TestBody()’:
external/gtest/include/gtest/internal/gtest-internal.h:133:55: error: converting ‘false’ to pointer type for argument 1 of ‘char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)’ [-Werror=conversion-null]
     (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
                                                       ^
external/gtest/include/gtest/gtest_pred_impl.h:77:52: note: in definition of macro ‘GTEST_ASSERT_’
   if (const ::testing::AssertionResult gtest_ar = (expression)) \
                                                    ^
external/gtest/include/gtest/gtest_pred_impl.h:166:3: note: in expansion of macro ‘GTEST_PRED_FORMAT2_’
   GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
   ^
external/gtest/include/gtest/gtest.h:1993:3: note: in expansion of macro ‘ASSERT_PRED_FORMAT2’
   ASSERT_PRED_FORMAT2(::testing::internal:: \
   ^
external/gtest/include/gtest/gtest.h:1994:32: note: in expansion of macro ‘GTEST_IS_NULL_LITERAL_’
                       EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
                                ^
external/gtest/include/gtest/gtest.h:2011:32: note: in expansion of macro ‘GTEST_ASSERT_EQ’
 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
                                ^
system/core/base/parseint_test.cpp:23:3: note: in expansion of macro ‘ASSERT_EQ’
   ASSERT_EQ(false, android::base::ParseInt("x", &i));
   ^

For whatever reason, the gcc for Windows isn't handling the template
metaprogramming correctly, so to work-around the issue, I
search-and-replaced "ASSERT_EQ(false, " to "ASSERT_FALSE(" and
"ASSERT_EQ(true, " to "ASSERT_TRUE(" and that seems to compile just fine
for Linux and Windows (and the tests pass on both platforms).

Change-Id: I05132909d1f4b18afff23139652a218649689f2d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-11 20:01:29 -07:00
David Pursell 7b749acd5f Merge "adb: fix shell_service_protocol_test for Windows." 2015-09-12 01:30:20 +00:00
David Pursell b404dec85a adb: fix shell_service_protocol_test for Windows.
Adds missing #ifdef guards to shell_service_protocol_test.cpp so the
test compiles on Windows.

Also fixes a bug in Windows socketpair write implementation. Previously
it was only checking for a closed pipe if the write happened to block.
This adds an additional pre-check to exit immediately on a closed pipe.

These two changes allow the test to compile and pass on Windows.

Change-Id: Ib8853ed72f015fc0d623da47c32982cb3ffa4a3d
2015-09-11 18:28:27 -07:00
Elliott Hughes 9336ee389f Merge "Fix (Windows) build." 2015-09-11 23:18:48 +00:00
Elliott Hughes 2f577205fc Fix (Windows) build.
Change-Id: Ib9afd101d255d748ba6c15ed8075f3d10338c95c
2015-09-11 16:18:24 -07:00
Elliott Hughes 0ad13cf298 Merge "fix adb_test Windows build" 2015-09-11 23:13:40 +00:00
Elliott Hughes ee46239c35 Merge "adb: win32: make adb_getenv() case-insensitive" 2015-09-11 22:59:19 +00:00
Spencer Low e6ae573571 adb: win32: make adb_getenv() case-insensitive
adb_getenv() should be case-insensitive just like the real getenv() on
Windows.

Added a unittest for adb_getenv(). In the process, made adb_test link
with -municode so that the environment block is Unicode.

Move wmain() from main.cpp to sysdeps_win32.cpp so that adb_test could
also use it.

Because wmain() moved, it wasn't as easy to do the runtime check to
verify that -municode was used, so do that check in _ensure_env_setup()
since adb_getenv() is called early in adb anyway.

Added a utility ToLower() which is good enough for env vars whose keys
are probably always ASCII to begin with.

Change-Id: I082f7fdee9dfe2c7f76b878528d2f7863df6d8d1
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-11 15:53:08 -07:00
Spencer Low ebf770fd73 fix adb_test Windows build
adb/Android.mk: adb_test should build on Windows (and Darwin), so add to
the whitelist.

Change-Id: I778f6a7dff4caec92c48e0957591abf32f86ab1b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-11 15:47:20 -07:00
Dan Albert 933f4fd413 Merge "Ensure that libbase and liblog can be built for Windows." 2015-09-11 20:47:07 +00:00
Elliott Hughes 059544f6a8 Merge "Lose lsof to toybox." 2015-09-11 20:44:48 +00:00
Stephen Hines b0e4f08226 Ensure that libbase and liblog can be built for Windows.
Change-Id: If4adf1e2bd7ec36a7f02ae2e263d2db5187c6e7b
2015-09-11 11:39:16 -07:00
David Pursell 31139af04f Merge "adb: create shell protocol class (take 2)." 2015-09-11 18:17:55 +00:00
Elliott Hughes b56bd00046 Merge "Add ParseInt (and ParseUint)." 2015-09-11 18:00:20 +00:00
Elliott Hughes 42325f073c Lose lsof to toybox.
Change-Id: I4b5e0c8c33f5b2dfd3db85628d9a657940978a10
2015-09-11 10:58:21 -07:00
David Zeuthen bd0231c96b fs_mgr: Error out if unable to determine slot_suffix
Instead of falling back to suffix _a, we now error out if neither the
kernel commandline nor the misc partition specifies the suffix. It's
cleaner this way.

Change-Id: I3f58928a664433504ebdf8d0ee05a319be5097cf
2015-09-11 12:53:18 -04:00
James Hawkins b02b6f410d Merge "metrics: Add an option to metrics_client to dump the logs cache." 2015-09-11 16:39:19 +00:00
Steve Fung a2e5b7cb62 Merge "crash_reporter: Fix crash_sender" 2015-09-11 06:29:28 +00:00
Mark Salyzyn 784a69f865 Merge "logd: worst uid record watermark part five" 2015-09-10 16:24:25 +00:00
Mark Salyzyn 5bb2972dce logd: worst uid record watermark part five
A regression that resulted in increased memory consumption for some
logging patterns because we rarely did merge or leading checks, and
age-out checking. On the last prune cycle, we reset for a full scan.

Add some comments describing the pruning processes.

Bug: 23327476
Bug: 23681639
Bug: 23685592
Change-Id: I22b0f339c9269b006831fda9cefe295a263ebb92
2015-09-10 08:43:03 -07:00
Steve Fung 0e8746d895 crash_reporter: Fix crash_sender
- Remove all the ChromeOS specific logic.
- Fix paths to correct Android paths.
- Add periodic_scheduler, and add crash_sender to init.

Bug: 23231196
Bug: 23233267

Change-Id: I12de28bfbe5d5b08831eda9b28c6d7a669c22290
2015-09-09 17:06:33 -07:00
David Zeuthen 6ca11db7b7 Merge "fs_mgr: Fix ENOMEM behavior when dealing with slotselect." 2015-09-09 22:45:24 +00:00
James Hawkins 5f6460081c metrics: Add an option to metrics_client to dump the logs cache.
The format of the metrics dump is rudimentary just yet. Here is an example:

  Metrics from /data/misc/metrics/uma-events

  name: hello     type: USER_ACTION
  name: world     type: USER_ACTION

This required the following changes:
* Added -d option to metrics_client
* Refactored file handling in SerializationUtils
 - Factored out file opening and log parsing into helper methods
 - Added ReadMetricsFromFile which is read-only so does not truncate the file

Change-Id: I6032d74242c79c678ec42a14e78fccc54e7af455
2015-09-09 15:23:24 -07:00
David Zeuthen 744a8f87d9 fs_mgr: Fix ENOMEM behavior when dealing with slotselect.
Change-Id: I5460a8d31baa0d4817ff5fcbd9aac272071937f4
2015-09-09 18:03:13 -04:00
Daniel Erat be43a39ff5 Add libbinderwrapper.
Add a library that wraps libbinder to make it possible to
write tests for native code that communicates via binder.

Bug: 23791723
Change-Id: I3c842413e0f07dc252040c042d664031b0354353
2015-09-09 14:21:28 -06:00
Dan Willemsen aaf4fcf482 Merge "Remove HOST_OS==windows check" 2015-09-09 18:13:22 +00:00
Yabin Cui 4ddb6a3289 Merge "adb: remove unnecessary dependencies of liblog." 2015-09-09 17:38:31 +00:00
Yabin Cui 0df24ea234 Merge "adb: refactor _is_valid_ack_reply_fd" 2015-09-09 17:38:20 +00:00
David Zeuthen d8eed7ff66 Merge "fs_mgr: Use slot_suffix field from bootloader_message." 2015-09-09 16:11:50 +00:00
Yabin Cui cb992d9a21 adb: remove unnecessary dependencies of liblog.
Change-Id: I1aaa9e6c1b47a70f8daf91745f6aec13c92b789f
2015-09-08 18:27:10 -07:00
Dan Albert feee6a000d Merge "Drop unused LOCAL_STATIC_LIBRARIES." 2015-09-08 22:13:45 +00:00
David Zeuthen 227ef3c5d2 fs_mgr: Use slot_suffix field from bootloader_message.
This will make fs_mgr look in the misc partition for the A/B suffix to
use if one of more fstab entries is using the slotselect option and the
bootloader doesn't specify the suffix.

Change-Id: I24233195f60dd352bf8e7ac32b0d95dcd3323156
2015-09-08 15:54:32 -04:00
Dan Albert d83a26033c Drop unused LOCAL_STATIC_LIBRARIES.
This is ignored for BUILD_STATIC_LIBRARY.

Change-Id: Ib5553e0aeaa30cdb2b29f18a4d5d0b0bf1b8740a
2015-09-08 10:55:05 -07:00
David Pursell b9e2e84e7e adb: create shell protocol class (take 2).
Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

This is the second attempt at this CL, the first is at
http://r.android.com/169600. The problems was using sighandler_t
which is not available on mac. sig_t is used instead which is available
due to _GNU_SOURCE being defined in Android.mk, which causes
_BSD_SOURCE -> __USE_BSD -> sig_t to be defined. Nothing else has been
changed from the original CL.

Bug: http://b/23030641
Change-Id: I7bd7f5a82ad811fbca7a3eee1236d2c55ae57c48
2015-09-08 10:04:10 -07:00
Spencer Low a13df3070f adb: refactor _is_valid_ack_reply_fd
Visual Studio's 'jump to reference' feature couldn't parse
adb_commandline() because I used an #ifdef in the middle of an if
statement, so this refactors the code into a separate helper function. I
just copied the code and inverted the comparisons.

No need for sysdeps since this is pretty minor.

Change-Id: Ifd5c62b0b505080ada6db5cc19739c6f07b94de9
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-07 16:20:13 -07:00
David Pursell da0b0116ba Merge "Revert "adb: create shell protocol class."" 2015-09-06 02:34:02 +00:00
David Pursell d9b74192b8 Revert "adb: create shell protocol class."
This CL broke the mac build. I'll revert for now and take a look at how to get it working next week.

This reverts commit 73096f2e1d.

Change-Id: Icb3e015250bcbbc69a45675a1358699ebe01e77b
2015-09-06 01:18:47 +00:00
David Pursell e4c1bb5306 Merge "adb: `features` passes transport features." 2015-09-05 00:01:27 +00:00
David Pursell 215415318d Merge changes from topic 'adb_shell_prework'
* changes:
  adb: create shell protocol class.
  adb: refactor subprocess code.
  adb: move shell service to a separate file.
2015-09-04 23:54:19 +00:00
David Pursell 880be434a9 adb: `features` passes transport features.
`adb features` previously returned a list of host features which was
not terribly useful. This CL changes functionality to return the
transport features instead using the standard targeting args:
  $ adb features  # default target.
  $ adb -e features
  $ adb -s 123456 features

Also adds a "check-feature" service which is currently unused but will
allow the adb client to easily check for a specific feature.

Bug: http://b/23824036
Change-Id: Ibc0c420c75f73d363f3bba7705af616ba2059348
2015-09-04 16:47:21 -07:00
Elliott Hughes afe151fb02 Add ParseInt (and ParseUint).
strtol and family are hard to use correctly, and most callers don't
even try.

Change-Id: I2833622a92cccd4662c0c5bdbbef5eeb4e496914
2015-09-04 16:32:00 -07:00
Dan Willemsen 66680c506a Remove HOST_OS==windows check
With the HOST_CROSS_OS build system change, LOCAL_MULTILIB := first now
behaves the same way.

Change-Id: I03294403e5a106a53d4a0d48b176434221284901
2015-09-04 14:05:19 -07:00
David Pursell 73096f2e1d adb: create shell protocol class.
Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

Bug: http://b/23030641

Change-Id: Ieb02e127095c6dda25b7cb188a2e599173fd97e6
2015-09-04 11:30:11 -07:00
David Pursell a932058504 adb: refactor subprocess code.
Refactor shell_service.cpp to remove dependencies on service.cpp and
combine some common logic between PTY and raw subprocesses.

This will make it easier to add additional common code paths for
the upcoming shell protocol.

Change-Id: I497d30dd388de61b6e68d9086dce38f33dd92876
2015-09-04 11:18:51 -07:00
Tom Cherry 30c13c4954 Merge "move uncrypt from init.rc to uncrypt.rc" 2015-09-04 16:51:30 +00:00
Tom Cherry e8b0fcecf4 Merge "combine adbd.rc with init.usb.rc" 2015-09-04 16:50:46 +00:00
David Pursell 80f67029e0 adb: move shell service to a separate file.
Upcoming changes to the shell will require significant additions to
the subprocess code, and it will be cleaner if it's in a separate file.

The only functional change here is a new debug tag specifically for
the shell service. Everything else has been copied exactly as-is in
order to make it easier to determine what's changing in upcoming CLs.

Change-Id: I13bd4294059051ee10e0d0c6a06affd8eca62967
2015-09-04 08:52:35 -07:00