Commit Graph

35810 Commits

Author SHA1 Message Date
Jeff Sharkey 56c22732c6 Merge "Add "operator bool" overload to android::sp."
am: 28ebfe18fb

Change-Id: Idc8a68835c6a13ab92ffce44507360c2d8e6d9e5
2017-09-13 22:47:21 +00:00
Mark Salyzyn 6818f80dbb Merge changes from topic "b/63736262"
am: 1f666a6be9

Change-Id: I2586aac3d6fe8252ee6728de64fb37102accf0da
2017-09-13 22:45:52 +00:00
George Burgess IV 34abe0cf5c Merge "Fix static analyzer warnings"
am: 7176951b9b

Change-Id: Ie0e915a07644d0537b3e29a3b756705d45703e7f
2017-09-13 22:45:18 +00:00
Dimitry Ivanov d56fee7686 Merge "Recommend using pid instead of tid for gdbclient.py"
am: 0d2105bf0b

Change-Id: I2eb30ad447f41b5d9ec77058e7bbbd51a3e2adf7
2017-09-13 22:44:46 +00:00
Treehugger Robot 28ebfe18fb Merge "Add "operator bool" overload to android::sp." 2017-09-13 20:35:38 +00:00
Treehugger Robot 1f666a6be9 Merge changes from topic "b/63736262"
* changes:
  adb: reboot: last boot command default
  bootstat: introduce sys.boot.reason
2017-09-13 20:25:33 +00:00
Jeff Sharkey 147b881ca9 Add "operator bool" overload to android::sp.
This matches the overload on std::unique_ptr and friends.

Test: builds, boots
Bug: 13758960
Change-Id: Ieed9faa6b162c2a10fa7cf2b135c9b17564f6c88
2017-09-13 11:06:07 -06:00
Treehugger Robot 7176951b9b Merge "Fix static analyzer warnings" 2017-09-13 08:34:19 +00:00
Dimitry Ivanov 0d2105bf0b Merge "Recommend using pid instead of tid for gdbclient.py" 2017-09-13 07:41:10 +00:00
George Burgess IV 180e5e7021 Fix static analyzer warnings
The static analyzer was complaining that we were potentially leaking
memory here (in `ASSERT_NE(ptr, nullptr)` after `new (char)`). This
wasn't correct, but it's also not possible for `new` to return nullptr
without std::nothrow.

