Commit graph

55663 commits

Author SHA1 Message Date
Tom Cherry
077839ab23 Merge "liblog: always restore errno in logging functions" 2020-01-28 16:25:12 +00:00
Nikita Ioffe
764c1ac8ba Trigger boot animation on userspace reboot
Also reset some more properties to make bootanimation work properly.

Test: adb reboot userspace
Bug: 148172262
Change-Id: I0154d4fe9377c019150f5b1a709c406925db584d
2020-01-28 10:42:44 +00:00
Yabin Cui
15778b7439 Merge "libunwindstack: add simpleperf presumit test." 2020-01-28 03:51:44 +00:00
Maciej Żenczykowski
144f42d23d Merge "add nodad argument to ifc_act_on_address() and add it to header file" 2020-01-28 03:51:01 +00:00
Suren Baghdasaryan
5562b076b7 Merge "libprocessgroup: Prevent aggregate profiles from referencing stale ones" 2020-01-28 00:49:07 +00:00
Tom Cherry
ff464b1288 liblog: always restore errno in logging functions
Some recent changes can have these logging functions potentially set
errno.  This change places android::base::ErrnoRestorer at the entry
point of the public functions where we want to guarantee errno is
restored to ensure this will not happen again.

Test: build
Change-Id: Iab4170ab16b9c7301474a509ee42d38b370b91a4
2020-01-27 13:50:44 -08:00
Suren Baghdasaryan
8438595f21 libprocessgroup: Prevent aggregate profiles from referencing stale ones
Currently when vendor overrides a profile the profile object is being
replaced with a new one. However the old profile might have been
referenced by an aggregate profile and with such profile replacement
the aggregate profile is left referencing a stale object. Fix this by
replacing the content of the old profile with the content from the new
one instead of replacing the object itself.

Bug: 148311066
Test: override profiles referenced in aggregate profile and verify
Test: correct replacement
Change-Id: Iabddbf3580455e5263fedad6665cf52fb323e50a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2020-01-27 21:07:27 +00:00
Tom Cherry
347d6406f0 Merge "liblog: use default tag for loggability checks if no tag is provided" 2020-01-27 20:36:28 +00:00
Elliott Hughes
00ff8d7021 adb: make the push summary fit in 80 columns.
Elide $ANDROID_PRODUCT_OUT for a large saving:

  /data/: 2 files pushed. 734 files skipped. 6.5 MB/s (830776 bytes in 0.122s)
  /product/: 0 files pushed. 357 files skipped.
  /system/: 7 files pushed. 2638 files s...d. 16.3 MB/s (3785511 bytes in 0.221s)
  /system_ext/: 1 file pushed. 90 files ...d. 13.2 MB/s (1152016 bytes in 0.084s)
  /vendor/: 0 files pushed. 200 files skipped.

And drop the repeated "files" when talking about how many were skipped
for a small saving:

  /data/: 2 files pushed, 734 skipped. 6.4 MB/s (830776 bytes in 0.124s)
  /product/: 0 files pushed, 357 skipped.
  /system/: 7 files pushed, 2638 skipped. 13.8 MB/s (3785511 bytes in 0.262s)
  /system_ext/: 1 file pushed, 90 skipped. 12.2 MB/s (1152016 bytes in 0.090s)
  /vendor/: 0 files pushed, 200 skipped.

