Commit graph

59076 commits

Author SHA1 Message Date
TreeHugger Robot
7b4e4bdf06 Merge changes I25df8eec,I493ff192 into rvc-dev am: 312bc65194 am: dce69882f5
Change-Id: Ia3b8318a158185d62837f371c365d07ed39fb9bc
2020-04-27 16:38:10 +00:00
Maciej Żenczykowski
679bd9810c expected.h - fix bugprone-forwarding-reference-overload warnings am: 62ae965b0a am: 58d21b2a70
Change-Id: I33eea8c97909e9ff4a8f2b8d89d3648598d8fc96
2020-04-27 16:38:06 +00:00
TreeHugger Robot
dce69882f5 Merge changes I25df8eec,I493ff192 into rvc-dev am: 312bc65194
Change-Id: I3ffd400a856a71ee3e90c3c749b40eb285a98184
2020-04-27 16:24:12 +00:00
Maciej Żenczykowski
58d21b2a70 expected.h - fix bugprone-forwarding-reference-overload warnings am: 62ae965b0a
Change-Id: I83ccc2f184efc9773be9520ce1557e22a2e9552b
2020-04-27 16:24:10 +00:00
TreeHugger Robot
312bc65194 Merge changes I25df8eec,I493ff192 into rvc-dev
* changes:
  result.h - fix bugprone-suspicious-semicolon warning
  expected.h - fix bugprone-forwarding-reference-overload warnings
2020-04-27 16:13:12 +00:00
Maciej Żenczykowski
c708c3fa37 result.h - fix bugprone-suspicious-semicolon warning
Fixes:
  system/core/base/include/android-base/result.h:
  133:94: warning: potentially unintended semicolon [bugprone-suspicious-semicolon]

Bernie says:
  it probably means that there's a parser bug with "if constexpr"

  maybe, at static analysis pass, the "if constexpr" was evaluated to false,
  and the compiler removed the "then" block from the AST...
  ... and then it thought you had written it that way :-)
  https://reviews.llvm.org/D46027

Test: builds
Bug: 153035880
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I25df8eeca4ec06b3180c1cd21b554fc583c5581a
Merged-In: I25df8eeca4ec06b3180c1cd21b554fc583c5581a
2020-04-24 17:32:00 -07:00
Maciej Żenczykowski
62ae965b0a expected.h - fix bugprone-forwarding-reference-overload warnings
Fixes:
  system/core/base/include/android-base/expected.h:
  186:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
  195:22: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]
  611:13: warning: constructor accepting a forwarding reference can hide the copy and move constructors [bugprone-forwarding-reference-overload]

To quote Tom Cherry:
  I'm a bit confused at what's happening there.
  I think it's a bug in the linter itself.
  The general solution to that problem is a heavy dose of std::enable_if<>
  to hide that constructor when the 'U' parameter is the same class,
  but those constructors do have the necessarily std::enable_if<> lines.

  I think the problem is that the linter doesn't check that the macro
  _ENABLE_IF() expands into std::enable_if<>.  Let me try explicitly
  putting the std::enable_if<> instead of the macro and check if it
  goes away.

  I expanded the macro but the linter doesn't still doesn't accept
  the format of `std::enable_if_t<(condition_here)>* = nullptr`.
  It does accept `typename Enable = std::enable_if_t<(condition_here), void>`,
  which is the syntax used on their example here:
    https://clang.llvm.org/extra/clang-tidy/checks/bugprone-forwarding-reference-overload.html.

  That latter syntax doesn't work for us.
  See the Notes section on
    https://en.cppreference.com/w/cpp/types/enable_if
  as a reference for why what we're doing is correct.

Test: builds
Bug: 153035880
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I493ff19208cc104f5f176a36ec23fbcb914388f7
Merged-In: I493ff19208cc104f5f176a36ec23fbcb914388f7
2020-04-24 17:31:52 -07:00
Nikita Ioffe
88f5d8ddcc Merge "Make /data/apex/active world readable" into rvc-dev am: e343f439a3 am: 7108b04f6d
Change-Id: I1a86a7b735004af50920630efdd6bf6d2d7d4b70
2020-04-24 22:15:51 +00:00
Nikita Ioffe
7108b04f6d Merge "Make /data/apex/active world readable" into rvc-dev am: e343f439a3
Change-Id: I3fd0f8c8e05b97dedc0cab1f1907adb853432d4b
2020-04-24 21:59:20 +00:00
Nikita Ioffe
e343f439a3 Merge "Make /data/apex/active world readable" into rvc-dev 2020-04-24 21:44:40 +00:00
Jeffrey Huang
e713976f08 Add require root to libstats tests am: 18d239c5c5 am: 102c02a680
Change-Id: Ic6734da91b9fb6ed7c5cfa38a785e08f83b30bf5
2020-04-24 21:38:02 +00:00
Jeffrey Huang
102c02a680 Add require root to libstats tests am: 18d239c5c5
Change-Id: If52aa108ae7c7824e42a531caf09279bbb13c1a1
2020-04-24 21:31:36 +00:00
Jeffrey Huang
18d239c5c5 Add require root to libstats tests
root is required for coverage tests