In any case, swap to direct calls to `::operator new`, since it looks
like this test explicitly wants calls to `::operator new` to be emitted
(which the C++ standard doesn't guarantee for all `new` expressions).

Bug: 27101951
Test: mma; static analyzer warnings are gone. Also ran
memunreachable_test on marlin; no failures.
Change-Id: Ia740e41079f263040da978ba1ccc71c9c39f53fd
2017-09-12 17:01:20 -07:00
Tianjie Xu e670852a5f Merge "Add the Release function for TemporaryFiles"
am: e9b3a75e6f

Change-Id: Ia655253f41d4f1ea737e9e968c373a214d38f26f
2017-09-12 19:47:21 +00:00
Mark Salyzyn 277eca138b adb: reboot: last boot command default
For reboot [reboot_arg] requests via either reboot or adb reboot,
if reboot_arg is empty then report "shell" or "adb" respectively.

Test: boot_reason_test.sh shell_reboot adb_reboot
Bug: 63736262
Change-Id: Ie613d9e62db6a705885e4e7520aede27af3aa1b9
2017-09-12 12:24:02 -07:00
Tianjie Xu e9b3a75e6f Merge "Add the Release function for TemporaryFiles" 2017-09-12 19:14:38 +00:00
Tom Cherry 698981df84 Merge "init: fix variable scope issue with ExpandArgs()"
am: 1973110355

Change-Id: I6a257ae81ee2b4a3c128f5d4f4724cf1534670c7
2017-09-12 16:37:34 +00:00
Tom Cherry 1973110355 Merge "init: fix variable scope issue with ExpandArgs()" 2017-09-12 16:31:13 +00:00
Mark Salyzyn b304f6d4e7 bootstat: introduce sys.boot.reason
Adding functionality to bootstat --record_boot_complete and
--record_boot_reason to initialize sys.boot.reason, the canonical
system boot reason.

Filter out ro.boot.bootreason oem noise into sys.boot.reason.  Add
heuristics to determine what the boot reason is, when otherwise would
be defaulting to the blunt and relatively devoid of detail catch-all
reboot reasons ("reboot", "shutdown", "cold", "warm", "hard").

boot_reason_test.sh is also a compliance test.

Test: boot_reason_test.sh all
Bug: 63736262
Change-Id: Ic9a42cccbcfc89a5c0e081ba66d577a97c8c8c76
2017-09-12 09:28:25 -07:00
dimitry 6429e20494 Recommend using pid instead of tid for gdbclient.py
Using pid allows to examine other threads after gdb
is attached to a crashing process.

Test: make
Change-Id: Ie4bab0925d7abde7f114791848fa5563db245c8e
2017-09-12 10:47:50 +02:00
Tom Cherry 5e405cacb1 init: fix variable scope issue with ExpandArgs()
ExpandArgs() was factored out of Service::Start() to clean up init,
however this introduced a bug: the scope of expanded_args ends when
ExpandArgs() returns, yet pointers to the c strings contained within
those std::strings are returned from the function.  These pointers are
invalid and have been seen to cause failures on real devices.

This change moves the execv() into ExpandArgs() and renames it
ExpandArgsAndExecv() to keep the clean separation of Service::Start()
but fix the variable scope issue.

Bug: 65303004
Test: boot fugu
Change-Id: I612128631f5b58d040bffcbc2220593ad16cd450
2017-09-11 16:08:54 -07:00
Tianjie Xu f9bc1b0571 Add the Release function for TemporaryFiles
Some tests may create a File* by calling fdopen() on the temp file's
fd. We should release the ownership of fd in this case to avoid the
double close.

Bug: 65430057
Test: libbase unit tests pass
Change-Id: I54fcce2029f9a574f53afdbdda737ee58620c73a
2017-09-11 14:08:32 -07:00
Steven Moreland 359358789a Merge changes from topic "fix-omx-dependencies"
am: 2dac833ea8  -s ours

Change-Id: I65d5872e936362b26984bd8944dcfe8523098deb
2017-09-11 21:03:42 +00:00
Steven Moreland 9fbdd4c63c Add vendor_available to liblog_headers.
am: 25db8dc21b  -s ours

Change-Id: I2f65fc3de29237cf039665dcfc4aebd5e2cccc90
2017-09-11 20:57:51 +00:00
Yifan Hong 25a9baa280 Add sys/cdefs.h to log/log_main.h.
am: e2c51809f7

Change-Id: I81851f9a039450ce53c7e60c7ce096de266898fc
2017-09-11 20:57:07 +00:00
Jin Qian 76fd6f6cf1 Merge "fs_mgr: replace make_ext4 api with e2fsprogs"
am: ff9c7c5e3e

Change-Id: I136e627d1a4a9cf72940e0dfbbcc7fa03206de96
2017-09-11 20:55:47 +00:00
Treehugger Robot 2dac833ea8 Merge changes from topic "fix-omx-dependencies"
* changes:
  Add vendor_available to liblog_headers.
  Add sys/cdefs.h to log/log_main.h.
2017-09-11 20:42:27 +00:00
Treehugger Robot ff9c7c5e3e Merge "fs_mgr: replace make_ext4 api with e2fsprogs" 2017-09-11 20:41:51 +00:00
Jin Qian 42d8137da8 fs_mgr: replace make_ext4 api with e2fsprogs
Execute mke2fs to create empty ext4 filesystem.
Execute e2fsdroid to initialize selinux context.

Test: zero-out first 4k of data partition and reboot,
      fs_mgr successfully formats /data.
Bug: 35219933
Change-Id: If6f72f62c618c64be703b83f0114a4dd0a2b079f
(cherry picked from commit f71bc0c152)
2017-09-11 18:34:32 +00:00
Christopher Ferris 5c9efd1800 Merge "Fix UnwindTest repeatability."
am: cfadedb139

Change-Id: I4ca22b4c132353cad19af362c1f59d743220433e
2017-09-08 03:24:00 +00:00
Christopher Ferris cfadedb139 Merge "Fix UnwindTest repeatability." 2017-09-08 03:15:24 +00:00
George Burgess IV 12f6c4809e Merge "libsync: Fix a double-free."
am: 16dd491aac

Change-Id: I3df91f1d203423dd5f0ca6335812630c25d8bc01
2017-09-07 21:48:36 +00:00
Treehugger Robot 16dd491aac Merge "libsync: Fix a double-free." 2017-09-07 21:39:53 +00:00
Luis Hector Chavez 721b2d6035 Merge "init: Allow clean system shutdown upon SIGTERM"
am: 61cb88add2

Change-Id: If0a495fa067440f0b59969ac0dbc010b4687b52f
2017-09-07 20:06:58 +00:00
Treehugger Robot 61cb88add2 Merge "init: Allow clean system shutdown upon SIGTERM" 2017-09-07 19:59:29 +00:00
Luis Hector Chavez 9f97f47940 init: Allow clean system shutdown upon SIGTERM
This allows Android to cleanly shutdown when running in a PID namespace
in a way that does not rely on adbd running. This is useful to allow
Android to be running in a container and its lifetime managed by an
OCI-compliant tool.

Bug: 65415372
Test: `kill -TERM 1` as root is correctly dropped.
Test: `kill -TERM 1` from the init PID namespace causes init to cleanly shutdown.
Change-Id: Ia66ebdb436221919081bc4723337c0c7f1e53b09
2017-09-07 10:47:04 -07:00
Christopher Ferris 4044c9ad9f Merge "Add a method to share the process memory object."
am: 18149b6764

Change-Id: I28ca654337aea1549f9d8e7f9f700b90ec01d2f7
2017-09-07 00:16:42 +00:00
Christopher Ferris edccd84763 Fix UnwindTest repeatability.
- Rewrite some of the UnwindTest tests to properly wait for the process
  to be ready.
- Add a TestScopedPidReaper to make sure that fork process get killed even
  if the test fails. Add this to all tests that fail.
- Create a quiesce function to be used by all of the tests that will
  wait after attaching to a process.

Bug: 65287279

Test: Ran unit tests on hikey960 board and on host repeatedly.
Change-Id: I57084120396f34d8dfb852f3d814bef2056f1b54
2017-09-06 17:08:44 -07:00
Christopher Ferris 18149b6764 Merge "Add a method to share the process memory object." 2017-09-07 00:01:10 +00:00
Steven Moreland 25db8dc21b Add vendor_available to liblog_headers.
Renamed NDK headers to "liblog_ndk_headers"
(these names aren't used anywhere).

libutils_headers now properly export liblog_headers.

Test: with BOARD_VNDK_VERSION=current
Change-Id: I7b2d9e77e313e3f2ef362a19a03f4c23874d589a
Merged-In: I3a85385f588b84393c57fd6d1bcac620f708f0f1
2017-09-06 12:55:32 -07:00
Yifan Hong e2c51809f7 Add sys/cdefs.h to log/log_main.h.
for liblog.vendor. __ANDROID_API__ is __ANDROID_API_FUTURE__
with BOARD_VNDK_VERSION=current, so we need it defined.

Bug: 33241851
Test: BOARD_VNDK_VERSION=current m libgui.vendor
      (that uses liblog.vendor)

Change-Id: I340ec048094c027828f516d891250651e0c88eea
Merged-In: I340ec048094c027828f516d891250651e0c88eea
2017-09-06 12:54:41 -07:00
Tom Cherry c1968fb0c9 Merge "Log pid for writes to sys.powerctl"
am: 2827106d7d

Change-Id: I2fb780c5809d4c18950c114c07a7363723aa121a
2017-09-06 17:09:08 +00:00
Tom Cherry 2827106d7d Merge "Log pid for writes to sys.powerctl" 2017-09-06 16:58:23 +00:00
Jiyong Park bc3ae0aaea Merge "Mark libgrallocusage as vendor_available"
am: 9c8781f479  -s ours

Change-Id: I448037b8c228190df54d7e39b2ad05fc7511302e
2017-09-06 15:59:02 +00:00
Jiyong Park 18e92a5495 Merge "Don't rely on transitively included headers"
am: 45eeea2dcd

Change-Id: I1d822d54a1da50b99c1153335b03d68c331b8d4d
2017-09-06 15:56:53 +00:00
Treehugger Robot 9c8781f479 Merge "Mark libgrallocusage as vendor_available" 2017-09-06 15:52:22 +00:00
Treehugger Robot 45eeea2dcd Merge "Don't rely on transitively included headers" 2017-09-06 15:51:46 +00:00
Ting-Yuan Huang 2ee27bfd0d Merge "Suppress false-positive static analyzer warnings"
am: 0c89aaec1f

Change-Id: Ifa3e4010ee1ce152f17bdc14f4e73d647c05a76a
2017-09-06 05:09:15 +00:00
Treehugger Robot 0c89aaec1f Merge "Suppress false-positive static analyzer warnings" 2017-09-06 05:04:29 +00:00
Jiyong Park bab16584ce Don't rely on transitively included headers
One must explicitly include what it need.
time.h for clock_gettime

Bug: 37629934
Test: build
Change-Id: I992eac637f373b204aa161b0b26f5563e952c27e
2017-09-06 13:04:57 +09:00
Ting-Yuan Huang 249bd05038 Suppress false-positive static analyzer warnings
by hinting the analyzer with assertions.

Test: built without seeing warnings.
Change-Id: I0d43d4ceafd7f68be89cad6c930c85ee7b6d5165
2017-09-05 16:46:40 -07:00
George Burgess IV 4ff5ff29d2 libsync: Fix a double-free.
sync_file_info, the only caller of legacy_fence_info_to_sync_file_info,
unconditionally frees legacy_info after
legacy_fence_info_to_sync_file_info is called. So, if this calloc
fails, we'll end up freeing legacy_info twice.

Bug: 27101951
Test: mma. Static analyzer complaint about double-free is gone.
Change-Id: I43bf820af9aadf30cb8eabce57416f69a8fccf89
2017-09-05 16:26:36 -07:00
Jiyong Park e2bd601fd2 Mark libgrallocusage as vendor_available
libgrallocusage is used by libui which will be vendor_available: true.

Test: BOARD_VNDK_VERSION=current m libgrallocusage is successful
Change-Id: I476768d8b103033f3b8e5b09f53f4ac422ae377c
Merged-In: I476768d8b103033f3b8e5b09f53f4ac422ae377c
2017-09-05 14:49:53 -07:00