Commit Graph

28906 Commits

Author SHA1 Message Date
Tom Cherry ff6eb509aa Merge "init: Fix leaking fd and error print"
am: e87a826a1d

Change-Id: Ie807fa6321b0d0313221711999fb01897c192419
2017-03-21 20:23:47 +00:00
Treehugger Robot e87a826a1d Merge "init: Fix leaking fd and error print" 2017-03-21 20:11:09 +00:00
Christopher Ferris 46d0609097 Merge "Use the 2 space clang format for libunwindstack."
am: 4b9a555a0f

Change-Id: Ifb0a52a2f99ddd69b4fe7196b749a985b7851be5
2017-03-21 18:25:03 +00:00
Mark Salyzyn 6b5913a8b6 Merge "libcutils: fs_config() add check /oem/etc/fs_config_*"
am: c530045850

Change-Id: Idbe297f1402adb73bfa6e7bf82c39a0214752178
2017-03-21 18:24:49 +00:00
Christopher Ferris 4b9a555a0f Merge "Use the 2 space clang format for libunwindstack." 2017-03-21 18:21:19 +00:00
Treehugger Robot c530045850 Merge "libcutils: fs_config() add check /oem/etc/fs_config_*" 2017-03-21 18:13:31 +00:00
Christopher Ferris adda674466 Use the 2 space clang format for libunwindstack.
Test: NA
Change-Id: Ibf321931d1e7ac5bbe4e8479c9d706576f55e8ac
2017-03-21 10:41:45 -07:00
Mark Salyzyn 122310429f Merge changes I4077bd6a,I92c4090e,Iff579600
am: e9539eb02f

Change-Id: I28748a1f0a3e797ddd4bc76adc19f2ea308a70c8
2017-03-21 16:53:33 +00:00
Mark Salyzyn e9539eb02f Merge changes I4077bd6a,I92c4090e,Iff579600
* changes:
  libcutils: fs_config() add check /vendor/etc/fs_config_*
  libcutils: fs_config: sort files
  libcutils: fs_config: sort dirs
2017-03-21 16:49:53 +00:00
Mark Salyzyn ba9d88ebab Merge "fs_mgr: remove private/android_filesystem_config.h"
am: f5ee213a5c

Change-Id: I78230fad7c5f910433a00f96e87d26c4c8b9be0d
2017-03-21 15:20:25 +00:00
Mark Salyzyn 62c701e174 libcutils: fs_config() add check /oem/etc/fs_config_*
Add reading of vendor file-system config files
/oem/etc/fs_config_dirs and /oem/etc/fs_config_files.

Order of interpretation (for dirs and files respectively):
- /system/etc/fs_config_dirs or /system/etc/fs_config_files
- /vendor/etc/fs_config_dirs or /vendor/etc/fs_config_files
- /oem/etc/fs_config_dirs or /oem/etc/fs_config_files
- internal android_dirs[] or android_files[] structures.

No restrictions are placed on the oem file-system config files,
although the developer is advised to restrict the scope to the /oem
file-system since the intent is to provide support only for
customized portions of oem.img.

Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: I56f3fed5efa44d622a9a110937dbc949083d44ae
2017-03-21 08:15:58 -07:00
Mark Salyzyn 9ceadcb0c4 libcutils: fs_config() add check /vendor/etc/fs_config_*
Add reading of vendor file-system config files
/vendor/etc/fs_config_dirs and /vendor/etc/fs_config_files.

Order of interpretation (for dirs and files respectively):
- /system/etc/fs_config_dirs or /system/etc/fs_config_files
- /vendor/etc/fs_config_dirs or /vendor/etc/fs_config_files
- internal android_dirs[] or android_files[] structures.

No restrictions are placed on the vendor file-system config files,
although the developer is advised to restrict the scope to the /vendor
file-system since the intent is to provide support only for
customized portions of vendor.img.

Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: I4077bd6afcda2ee16189b2eb3c322af15205bbb9
2017-03-21 08:14:42 -07:00
Mark Salyzyn a45eae93f6 libcutils: fs_config: sort files
Sort android_files[] first by requirements, grouping, specificity and
finally by alphanumeric order.

Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: I92c4090eac0067e0327ac7c8dde229747893d585
2017-03-21 08:14:42 -07:00
Mark Salyzyn c4f9f4c216 libcutils: fs_config: sort dirs
Sort android_dirs[] first by requirements, grouping, specificity and
finally by alphanumeric order.

Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: Iff579600b05d7b2a0b9fc7d9e9d897e0bb69aebd
2017-03-21 08:14:42 -07:00
Mark Salyzyn f5ee213a5c Merge "fs_mgr: remove private/android_filesystem_config.h" 2017-03-21 15:14:31 +00:00
Mark Salyzyn 679942bf0d Merge "libcutils: fs_config.c code compliance"
am: b501400a76

