Commit graph

42637 commits

Author SHA1 Message Date
Suren Baghdasaryan
3693441d9b lmkd: rate-limit and cleanup failed kill reports
Excessive number of failed kill reports when lmkd can't find an eligible
process to kill or frees not enough memory pollutes logs and bugreports.
Cleanup kill reports to remove duplicate information and rate limit failed
kill attempts at 1 report per sec. The number of suppressed failed kills
will be reported in the next lmkd report.

Bug: 113864581
Test: Verified using lmkd_unit_test
Change-Id: I67fa1fec97613f136c7582115edcbc56b1503c9c
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-06 01:59:49 +00:00
Bernie Innocenti
b92fd62daa Merge "Delete sysutils/List.h" 2018-09-06 01:13:46 +00:00
Treehugger Robot
8c0a3e0a7d Merge "fastbootd: Implement getvar hw-revision." 2018-09-06 00:55:32 +00:00
Treehugger Robot
850cbda465 Merge "logcat: fix print of logcat -g" 2018-09-06 00:08:39 +00:00
Idries Hamadi
5b6bf94716 Remove fastdeploy dependency on libandroidfw
Call aapt2 to determine package name instead of parsing APK within process.

Test: mm
Test: adb install -r -f --force-agent --local-agent ~/example_apks/example.apk
Test: adb install -r -f --no-streaming --force-agent --local-agent ~/example_apks/example.apk
Change-Id: I99b2c64f0617a9bb27a5c54a2e8f39efd5028f36
2018-09-05 15:59:20 -07:00
Suren Baghdasaryan
ca2d03ebdb Merge "lmkd: Introduce system property to get minfree and oom_adj levels" 2018-09-05 22:53:11 +00:00
Treehugger Robot
950ec1a001 Merge "fastbootd: Perform CRC check when flashing sparse images." 2018-09-05 22:12:32 +00:00
Treehugger Robot
6e66d36c24 Merge "fastbootd: Fix getvar max-download-size formatting." 2018-09-05 22:11:40 +00:00
Treehugger Robot
28c9539697 Merge "adb: static constexpr." 2018-09-05 21:57:41 +00:00
Treehugger Robot
61b6c5cdfe Merge "Remove request for read access to partitions." 2018-09-05 21:45:24 +00:00
Tom Cherry
11f12099cc fastboot: remove command queue
There is little advantage and increasingly much disadvantage to
queueing up fastboot commands before executing them.  This change
removes the queue in the most simple way possible to enable further
clean up.

Test: fastboot works
Change-Id: I9abab05df07ed167dbe6a42e1eb9eab8f8d4f157
2018-09-05 14:28:47 -07:00
Treehugger Robot
484f72abbf Merge "adb: win32: fix ReportServerStartupFailure" 2018-09-05 21:24:33 +00:00
Wei Wang
c27d481695 logcat: fix print of logcat -g
The units should be byte instead of bit and multiplier are kibibyte
mebibyte gibibyte respectively.

Bug: 114062206
Test: Build and logcat -g
Test: ./logcat-unit-tests
Change-Id: I995faa9a340bb63f48d117a1b8590e5d74ac1bba
2018-09-05 14:11:18 -07:00
Mark Salyzyn
fd27e9a56e fs_mgr: liblp: delete all MetadataBuilder copy and move constructors
Test: compile
Bug: 109821005
Change-Id: I21524cba1d183bd53ba89153a45a1483dd315ebf
2018-09-05 14:09:36 -07:00
Treehugger Robot
76bf370306 Merge "fs_mgr: liblp: add check failure for sectors_per_block" 2018-09-05 21:00:09 +00:00
Treehugger Robot
91a25771e0 Merge "adb: really make kill-server wait for server death" 2018-09-05 20:02:34 +00:00
David Anderson
c091c176cb fastbootd: Implement getvar hw-revision.
Bug: 78793464
Test: fastboot getvar hw-revision works
      fuzzy_fastboot Conformance.GetVarRevision passes

Change-Id: I5a3e9893d61e18567f2f818ef06cad8e862d637f
2018-09-05 12:52:15 -07:00
David Anderson
56843eec45 fastbootd: Perform CRC check when flashing sparse images.
Bug: 78793464
Test: fuzzy_fastboot Conformance.SparseCRCCheck passes
Change-Id: I717fbec42599a43bafafa1f73837e115a9f9109a
2018-09-05 12:52:15 -07:00
David Anderson
28b81cdc91 fastbootd: Fix getvar max-download-size formatting.
Bug: 78793464
Test: fuzzy_fastboot Conformance.GetVarDownloadSize passes
Change-Id: I8f33cb01e5b2ba66eab91b2481322d7fae593cf0
2018-09-05 12:52:14 -07:00
Christopher Ferris
4a16630270 Merge "Add Start/Stop/Reset to CapturedStdFd." 2018-09-05 19:50:51 +00:00
Elliott Hughes
86ab9ff8a2 adb: static constexpr.
Also inline some single-use constants.