Bug: http://b/131717844
Test: adb sync
Change-Id: I9d24df49498211bc2b8dcebcc6d8bd557da214c1
2020-01-27 10:05:36 -08:00
Tom Cherry
2ec6a53a46 liblog: use default tag for loggability checks if no tag is provided
Bug: 116329414
Bug: 119867234
Test: new unit tests
Change-Id: I92a3f4f95e5f482f6fe20f17ed83c8ed367b06dc
2020-01-27 09:38:54 -08:00
Quentin Perret
16604b4141 Merge "libprocessgroup: ensure schedboost_enabled is true with uclamp" 2020-01-27 17:24:06 +00:00
David Anderson
21394f6e85 Merge "Fix mounting /data on Virtual A/B devices without metadata encryption." 2020-01-27 16:01:59 +00:00
Treehugger Robot
e32697ee3e Merge "add NOLINTNEXTLINE(google-explicit-constructor)" 2020-01-27 14:52:49 +00:00
Zimuzo Ezeozue
4858f38514 Merge "Change gid bit of /mnt/media_rw to external_storage" 2020-01-27 13:01:52 +00:00
Zimuzo Ezeozue
8e4cf5b436 Merge "Add external_storage gid" 2020-01-27 12:22:16 +00:00
Ryan Savitski
98b185a8b1 Merge "unwindstack: RegsArm64: fix harmless off by 1 + iterate GPRs contiguously" 2020-01-27 12:18:53 +00:00
Quentin Perret
64811b7b13 libprocessgroup: ensure schedboost_enabled is true with uclamp
In the current state, schedboost_enabled() is true if and only if
schedtune is in use. As a result, all tests conditioned by
schedboost_enabled() will be skipped on devices using uclamp since it is
and extension of the CPU controller.

Fix this by making schedboost_enabled() return true if either schedtune
or the CPU controller is enabled.

Bug: 44953631
Change-Id: Idaadf252c9cf411a176180ab8988d559ca8a1332
Signed-off-by: Quentin Perret <qperret@google.com>
2020-01-27 11:04:03 +00:00
Maciej Żenczykowski
041f8f5054 add NOLINTNEXTLINE(google-explicit-constructor)
Test: builds without warnings
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iac7c63816dd7bf2536c0d465ef1e845330be505b
2020-01-26 20:15:07 -08:00
Maciej Żenczykowski
9943ed2597 add nodad argument to ifc_act_on_address() and add it to header file
Test: atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia45f00ecc5eae035ed2e25d5b73008acb77fa6c2
2020-01-26 06:35:30 -08:00
David Anderson
671bd812cf Fix mounting /data on Virtual A/B devices without metadata encryption.
When using partitions backed by /data, for example during a Virtual A/B
merge or "adb remount" on a Virtual A/B device, the userdata block
device is seen as in-use when /data mounts in second-stage init. This
subsequently prevents mount() or e2fsck from working. Metadata-encrypted
devices are not affected, because dm-default-key provides a wrapping
block device that can be used exclusively.

This patch addresses the problem by detecting when userdata has
device-mapper dependencies. If it does, and the device is not
metadata-encrypted, we introduce a dm-linear wrapper around userdata.
It is created on demand, but like logical partitions, it exists until
the device reboots.

Bug: 134949511
Test: adb remount, cuttlefish boots
Change-Id: Ifbfea1591a6e58978fdaffd6ef889afabd10e270
2020-01-25 10:39:47 -08:00
Alessio Balsini
843820ee13 Set e2freefrag and e2fsdroid as required by libfs_mgr_defaults
libfs_mgr_defaults uses the e2fsdroid binary, make this dependency
explicit.
Add also e2freefrag as a dependency in preparation for filesystem
fragmentation monitoring.

Bug: 146078546
Test: m + e2freefrag on device
Change-Id: I878d1b090809861c803f6b17fbb3813e03842a50
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-01-25 13:11:17 +00:00
Yifan Hong
d66e442c21 Merge changes from topic "ramdisk"
* changes:
  Add e2fsck to fs_config
  Make ramdisk_available.
2020-01-24 22:39:35 +00:00
Zim
c1b53de450 Change gid bit of /mnt/media_rw to external_storage
To allow apps with MANAGE_EXTERNAL_STORAGE permission and therefore
external_storage gid to access unreliable volumes directly on
/mnt/media_rw/<volume>, they need access to the /mnt/media_rw path.

This change doesn't break the FUSE daemon, the only process that should
have media_rw gid in R because the FUSE daemon accesses the lower
filesystem from the pass_through bind mounts of the public volume mount
itself so it doesn't need to walk the /mnt/media_rw path itself