Change-Id: Ia6188feca0185192b41259cb4be41d3f4385b17d
2017-03-21 14:51:53 +00:00
Mark Salyzyn b501400a76 Merge "libcutils: fs_config.c code compliance" 2017-03-21 14:48:32 +00:00
Felipe Leme 70fd64ec05 Merge "Don't display bugreport progress when it recedes."
am: 450c44052c

Change-Id: Ieff977589b4c41687727099868b548e0072469f8
2017-03-21 02:05:04 +00:00
Treehugger Robot 450c44052c Merge "Don't display bugreport progress when it recedes." 2017-03-21 01:58:12 +00:00
Josh Gao f9d12f272e Merge "adb: switch the jdwp control socket to SOCK_SEQPACKET."
am: 249836158e

Change-Id: Ia42f80f778b2ba78d5d6181038b144c89530f772
2017-03-20 23:28:34 +00:00
Treehugger Robot 249836158e Merge "adb: switch the jdwp control socket to SOCK_SEQPACKET." 2017-03-20 23:24:33 +00:00
Jeff Sharkey 2e86917f92 Merge "Allocate new UID for OTA update resource tracking."
am: 1ed1d3dac9

Change-Id: Ic365e6f4084d063363005cd42b66ee0799691031
2017-03-20 23:11:37 +00:00
Treehugger Robot 1ed1d3dac9 Merge "Allocate new UID for OTA update resource tracking." 2017-03-20 23:04:40 +00:00
Mark Salyzyn 166e24c91b libcutils: fs_config.c code compliance
Comply with clang-format. Adjust some comments.

Test: full build and install smoke test and inspection
Bug: 36071012
Change-Id: I459a08b4dc4333ab3d75207621a27587849386a5
2017-03-20 15:32:11 -07:00
Tom Cherry 40578ab91f init: Fix leaking fd and error print
read_file() does not close its fd if either stat() fails or the file
has group/world writable permissions.

Use unique_fd to ensure that all return paths close the fd and make
the same change to write_file() for consistency.

Replace PLOG() with LOG() after a simple if conditional, that does not
set errno.

Old:
init: skipping insecure file '/data/bootchart/header': No such device or address
New:
init: skipping insecure file '/data/bootchart/header'

Test: Cause an invalid file read and check the error log
Test: Ensure non-error read_file() and write_file() work
Change-Id: Ib15d94e38362e335d671d30b36aa5605254ec7ab
2017-03-20 14:40:02 -07:00
Mark Salyzyn e989a22553 fs_mgr: remove private/android_filesystem_config.h
Test: compile
Bug: 33241851
Change-Id: I3807871dcdfe5c751b1eea6e57c1ff5aac15806e
2017-03-20 14:30:48 -07:00
Jeff Sharkey e1bddc78bf Allocate new UID for OTA update resource tracking.
Recent changes to OTA updates started "blaming" network usage on the
system UID, which makes it difficult to triage incoming bugreports
that claim heavy network usage.  Instead, this change gives OTA
updates an explicit UID to make triage easier.

Test: builds, boots
Bug: 36130264
Change-Id: I0a0cc009f3d891b19b419bc12cd237ef8ac64519
2017-03-20 14:57:42 -06:00
Josh Gao b2a7251c55 adb: switch the jdwp control socket to SOCK_SEQPACKET.
Switch the jdwp control socket to SOCK_SEQPACKET so we don't have to
worry about short reads for the PID.

Bug: http://b/36411868
Test: adb jdwp
Change-Id: I908b88e93b1e0ca2895eb8e777d8438a7bbfa92a
2017-03-20 13:37:13 -07:00
Josh Gao 7e5b10b18c Merge "adb: detect closed jdwp socket."
am: e1c4e04f82

Change-Id: Ife55285da64e0c12dac3cd8e8171126c3bb8b543
2017-03-20 20:04:38 +00:00
Josh Gao e1c4e04f82 Merge "adb: detect closed jdwp socket." 2017-03-20 19:57:15 +00:00
Felipe Leme dedcbaad51 Don't display bugreport progress when it recedes.
Also fixed InvalidNumberArgs that broke when usage() was moved out from
bugreport.cpp.

Fixes: 26354314
Bug: 28054087
Test: m -j32 adb_test && ./out/host/linux-x86/nativetest64/adb_test/adb_test --gtest_filter=BugreportTest.*

Change-Id: I7be5ef7de0fb0d339dc80a2abc816e1c905deb22
2017-03-20 11:49:21 -07:00
Josh Gao 3fd78c922c adb: detect closed jdwp socket.
If a process opens a JDWP socket, but crashes before writing the full
PID, adbd will spin forever.

Bug: http://b/36411868
Test: none
Change-Id: I1811759e15c3d9c819685c5fc159a566bd4bc842
2017-03-20 11:11:19 -07:00
Neil Fuller f604ea0783 Merge "Track a Java package rename in comments"
am: 5a258e72fe