Bug: N/A
Test: ran tests
Change-Id: I1ac028667772599291da402120a270d0667fed04
2018-09-05 12:13:11 -07:00
Hridya Valsaraju
3ffed21262 Remove request for read access to partitions.
It is not needed for flash or erase.

Bug: 113648914
Test: fastboot flashall
Change-Id: I34ba57ac809934556569e3b38ab594969860882a
2018-09-05 12:11:13 -07:00
Treehugger Robot
f33d19ff21 Merge "libbase: add Fdopen that takes a unique_fd." 2018-09-05 18:16:46 +00:00
Suren Baghdasaryan
314a505710 lmkd: Introduce system property to get minfree and oom_adj levels
Introduce sys.lmk.minfree_levels system property to allow minfree level
reporting. The format for this property is:

<minfree 1>:<oom_adj 1>, <minfree 2>:<oom_adj 2>, ...

Max number of minfree levels is 6 and they are specified in the
increasing order. For example:

sys.lmk.minfree_levels=18432:0,23040:100,27648:200,32256:300,55296:900,80640:906

sys.lmk.minfree_levels updates are ratelimited to once per second in order
to prevent DoS attacks.

Bug: 111521182
Test: getprop sys.lmk.minfree_levels returns expected value
Change-Id: I80d75d6836650b12457d6a99ca88898535837a97
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-09-05 10:54:22 -07:00
Treehugger Robot
54ecb7f1b3 Merge "fs_mgr: liblp: spelling mistake" 2018-09-05 16:15:05 +00:00
Elliott Hughes
60ba9943ed Merge "adb: syntax_error: add compile time format string checking" 2018-09-05 15:56:10 +00:00
Mark Salyzyn
9fa35cc170 fs_mgr: liblp: add check failure for sectors_per_block
Test: compile
Bug: 109821005
Change-Id: I88bf4c785c6f46a308c1d8b09edcbde53e29a004
2018-09-05 07:43:35 -07:00
Mark Salyzyn
538f1bbf74 fs_mgr: liblp: spelling mistake
Test: compile
Change-Id: Iebd857c430185019b462381222731835c0ce2408
2018-09-05 07:43:15 -07:00
Bernie Innocenti
11b33690e4 Delete sysutils/List.h
Convert the last user to a regular std::vector, and then put List.h out
of its misery.

Turns out there's another copy of this ancient header:
system/core/libutils/include/utils/List.h. This one is included in
various places, but most don't actually use it. There seems to
be a case for a tool to detect unused headers...

Test: m
Change-Id: Ie457bf5e06f6082537f5de2e1fefe7f05a1f0792
2018-09-05 21:07:23 +09:00
Anton Hansson
1f8147fb19 Merge "Make sync and remount support product_services." 2018-09-05 11:00:35 +00:00
Treehugger Robot
4931a29f6d Merge "adb: win32: fix Ctrl-C of adb server nodaemon" 2018-09-05 04:47:28 +00:00
Treehugger Robot
481e9a0a72 Merge "fastbootd: Fix partition size testing issues." 2018-09-05 01:39:15 +00:00
Spencer Low
a00f91b4c1 adb: syntax_error: add compile time format string checking
Test: mma

Change-Id: I8eccd17a1feac0dd98fb317d30ab27489b803669
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2018-09-04 18:08:49 -07:00
David Anderson
82a098ce7d Merge "fuzzy_fastboot: Use uint64_t for partition sizes." 2018-09-05 00:41:31 +00:00
David Anderson
5ee058d74c Merge "fastbootd: Fix transport ownership." 2018-09-05 00:37:12 +00:00
David Anderson
4758967bf9 fastbootd: Fix partition size testing issues.
Partition sizes must be reported with an "0x" prefix for fuzzy_fastboot.
Also, with dynamic partitions, the size of a partition can be 0.

Bug: 78793464
Test: fuzzy_fastboot Conformance.PartitionInfo does not error on
      partition sizes when using fastbootd