Bug: 154652564
Test: m -j
Change-Id: I3325565818a275a069aed35a34bf3a58ee4b5bfc
2020-04-24 10:44:25 -07:00
TreeHugger Robot
1e7aa96888 Merge "expected.h - fix bugprone-branch-clone warning" into rvc-dev am: 61e2b0104a am: 4979a4aff8
Change-Id: Ice34c85ef47aeb1769692b19f925bb889f1b77a1
2020-04-24 03:10:06 +00:00
TreeHugger Robot
4979a4aff8 Merge "expected.h - fix bugprone-branch-clone warning" into rvc-dev am: 61e2b0104a
Change-Id: I2f08ff00903b78a20309f52b880283310926e485
2020-04-24 02:59:36 +00:00
TreeHugger Robot
61e2b0104a Merge "expected.h - fix bugprone-branch-clone warning" into rvc-dev 2020-04-24 02:39:42 +00:00
Ytai Ben-tsvi
2c9abb7530 Merge "Control audio HAL services in start/stop" into rvc-dev am: a6f8993f8b am: bba9c37803
Change-Id: I1005584361f99c66fded3746aa7306fe07e34010
2020-04-24 00:50:36 +00:00
Ytai Ben-tsvi
bba9c37803 Merge "Control audio HAL services in start/stop" into rvc-dev am: a6f8993f8b
Change-Id: I5a4b5b316d1b300392ce8d11cf072aa09d40591b
2020-04-24 00:39:34 +00:00
Jeffrey Huang
69c166e281 Merge "Tag libstatspull and libstatssocket tests as MTS" into rvc-dev am: 6d99e68e74 am: 7d9a17ef98
Change-Id: I6c43eebc52eedc265cc836bc2cea30394b1d5e1b
2020-04-24 00:32:53 +00:00
Ytai Ben-tsvi
a6f8993f8b Merge "Control audio HAL services in start/stop" into rvc-dev 2020-04-24 00:30:36 +00:00
Treehugger Robot
ffaa7d6751 expected.h - fix bugprone-branch-clone warning
Fixes:
  system/core/base/include/android-base/expected.h:606:39: warning: repeated branch in conditional chain [bugprone-branch-clone]
    if (x.has_value() != y.has_value()) {
                                        ^
  system/core/base/include/android-base/expected.h:608:4: note: end of the original
    } else if (!x.has_value()) {
     ^
  system/core/base/include/android-base/expected.h:610:10: note: clone 1 starts here
    } else {
           ^

Test: builds
Bug: 153035880
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie67a8bb1bf622319adea15466c42077e0e9b1a18
Merged-In: Ie67a8bb1bf622319adea15466c42077e0e9b1a18
2020-04-24 00:24:38 +00:00
Jeffrey Huang
7d9a17ef98 Merge "Tag libstatspull and libstatssocket tests as MTS" into rvc-dev am: 6d99e68e74
Change-Id: I1c26776dc8e700e5b651ce11fa5c87ca1b9c2026
2020-04-24 00:19:55 +00:00
Jeffrey Huang
6d99e68e74 Merge "Tag libstatspull and libstatssocket tests as MTS" into rvc-dev 2020-04-23 23:55:31 +00:00
TreeHugger Robot
ead6029693 Merge "logcatd: unset pinning log files" into rvc-dev am: 04083e2ba8 am: 0561cefc44
Change-Id: I9f7f327fd8f0791be62db198337c128b80cc8344
2020-04-23 23:18:23 +00:00
TreeHugger Robot
0561cefc44 Merge "logcatd: unset pinning log files" into rvc-dev am: 04083e2ba8
Change-Id: I141461ab6ac7a2173616a5f65132a76450bde726
2020-04-23 23:04:22 +00:00
TreeHugger Robot
04083e2ba8 Merge "logcatd: unset pinning log files" into rvc-dev 2020-04-23 22:52:26 +00:00
Tom Cherry
7a05330c37 Merge "Remove thread safety from libbase logging / liblog" into rvc-dev am: c53c64c0ec am: 01cd4c654a
Change-Id: I3e217bf888f8f6003f5447d941a20f1cba811573
2020-04-23 22:03:34 +00:00
Tom Cherry
01cd4c654a Merge "Remove thread safety from libbase logging / liblog" into rvc-dev am: c53c64c0ec
Change-Id: Ifeb3482fa4da475b49093e48a25427d5c82d80cc
2020-04-23 21:49:39 +00:00
Tom Cherry
c53c64c0ec Merge "Remove thread safety from libbase logging / liblog" into rvc-dev 2020-04-23 21:40:23 +00:00
David Anderson
ef0811ad13 Merge "liblp: Fix tests for linear extent overlap." into rvc-dev am: d029ccd0d6 am: 659cc9d588
Change-Id: If8d8e26f03c731a48f82dfee2ce943947aa63705
2020-04-23 21:23:09 +00:00
David Anderson
659cc9d588 Merge "liblp: Fix tests for linear extent overlap." into rvc-dev am: d029ccd0d6
Change-Id: I3a299b5d055aa4c412bc08d25c4ea93949c68d8e
2020-04-23 21:06:02 +00:00
Jaegeuk Kim
63cdd7095b logcatd: unset pinning log files
commit 5327d931ac ("logcatd: fallocate and fadvise to logcat files")
introduced pinning log files in order to avoid f2fs fragmentation.

But, logcatd does not guarantee to write data within fallocated 2MB space.
So, we can see some bytes written beyond 2MB boundary which results in
pinning small chunks across the filesystem. This makes F2FS GC have to unset
the pinning blocks via GC loop. If this happens during checkpoint=disable
at booting time, we can see long delay to mount /data accordingly.

Bug: 136483670
Bug: 137180754
Bug: 149418646
Fixes: 5327d931ac ("logcatd: fallocate and fadvise to logcat files")
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I986221d6d1da9b8e46e63d1be98ddf0ce4cb099f
2020-04-23 13:53:37 -07:00
David Anderson
d029ccd0d6 Merge "liblp: Fix tests for linear extent overlap." into rvc-dev 2020-04-23 20:51:15 +00:00
TreeHugger Robot
997997a974 Merge "adb: Avoid extra string construction" into rvc-dev am: 386e91d21c am: ca79430600
Change-Id: I6f511a36450298fb19a8a3e35eb72361cac82fb0
2020-04-23 20:41:56 +00:00
TreeHugger Robot
ca79430600 Merge "adb: Avoid extra string construction" into rvc-dev am: 386e91d21c
Change-Id: I876983c946ecaee8b0443b9c5acdca66321d22ad
2020-04-23 20:29:48 +00:00
TreeHugger Robot
386e91d21c Merge "adb: Avoid extra string construction" into rvc-dev 2020-04-23 20:11:05 +00:00
Ytai Ben-Tsvi
6025b731e6 Control audio HAL services in start/stop
Some system services (e.g. SoundTriggerMiddleware) assume that
whenever they start, the audio HAL is in its default (reset) state.
init.rc scripts tie the lifetimes of the audio HAL and system
processes, but when using stop/start this is not the case, and this
may cause spurious crashes in this case.

stop/start is apparently being relied on in some test infrastructure,
so this change is needed to avoid causing problems for those systems
or false detection of problems, which are not actually present in
production.

Bug: 154029444
Test: Manually verify that the audio HAL is stopped on
      'adb shell stop', restarted on 'adb shell start' and that the
      system boots correctly after.
Change-Id: I39878b978b47a169c4fe446c43d7347809d15e06
2020-04-23 10:42:55 -07:00
Tom Cherry
2ae56067bf Remove thread safety from libbase logging / liblog
There are no libbase users that require thread safety for SetLogger,
SetAborter, or SetDefaultTag  and the equivalent liblog symbols are
unreleased, thus have effectively no users.

It is hard to imagine a scenario where a user would need to use these
functions in a multi-threaded program, and it is unreasonable for all
users to pay for thread safety for a vast minority of potential
scenarios. Thread safety implies less efficiency and necessarily means
that these functions are neither fork safe nor async-signal safe, and
we do have users who depend on those characteristics.

It is always possible for users of the non-thread safe versions of
these functions to build thread safe versions on top of them.  For
example, if a user needs a thread safe SetLogger(), they can use the
non-thread safe SetLogger at the start of their program to register a
logger that has its own lock and pointer to a logger function.

Bug: 119867234
Test: logging unit tests
Change-Id: I8afffec1a6957d3bda95502a4c59493e0c5049ce
(cherry picked from commit 53d301c29b)
2020-04-23 10:33:03 -07:00
Jeffrey Huang
2f51ad7b86 Tag libstatspull and libstatssocket tests as MTS
create both 32 and 64 bit variants
fixes libstatssocket_test for 32 bit devices

Bug: 154652564
Test: make mts, adb push, adb shell all 4 tests
Change-Id: Ia6b51686c06e786b38cb3713315977533f1bb819
2020-04-22 17:13:24 -07:00
David Anderson
f81ec0e43a liblp: Fix tests for linear extent overlap.
The "OwnsSector" tests did not work if one range fit completely inside
another range. The new OverlapsWith() methods address this case.

Bug: 154277287
Bug: 154646936
Test: liblp_test gtests
Change-Id: I1a59069db4ffe4f13c45963c4847cff7b3dd3dfc
2020-04-22 14:39:04 -07:00
Nikita Ioffe
c94cff6590 Merge "Observe new apexd status value of "activated" as required." into rvc-dev am: 1b8c391c29 am: b80b857bf5
Change-Id: I8d5c3d22fcd7c4fb6a96513a1abcfe18aebc996c
2020-04-22 19:17:40 +00:00
Nikita Ioffe
b80b857bf5 Merge "Observe new apexd status value of "activated" as required." into rvc-dev am: 1b8c391c29
Change-Id: I6beaffec8578aacaa66d618d417bf94f3021d395
2020-04-22 19:00:36 +00:00
Nikita Ioffe
1b8c391c29 Merge "Observe new apexd status value of "activated" as required." into rvc-dev 2020-04-22 18:43:01 +00:00
Oli Lan
7c59fc4fb4 Observe new apexd status value of "activated" as required.
- Cherry pick of aosp/1228482

As of aosp/1224611, there is a new step in the preparation of APEXes
where init calls back into apexd after DE user data is unencrypted to
allow DE apex data to be snapshotted or restored.

aosp/1228581 introduces a new apexd.status value of "activated" that
is set once APEXes are activated but before this snapshot has occurred.

init may execute "perform_apex_config" once this has occurred, so this
CL changes init to wait for "activated" rather than "ready" before
doing this.

Bug: 148672144
Test: build & flash, check boot completes and check in logs that init
waits on the correct status value.
Merged-In: I339580bf593d3b09a5dff749ac2a5d1952bcb210
Change-Id: I71b62c9dd2f7951811606002f38612784d3d9086
2020-04-22 12:37:27 +00:00
Greg Kaiser
cb885c24fc adb: Avoid extra string construction
Bug: 150827486
Test: TreeHugger
Change-Id: Ie03062a17b98866f1bc419a7e509461cf4e6bb80
Merged-In: Ie03062a17b98866f1bc419a7e509461cf4e6bb80
2020-04-21 20:34:44 -07:00
Nikita Ioffe
71278019d1 Make /data/apex/active world readable
This will allow Phonesky to read APEXes under /data/apex/active.

Test: adb shell su 10114 dd if=/data/apex/active/com.android.tzdata@300000000.apex of=/dev/null
Bug: 154635217
Change-Id: I5278897413ca0e32aed9d1c7f82e48138bc51404
2020-04-21 21:14:59 +01:00
TreeHugger Robot
7cb9bf8981 Merge "Add /mnt/androidwritable for MOUNT_EXTERNAL_ANDROID_WRITABLE apps" into rvc-dev am: af9240abc9 am: 1cd960371b
Change-Id: Ibe7cedeaea584c509b2fe85d23cafa41ee3bae70
2020-04-21 11:30:44 +00:00
Jiyong Park
46848a6aeb Merge changes from topic "apex_available" into rvc-dev am: 132bb5f861 am: 1c092a0b4c
Change-Id: I039a1fc9342bd27b1e34b9f4ec325320f961c09b
2020-04-21 11:30:14 +00:00
Jiyong Park
07cce803f0 Set apex_available property am: a6bcd4817c am: eeb39177ac
Change-Id: Ic5fc3c6077e5fad1959ef9d3f9bc349bfcfe1c81
2020-04-21 11:30:11 +00:00
Jiyong Park
f7dcec60f0 Set apex_available property am: 5390bee3f4 am: 4cf8b21427
Change-Id: If1b74e9b8985f2f46cc32673fc8c40ad1705e695
2020-04-21 11:30:07 +00:00