Test: With FUSE enabled, a reliably mounted public volume is accessible
on /storage
Bug: 144914977

Change-Id: Ia3fc9e7483894402c14fb520024e2acca821a24d
2020-01-24 22:13:58 +00:00
Josh Gao
bb7fc92ee1 Move jdwp connection abstraction from ART apex to adbd apex.
Test: ./art/tools/run-jdwp-tests.sh
Change-Id: I3114b8403f3548700a45df5d7bb72ebe727adec1
2020-01-24 12:31:59 -08:00
Yabin Cui
f667bf7b19 libunwindstack: add simpleperf presumit test.
Bug: none
Test: run `atest --test-mapping system/core/libunwindstack`.
Change-Id: I62521f63ca748bb1980282ed6399328573d4de41
2020-01-24 11:51:30 -08:00
Ryan Savitski
92237bad6a unwindstack: RegsArm64: fix harmless off by 1 + iterate GPRs contiguously
The memcpy should be for 31 GPRs, [x0, x30]. Currently it (accidentally)
also copies over the SP register (which ends up being harmless, as the
layouts match, and the value is reassigned again anyway).

Separately, I'm including an optional change for the iteration order,
since LR is the x30 GPR, it makes slightly more sense to print it
immediately after x29. However, this is a change in behaviour, so I can
undo the change if you think it's not worth it.

Tested: atest libunwindstack_unit_test
Change-Id: Ib6b81f8ee3a9a526bfabe4b09b327f083c855fb8
2020-01-24 19:50:45 +00:00
Zim
bdeaf57da3 Add external_storage gid
This gid allows processes full access to public areas of external
storage. This includes the following:
1. EmulatedVolumes: All files and directories excluding the app
specific directories under Android/
2. PublicVolumes: Including 'unreliable' volumes (USB OTG) that are
not typically accesible to ordinary apps

Apps with the MANAGE_EXTERNAL_STORAGE permission will automatically
have this gid

Test: m
Bug: 144914977
Change-Id: I17da0b2367e356edc031d063e214574463afc985
2020-01-24 16:54:03 +00:00
Daniel Rosenberg
be27975fff Merge "Support casefolded encryption" 2020-01-24 02:09:55 +00:00
Treehugger Robot
f3700b9e42 Merge "libsnapshot: fix null pointer deref" 2020-01-24 01:12:33 +00:00
Mike Ma
e3a7783686 Merge "Relax permissions on /data/misc/logd" 2020-01-24 01:04:03 +00:00
Josh Gao
427006042c Merge "Build test_com.android.adbd.apex." 2020-01-23 23:58:43 +00:00
Treehugger Robot
071c4b37e8 Merge "When encountered an unexpected status, mention it" 2020-01-23 21:30:31 +00:00
Yifan Hong
39de68cb6d libsnapshot: fix null pointer deref
Bug: 148129196
Test: TH
Change-Id: If6a628fe1bcb3006c7a21021162488a807a7f9f7
2020-01-23 12:58:25 -08:00
Treehugger Robot
b40c15e101 Merge "Move default tag from libbase to liblog" 2020-01-23 20:32:25 +00:00
Josh Gao
7da5d8a977 Build test_com.android.adbd.apex.
Build a test apex with an INT_MAX version code for the purposes of
update/rollback testing.