Change-Id: I7fcc6eb4412868bccddefbc5bde4e292f8c525a3
2017-03-20 12:53:10 +00:00
Neil Fuller 5a258e72fe Merge "Track a Java package rename in comments" 2017-03-20 12:45:50 +00:00
Neil Fuller c749c9a0a1 Track a Java package rename in comments
Some classes referenced in comments in libcore.tzdata.update2 have
moved to libcore.tzdata.shared2.

Bug: 31008728
Test: mmm system/core/tzdatacheck
Change-Id: I390b375ab8fefbb46e69f4534000ff43ffcceae8
2017-03-20 10:29:00 +00:00
Hans Boehm 12d6afe6f1 Merge "Add heuristic data race detection to sp<>"
am: 04abdc6153

Change-Id: I65a8920f2e44a34da3f3aada6536ad1a54a08ca0
2017-03-19 04:50:24 +00:00
Hans Boehm 04abdc6153 Merge "Add heuristic data race detection to sp<>" 2017-03-19 04:45:37 +00:00
Todd Poynor fa590754c7 Merge changes I1e067235,I01e44473
am: 36aa63eb44

Change-Id: I52a81f40d8fc4cb633eecab8e9aa6d8b7ae84889
2017-03-18 02:03:35 +00:00
Todd Poynor faa2c1f3db Merge "powerctl: add thermal-shutdown command"
am: 3472c1b130

Change-Id: Iad0d78b6f408bdc82740165550fbdccd00f52735
2017-03-18 01:58:06 +00:00
Treehugger Robot 36aa63eb44 Merge changes I1e067235,I01e44473
* changes:
  android_reboot: move reboot reason file to data/misc/reboot/
  libcutils: android_reboot: save reboot reason in file
2017-03-18 01:55:16 +00:00
Treehugger Robot 3472c1b130 Merge "powerctl: add thermal-shutdown command" 2017-03-18 01:50:49 +00:00
Hans Boehm 7f0b2601d3 Add heuristic data race detection to sp<>
Force assignment to read the old pointer value twice, and check
that it didn't change in the interim. Previous experience with
Skia suggests that this has a high probability of correctly detecting
a data race when it occurs, instead of potentially letting the
count associated with the old pointer value get decremented twice,
and corrupting the heap.

This does increase the size of sp assignments, which seem to
commonly get inlined. For the general case, we add a third
comparison and function call.

Some code reformatting to make this consistent with modern conventions
and pass automated checks.

Test: Booted aosp build. Ran libutils tests. Looked at generated code.

Bug: 31227650

Change-Id: Id93a05c6bf10f01ee15ff1bb409611f2058f988f
2017-03-17 17:47:28 -07:00
Todd Poynor e63f366ee3 android_reboot: move reboot reason file to data/misc/reboot/
Move last reboot reason file to new directory data/misc/reboot/ to
require only SELinux permissions specific to this new file.

Bug: 30994946
Test: manual: reboot command, setprop sys.powerctl
Change-Id: I1e067235aa4b06391cff8ab0741a9d317ba5b7da
2017-03-17 17:27:36 -07:00
Todd Poynor eac33da63b libcutils: android_reboot: save reboot reason in file
Save a string identifying the reason for last Android reboot or power
off in file /data/misc/recovery/last_reboot_reason .  This file may
be used for informing users of reboot or shutdown reasons at next
boot, and for other diagnostic purposes.

Bug: 30994946
Test: Manual: reboot, setprop sys.powerctl
Change-Id: I01e44473fdd21b33e9e4dced77aba9a66b6d3755
2017-03-17 17:26:57 -07:00
Todd Poynor 16663a2aa4 powerctl: add thermal-shutdown command
Add sys.powerctl property interface for initiating thermal shutdown.

Bug: 30994946
Test: Manual: setprop sys.powerctl thermal-shutdown
Change-Id: Iffce60bd3cb4b40a5859623d10b91bee5101f168
2017-03-17 17:16:40 -07:00
Tom Cherry d5a201cafe Merge "init: cleanup is_first_stage conditionals"
am: 1d1de8e282

Change-Id: I634e43d40165cddab25c2557839105be0dc27481
2017-03-17 19:46:55 +00:00
Treehugger Robot 1d1de8e282 Merge "init: cleanup is_first_stage conditionals" 2017-03-17 19:41:38 +00:00
Alex Deymo f27b3da9eb Merge "Update qtaguid tag/untag documentation."
am: 499a0479fa

Change-Id: If601fb9b274f4c0e53c4b6eb066e684822a191db
2017-03-17 19:35:58 +00:00
Treehugger Robot 499a0479fa Merge "Update qtaguid tag/untag documentation." 2017-03-17 19:30:45 +00:00
Mark Salyzyn 9149de0d5c Merge "liblog: test: *.android_errorWriteWithinfoLog__android_logger_list_read__*"
am: 41e54267f3

Change-Id: Ib3aa841d8c97ae83aa10a21f264f8e1bc4411985
2017-03-17 18:41:50 +00:00