Change-Id: I4148440bd9ed420878940829618cbf8cee85bf6a
2018-09-04 16:25:06 -07:00
David Anderson
6c30f6e3d2 fuzzy_fastboot: Use uint64_t for partition sizes.
Bug: N/A
Test: fuzzy_fastboot Conformance.PartitionInfo passes
Change-Id: I27182585a1522d22dd3ddfe83ce22e06dd7fc762
2018-09-04 15:58:28 -07:00
Treehugger Robot
5efd2abee5 Merge "Make unzip available." 2018-09-04 22:56:56 +00:00
David Anderson
03de645aac fastbootd: Fix transport ownership.
This change moves Transport ownership back out of FastBootDriver.
Callers of set_transport must ensure that the previous transport is
destroyed. In addition, deleting a transport now ensures that it is
closed.

Bug: 78793464
Test: fastboot, fuzzy_fastboot works
Change-Id: I8f9ed2f7d5b09fd0820b2677d087a027378f26db
2018-09-04 15:01:12 -07:00
Christopher Ferris
eea85c9aab Add Start/Stop/Reset to CapturedStdFd.
Move the fd() function to be private since it should not have been
exposed in the first place.

Fix the way logging_test uses CapturedXXX.

Adding this because the new isolated testing doesn't print errors to
stderr so the ASSERT_ EXPECT_ messages can get swallowed. Also, it's easier
to reuse a CapturedXXX object in a test with these functions.

Test: New unit tests pass.
Change-Id: I38b113fc184146ce434802f80a9b7997fa83e78a
2018-09-04 14:29:23 -07:00
David Anderson
33dcdb808b Merge "fastbootd: Implement getvar all." 2018-09-04 20:41:54 +00:00
Elliott Hughes
ab08933f97 Make unzip available.
Bug: N/A
Test: N/A
Change-Id: I7f7a2e5d494536e5eb5f5e8744af224f31351c15
2018-09-04 13:33:30 -07:00
Josh Gao
a3c868879c libbase: add Fdopen that takes a unique_fd.
Using fdopen with unique_fd correctly is more annoying than it should
be, because fdopen doesn't close the file descriptor received upon
failure, which means you have to something like the following:

    unique_fd ufd = ...;
    int fd = ufd.release();
    FILE* file = fdopen(fd, "...");
    if (!file) {
        close(fd);
        return;
    }

Add an android::base::Fdopen that does that dance for you.

Bug: http://b/113880863
Test: treehugger
Change-Id: I6325acf1ff06484005c1053fe09672c5eeeecaa1
2018-09-04 13:13:50 -07:00
David Anderson
304308ca3f Merge "fastbootd: Refactor for getvar all." 2018-09-04 19:45:39 +00:00
Treehugger Robot
d230bcf4b0 Merge "Fix disagreement of client_id/app_data pointer semantic" 2018-09-04 19:43:03 +00:00
Janis Danisevskis
56c533dfd9 Fix disagreement of client_id/app_data pointer semantic
KM1/KM2 implementations should treat nullptr and KeymasterBlob{nullptr, 0}
equally when passed in as client_id or app_data. However, trusty KM1
treats them differently.

Bug: 113110105
Bug: 113084196
Change-Id: Ie0e2b5d60d808e4f7a8e48aeb4c694268f9bc0a1
2018-09-04 19:42:10 +00:00
Treehugger Robot
aa31cfcd5c Merge "llkd: Add stack symbol checking" 2018-09-04 19:26:08 +00:00
Spencer Low
50beee3a2c adb: win32: set thread names
Use a new Windows 10 API, SetThreadDescription(). Background info from a Chrome developer:

https://randomascii.wordpress.com/2015/10/26/thread-naming-in-windows-time-for-something-better/

Test: Win10, Vista, adb shell
Test: Ran windbg -pn adb.exe, used .dump /ma to create a dump, ran
`dx -g @$curprocess.Threads' on the dump and it showed the thread names.

Change-Id: I14ea7121605cb3fa45ce7b59e2ba5882a215b59f
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2018-09-03 16:11:33 -07:00
Treehugger Robot
07fd6d029b Merge "Remove unused ART build dependencies" 2018-09-03 07:57:22 +00:00
Spencer Low
40babf0709 adb: win32: fix ReportServerStartupFailure
The code was passing an fd from adb_open() to android::base::ReadFdToString() which actually
takes a C-Runtime fd (on Windows), so it wasn't working.

The fix is to use APIs that deal with C-Runtime fds:
* unix_open()
* android::base::unique_fd
* unix_lseek() (added in this change)

I also removed an unnecessary call to GetProcessId() since we already have the process id
from the structure returned by CreateProcess().

Test: adb start-server on Win10 and Ubuntu (with a failing server)
Test: mma

Change-Id: Id6e2dd5532a02fe5d9caf96aa007a1b3434a0b59
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2018-09-02 19:26:25 -07:00