Test: atest adbd_e2e_tests # in internal master
Change-Id: I0e616db03dcbc940af2741dfca5b4c5f50a5a654
2020-01-23 11:55:03 -08:00
Christopher Ferris
8bf4e29e44 Merge "Properly handle empty map after read-only map." 2020-01-23 17:45:26 +00:00
Tom Cherry
69ee5dde99 Move default tag from libbase to liblog
Bug: 119867234
Test: log tags look right, libbase/liblog unit tests
Change-Id: I3670c3fdce3d0238a23a53bba2877ffed1291f9c
2020-01-23 08:39:31 -08:00
Elliott Hughes
f8c0350eaa Merge "debuggerd: remove the raw stack dump." 2020-01-23 16:07:42 +00:00
Treehugger Robot
2148b252c2 Merge "Use SOONG_HOST_OUT_EXECUTABLES" 2020-01-23 16:02:29 +00:00
Baligh Uddin
3d902d1637 Use SOONG_HOST_OUT_EXECUTABLES
Bug: 147699225
Test: m com.android.tzdata (apexer requires these executables)
Change-Id: I008d244e330d2113cb3f2dd4b6c770df3f2fac06
2020-01-23 14:09:01 +00:00
Treehugger Robot
cfd517d2a0 Merge "fastbootd: exporting more properties" 2020-01-23 07:34:09 +00:00
Daniel Rosenberg
8775ce017d Support casefolded encryption
On ext4, enable casefolding if it is requested, but not currently
enabled.

Test: Enable casefolding on device. Check fs configuration on /data
Bug: 138322712
Change-Id: I3d54ab8bf15f28cf52c5b4344aa3fa254af83d60
2020-01-22 20:33:53 -08:00
Christopher Ferris
0f40a05309 Properly handle empty map after read-only map.
Recently, the maps for an elf in memory might show up looking like:

  f0000-f1000 0 r-- /system/lib/libc.so
  f1000-f2000 0 ---
  f2000-f3000 1000 r-x /system/lib/libc.so
  f3000-f4000 2000 rw- /system/lib/libc.so

The problem is that there is logic in the code that assumed that the
map before the execute map must be the read-only map. In the case
above, this is not true. Add a new prev_real_map that will point
to the previous map that is not one of these empty maps.

This will fix the backtraces that look like this:

  #00  pc 0000000000050d58  /apex/com.android.runtime/lib64/bionic/libc.so!libc.so (offset 0x50000) (syscall+24) (BuildId: 5252408bf30e395d49ee270b54c77ca4)

To get rid of the !libc.so and the offset value, which is not correct.

Added new unit tests to verify this.
Added new offline test which an empty map between read-only and execute
map. Before this change, the backtraces had lines like
libc.so!libc.so (offset XXX) would be present.

Bug: 148075852

Test: Ran unit tests.
Change-Id: Ie04bfc96b8f91ed885cb1e655cf1e346efe48a45
2020-01-22 18:30:12 -08:00
Yifan Hong
04b932b8fd Add e2fsck to fs_config
Test: boot and look at serial console
Bug: 147347110
Change-Id: Ife664c02fa4cf86d9385caff734d2bb3e56d988f
2020-01-22 16:47:14 -08:00
Yifan Hong
7dd4553991 Make ramdisk_available.
Test: pass
Bug: 147347110
Change-Id: I9787e386e552393efc5beed5aac577be9ce1a3c5
2020-01-22 16:47:14 -08:00
Stephane Lee
223fa17c2e Merge "Populate fields for health HAL 2.1 + batteryCapacityLevel + batteryChargeTimeToFullNow" 2020-01-23 00:39:07 +00:00
Nikita Ioffe
4a787d96ce Whitelist reboot reasons related to userspace reboot failure
Test: system/core/bootstat/boot_reason_test.sh
Bug: 135984674
Change-Id: I31422329f1109273909293a83913ae801eb1fe52
2020-01-23 00:12:02 +00:00
Oliver Nguyen
38b33c09f9 Merge "Set Clang coverage environment variables." 2020-01-22 22:34:35 +00:00
Elliott Hughes
627928e059 debuggerd: remove the raw stack dump.
This takes a lot of space, isn't convincingly useful, and makes it
likely that the far more valuable stuff that comes after it gets
truncated. So let's just drop it.

Bug: http://b/139860930
Test: manual crasher, presubmit
Change-Id: Ie417ffc07e3cb17e95fdb3d183f8c87de0f34b89
2020-01-22 14:13:46 -08:00
Treehugger Robot
eba798a767 Merge "Harden /mnt/pass_through permission bits" 2020-01-22 21:30:53 +00:00