Commit graph

2304 commits

Author SHA1 Message Date
Sergio Giro
896c6b14ae Merge "LruCache: avoid copying keys in lookup" 2016-07-20 19:38:47 +00:00
Sergio Giro
4c56e0a222 LruCache: avoid copying keys in lookup
Create objects of type KeyedEntry for lookups that only have
a key reference

Bug: 27567036
Change-Id: I5e609a3db63d3b9277ff1547a3cca37dce70251c
2016-07-20 18:38:44 +00:00
Elliott Hughes
f58dc88f56 Merge \\\"Remove no-op klog_init.\\\" am: 5558cd362b am: 8932be864d
am: 30fc292a26

Change-Id: Ie40c73c1593e06392d042eb855b8bcb678d59b30
2016-07-19 19:54:04 +00:00
Elliott Hughes
30fc292a26 Merge \\"Remove no-op klog_init.\\" am: 5558cd362b
am: 8932be864d

Change-Id: I90466cd911100735e7c8ec88fd5d680b5ae9d8fe
2016-07-19 19:51:09 +00:00
Elliott Hughes
8932be864d Merge \"Remove no-op klog_init.\"
am: 5558cd362b

Change-Id: I3f2112bead6740f1df48bc5b028f62c91d40425b
2016-07-19 19:48:36 +00:00
Elliott Hughes
489e3fbaa0 Remove no-op klog_init.
Change-Id: I467edad1d004ac16647f4aa1f0eead04e808efa0
2016-07-19 11:45:36 -07:00
Robert Sesek
d257784aee Merge \\\"Add static UID for the webview zygote process.\\\" am: 07f5d8cc0c am: ed1c074303
am: 15166f96d9

Change-Id: I36aba1b85750e81f956b29d3ab2742f7fa9e49a4
2016-07-15 21:12:25 +00:00
Robert Sesek
15166f96d9 Merge \\"Add static UID for the webview zygote process.\\" am: 07f5d8cc0c
am: ed1c074303

Change-Id: Ie411759bd011b424d619e3949e29e1fdaf08ba91
2016-07-15 21:08:54 +00:00
Robert Sesek
ed1c074303 Merge \"Add static UID for the webview zygote process.\"
am: 07f5d8cc0c

Change-Id: I7d2382f3e61a405a9b838b02983aa8dbf9aedc74
2016-07-15 21:05:25 +00:00
Treehugger Robot
07f5d8cc0c Merge "Add static UID for the webview zygote process." 2016-07-15 20:58:50 +00:00
Sergio Giro
71d9f83fa9 Merge \"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\" into nyc-dev
am: 757f4ef340

Change-Id: I29dfaa3968597fc3b0cdadd140b5790c1e61008d
2016-07-14 18:08:00 +00:00
Sergio Giro
28f28ce635 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 2806397d1e
am: 8c9d02551c

Change-Id: Ia8754c27d2d2a639280235c2dbf9043f3442421e
2016-07-14 17:59:56 +00:00
Sergio Giro
2806397d1e DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 17:25:27 +00:00
Sergio Giro
3411dd4457 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit c4966a363e)
2016-07-14 16:49:50 +01:00
Sergio Giro
b022447a3a DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Change-Id: Idfb0eb29b305678608586d25c2f372146569ad39
Bug: 29250543
2016-07-14 14:47:59 +00:00
Sergio Giro
570dbfb8b8 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
(cherry picked from commit c4966a363e)
2016-07-14 13:40:43 +00:00
Sergio Giro
3841c92912 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 5fce0542b6
am: d0ad14ca21

Change-Id: Id0901a86ea469d664badfee75db32948c88e72f7
2016-07-14 12:55:58 +00:00
Sergio Giro
5fce0542b6 DO NOT MERGE libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)

Bug: 29250543
Change-Id: Ia2d6a550f5594280505fb0835c752e53898700ed
2016-07-14 12:34:30 +00:00
Sergio Giro
e059f5e325 Revert \\\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613 am: 80473d5d33
am: c06d338ad7

Change-Id: I4ee28f7eb936464eeee476b9fedb19aa7fb96ac0
2016-07-13 13:01:47 +00:00
Sergio Giro
c06d338ad7 Revert \\\\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d am: 605de74373 am: 37826f5613
am: 80473d5d33

Change-Id: Ia5cb6e89924e69df568d633472656dd4b0c12a76
2016-07-13 12:58:09 +00:00
Sergio Giro
37826f5613 Revert \\\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\\" am: 311002936e am: ddd0051968 am: b218b2d34d
am: 605de74373

Change-Id: Ib58bd045e59fcfcf449b346861b5427d07fba9c6
2016-07-13 12:51:06 +00:00
Sergio Giro
605de74373 Revert \\\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\\" am: 311002936e am: ddd0051968
am: b218b2d34d

Change-Id: Iced8e47993a39103aed3deafb5deb974995ecdba
2016-07-13 12:47:25 +00:00
Sergio Giro
b218b2d34d Revert \\"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\\" am: 311002936e
am: ddd0051968

Change-Id: Ia2a422c170a0d700a1d4d55ea920361689a9be8b
2016-07-13 12:44:00 +00:00
Sergio Giro
311002936e Revert "libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8"
This reverts commit 53473c1607.

Change-Id: I27379317e08ecbd5e3b95b7ece58194838ab6c21
2016-07-13 11:47:53 +00:00
Sergio Giro
6025b216e4 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0 am: fd7bd2dfef am: 498ffa62c5 am: 5e4ebd02d4
am: d837e74381

Change-Id: Ie620548a78c92d2160db4395f00c6ec9f281e937
2016-07-13 09:55:54 +00:00
Sergio Giro
d837e74381 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0 am: fd7bd2dfef am: 498ffa62c5
am: 5e4ebd02d4

Change-Id: Ib2eb019edba21cd3ba3e22d745818d30c912ce62
2016-07-13 09:52:14 +00:00
Sergio Giro
498ffa62c5 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c am: 29ccafe5f0
am: fd7bd2dfef

Change-Id: I24df8d8b13987ea0f99be6d4e9f49d52a1c4f58b
2016-07-13 09:44:52 +00:00
Sergio Giro
fd7bd2dfef libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607 am: 41e6690d0c
am: 29ccafe5f0

Change-Id: If7c24750afcae3a4b73885b2c4fb9b99ffca5c45
2016-07-13 09:41:12 +00:00
Sergio Giro
29ccafe5f0 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8 am: 53473c1607
am: 41e6690d0c

Change-Id: I0f7707c88684f9cc24fff878d3d3751b6025227f
2016-07-13 09:37:36 +00:00
Sergio Giro
53473c1607 libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

(cherry picked from commit c4966a363e)
(changed code for safetynet logging due to lack of sstream and string in klp)

Change-Id: If50d59a91a13fddbff9a8fff0d3eebe57c711e93
Bug: 29250543
2016-07-12 18:39:11 +01:00
Greg Kaiser
e3d5dfb514 Merge \\\"RefBase: Silence compiler warnings\\\" am: f76ca2a43b am: 3b43562535
am: 0c9b9ec4dc

Change-Id: I5ad8747c490bf655ced9f58ecfec2e9c3ed8c436
2016-07-12 00:18:06 +00:00
Greg Kaiser
3b43562535 Merge \"RefBase: Silence compiler warnings\"
am: f76ca2a43b

Change-Id: I4a146e36db49fc336baa7a59f8fbea0ca1dbb084
2016-07-12 00:15:19 +00:00
Treehugger Robot
f76ca2a43b Merge "RefBase: Silence compiler warnings" 2016-07-12 00:10:24 +00:00
Greg Kaiser
d9885e7edb RefBase: Silence compiler warnings
We comment out the names of the parameters we're intentionally
not using.

(cherrypick of 44a0eb4d8cdf4ab881f5d5a1acc1155266a46f6a.)

Change-Id: I0a92d9200ca26cdc4700d2ff9e3ab33c102520d5
2016-07-11 16:11:30 -07:00
Robert Sesek
e782a44575 Add static UID for the webview zygote process.
This UID will never own any files.

Bug: 21643067
Change-Id: Ifc887b1033ed4564336c8552012fb6bd0de73c15
2016-07-11 12:39:55 -04:00
Sergio Giro
502602366c Merge \"libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8\" into nyc-mr1-dev
am: 7714abac6b

Change-Id: I63e0299219dc1e50b31a88384fed7f3f43e9f86e
2016-07-11 12:22:43 +00:00
Sergio Giro
7714abac6b Merge "libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8" into nyc-mr1-dev 2016-07-11 12:11:32 +00:00
Sergio Giro
c4966a363e libutils/Unicode.cpp: Correct length computation and add checks for utf16->utf8
Inconsistent behaviour between utf16_to_utf8 and utf16_to_utf8_length
is causing a heap overflow.

Correcting the length computation and adding bound checks to the
conversion functions.

Test: ran libutils_tests
Bug: 29250543
Change-Id: I6115e3357141ed245c63c6eb25fc0fd0a9a7a2bb
2016-07-11 09:46:32 +00:00
Elliott Hughes
6605b0b23a Merge \\\"Make klog_fd thread-safe and make klog_init a no-op.\\\" am: 588b770063 am: 73d363bbc1
am: 7288ac3982

Change-Id: I46bbcb64eecc01ec7bd8bb502237c1b9057befc4
2016-07-08 17:12:48 +00:00
Elliott Hughes
73d363bbc1 Merge \"Make klog_fd thread-safe and make klog_init a no-op.\"
am: 588b770063

Change-Id: I884276a8f8b8209f6e956c5fb410e8265184e1b5
2016-07-08 17:05:25 +00:00
Elliott Hughes
588b770063 Merge "Make klog_fd thread-safe and make klog_init a no-op." 2016-07-08 17:01:13 +00:00
Erik Kline
5f7ecd953a Merge \\\"Add UIDs for system DNS and tethering DNS\\\" am: c4dc4f3fc2 am: fcf3ed51dc
am: 9f31416013

Change-Id: I2ad186412133603a36d91801737d15d4441d4956
2016-07-08 08:55:14 +00:00
Erik Kline
3c2e2f4d5e Add UIDs for system DNS and tethering DNS
Bug: 29420831
Bug: 29881876
Change-Id: I7a48f980f0e52a3d322c4c02988d48fc6df643ca
(cherry picked from commit d63cf7d85a)
2016-07-08 17:49:40 +09:00
Erik Kline
fcf3ed51dc Merge \"Add UIDs for system DNS and tethering DNS\"
am: c4dc4f3fc2

Change-Id: I40d246a3d4c293797ae5204cebd61b50c4021205
2016-07-08 08:48:11 +00:00
Treehugger Robot
c4dc4f3fc2 Merge "Add UIDs for system DNS and tethering DNS" 2016-07-08 08:43:55 +00:00
Mark Salyzyn
6a70a53235 Merge \\\"logcat: format verbs and adverbs\\\" am: 82fb012a03 am: b13d0ce160
am: b6dbe28746

Change-Id: I277fbcebeeffd237adf63831be715eabfaf8d758
2016-07-06 20:36:27 +00:00
Mark Salyzyn
b13d0ce160 Merge \"logcat: format verbs and adverbs\"
am: 82fb012a03

Change-Id: I1f897abc493f63195fff505c37746ee9e82cfac1
2016-07-06 20:27:29 +00:00
Mark Salyzyn
9cfd1c6ebc logcat: format verbs and adverbs
Bug: 29916087
Change-Id: I039c95b9dc0aa88f1219121513899934381453ae
2016-07-06 11:16:07 -07:00
Dan Stoza
5d636e830f NativeWindow: Add LAST_[DE]QUEUE_DURATION queries
am: 94ededa387

Change-Id: I4fb6c849cf97dcd70cc7b7345e230238870e7d3a
2016-07-06 16:27:37 +00:00
Erik Kline
d63cf7d85a Add UIDs for system DNS and tethering DNS
Bug: 29420831
Bug: 29881876
Change-Id: I7a48f980f0e52a3d322c4c02988d48fc6df643ca
2016-07-06 11:13:59 +09:00
Dan Stoza
94ededa387 NativeWindow: Add LAST_[DE]QUEUE_DURATION queries
Adds two new enums to enable querying the duration of the last
dequeue or queue operations to a Surface/ANativeWindow.

Bug: 29413700
Change-Id: Ifa16755911c4a3c013a7128dd4038d328109c32d
2016-07-01 16:07:00 -07:00
Elliott Hughes
171a829c39 Make klog_fd thread-safe and make klog_init a no-op.
I'll come back and remove klog_init when I've removed other calls to it.

Change-Id: Iad7fd26d853b4ddc54e9abd44516b6f138cbbfcb
Test: booted N9, looked at "adb shell dmesg" output.
2016-06-29 16:16:41 -07:00
Courtney Goeltzenleuchter
b7d9991277 Add color mode enums
am: bf8132a7c1

Change-Id: I9fcf65efe519cc41358f5031741b5c4d3024cd9f
2016-06-22 00:18:20 +00:00
Courtney Goeltzenleuchter
bf8132a7c1 Add color mode enums
The android_color_mode_t defines the color modes supported
by a display. A display can support multiple different
color modes.

sRGB mode and AdobeRGB are deliberately placed at 7 and 8
so that they match mode ID's used on prior devices.

bug: http://b/27926012
Change-Id: I9ab41b56ec0b495c02539665da5be158ffddf843
2016-06-21 14:47:23 -06:00
David 'Digit' Turner
3a72d0fc79 Merge \\\"[qemu]: Move qemu_pipe.h from include/system/ directory.\\\" am: 44b7339aa2 am: 1c01bae82a
am: 6bcf0cf1e7

Change-Id: I85589757feb3aac19469afd97b8e98a74373acab
2016-06-21 08:10:38 +00:00
David 'Digit' Turner
1c01bae82a Merge \"[qemu]: Move qemu_pipe.h from include/system/ directory.\"
am: 44b7339aa2

Change-Id: I59b9a896058dea76f69b9ba757890d4a42952a66
2016-06-21 08:05:18 +00:00
David Turner
44b7339aa2 Merge "[qemu]: Move qemu_pipe.h from include/system/ directory." 2016-06-21 07:38:02 +00:00
Elliott Hughes
9f240487dd Merge \\\"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\\\" am: e0dfd2a00e am: a1d9edfbf3
am: 95bafa7cdd

Change-Id: Icd04c56368113feb86d1cf9d66a1e04124e5ef58
2016-06-21 02:12:01 +00:00
Elliott Hughes
a1d9edfbf3 Merge \"Use __ with attribute __noreturn__ to avoid colliding with noreturn.\"
am: e0dfd2a00e

Change-Id: I93779cd1785db5d277df21dffe1896edd40df7fb
2016-06-21 02:02:25 +00:00
Treehugger Robot
e0dfd2a00e Merge "Use __ with attribute __noreturn__ to avoid colliding with noreturn." 2016-06-21 01:52:04 +00:00
Elliott Hughes
665051ca63 Use __ with attribute __noreturn__ to avoid colliding with noreturn.
Change-Id: I5a73ec69b580b2e70b2c68177078fa56b8353c19
2016-06-20 17:21:59 -07:00
Josh Gao
fd94eae2e4 Merge changes from topic \\\'debuggerd_client\\\' am: abf88685e3 am: 88347e1430
am: 48915ad5e0

Change-Id: I48668c7a5c36b8786b919eb19c30fdcb2b3e417c
2016-06-20 20:52:41 +00:00
Josh Gao
88347e1430 Merge changes from topic \'debuggerd_client\'
am: abf88685e3

Change-Id: I2a61e4e8b5ec5a4ab6566ab4f8eb31653255fbc5
2016-06-20 20:47:18 +00:00
Treehugger Robot
abf88685e3 Merge changes from topic 'debuggerd_client'
* changes:
  adb: use libdebuggerd_client.
  debuggerd: add libdebuggerd_client.
2016-06-20 20:22:18 +00:00
Christopher Ferris
7d14cf44f3 Merge \\\"Fix race condition updating local map data.\\\" am: 863d8e11b9 am: e1eb2272d6
am: 942c77793f

Change-Id: I062600c36ff36e810e4749475702a232fd13b446
2016-06-18 00:13:58 +00:00
Christopher Ferris
e1eb2272d6 Merge \"Fix race condition updating local map data.\"
am: 863d8e11b9

Change-Id: I00899ce500c2ae8bc58b6eb42c01d8688dd232c0
2016-06-18 00:05:26 +00:00
Josh Gao
9c02dc5916 debuggerd: add libdebuggerd_client.
Bug: http://b/24414818
Change-Id: I079c534d2c952b6975bf0428eb86cc7a55525737
2016-06-17 13:11:29 -07:00
David 'Digit' Turner
c7b098ceb5 [qemu]: Move qemu_pipe.h from include/system/ directory.
The <hardware/qemu_pipe.h> header isn't related to any loadable
hardware module, this patch thus relocates it to <system/qemu_pipe.h>
which is a much more logical location.

Note the following changes:

  - The pipe name must begin with the 'pipe:' prefix to avoid an
    un-necessary snprintf() and buffer copy.

  - Does not probe for the obsolete /dev/goldfish_pipe device, i.e.
    only use /dev/qemu_pipe instead.

  - Use QEMU_PIPE_DEBUG() instead of D() as the debugging macro.

+ Update ADB to use the newest <system/qemu_pipe.h>

+ Add qemu_pipe_frame_send() and qemu_pipe_frame_recv() utility
  functions which replace the obsolete qemud_channel_send() and
  qemud_channel_recv() from the defunct <hardware/qemud.h>
  header.

BUG=25875346

Change-Id: Ic290a5b79d466c2af64b49bd9134643277c11bfd
2016-06-17 09:21:59 +02:00
Christopher Ferris
3a14004c7f Fix race condition updating local map data.
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.

In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.

Bug: 29387050
Change-Id: Ie34822c3d8fd3bdb3dd126aeeb399969c36508c1
2016-06-16 23:28:11 -07:00
Lajos Molnar
a571d887a2 Merge \"add android_flex_layout for describing all flexible formats.\" into nyc-mr1-dev
am: c873d44942

Change-Id: I57c6c6e708935841b9195f2be3ea7becef3a8dbd
2016-06-14 20:04:09 +00:00
Dan Stoza
c873d44942 Merge "add android_flex_layout for describing all flexible formats." into nyc-mr1-dev 2016-06-14 19:59:38 +00:00
Pablo Ceballos
9cf6a9ef13 Merge \"Header changes for getFrameTimestamps\" into nyc-mr1-dev
am: 0398ec6326

Change-Id: I8d1ba8321d60407ed4eca6a50554707ceaefd3ce
2016-06-09 21:15:42 +00:00
Pablo Ceballos
c2efc32a0f Header changes for getFrameTimestamps
Change-Id: Iee9e0485544fac435e800ea869a8e4c2ed90bba9
2016-06-04 03:36:40 +00:00
Josh Gao
771c1ed582 Merge "cutils: don\'t fortify property_get on clang." am: 310da0b990
am: 2a1f209245

* commit '2a1f20924516b41e22adb766b6751869fb5c3af4':
  cutils: don't fortify property_get on clang.

Change-Id: Idd7402dca16633fa19e2110b6d74b005b3e519f9
2016-06-03 19:46:05 +00:00
Treehugger Robot
310da0b990 Merge "cutils: don't fortify property_get on clang." 2016-06-03 19:29:12 +00:00
Lajos Molnar
276f382722 add android_flex_layout for describing all flexible formats.
Bug: 22767098
Bug: 24759202
Change-Id: I61e4ca9bd71e8da88a9571ec4effc7165026715b
2016-06-03 00:59:30 +00:00
Josh Gao
74ebdf3c8e cutils: don't fortify property_get on clang.
clang doesn't do the frontend inlining/dead code elimination needed for
the fortified implementation to work. Therefore, turn it off.

Bug: http://b/28381737
Change-Id: Ie8dd970e3908b1daaa587ad2bd041e8f6e2089db
2016-06-02 15:29:11 -07:00
Calin Juravle
65d7c4722c Merge "Add utility to prepare files in a similar way to directories" into nyc-dev
am: 6a29fe931d

* commit '6a29fe931d9fd3bf7f2aad3713dc70c080970763':
  Add utility to prepare files in a similar way to directories

Change-Id: I288024d55e8cead1c902950938b03bfa8dcc3df3
2016-06-02 10:24:54 +00:00
Calin Juravle
9812105b20 Add utility to prepare files in a similar way to directories
Bug: 28785119
Bug: 28625993
Change-Id: I505eb4deca0a89f64fe4505dd6729fe6a48bc1aa
2016-05-24 18:19:12 +01:00
Hans Boehm
12f788e763 Merge "Fix SharedBuffer. Remove aref." am: 069517574e
am: 1e081a8c5f

* commit '1e081a8c5f2d6e6cb55658bb289db1f0b4f5774a':
  Fix SharedBuffer. Remove aref.

Change-Id: I5849137bb49d727d1c1d245f0f61d11c4ee10859
2016-05-23 22:22:18 +00:00
Hans Boehm
54828dc739 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
(cherry picked from commit 3e4c076ef2)
2016-05-23 15:19:53 -07:00
Hans Boehm
3e4c076ef2 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
2016-05-23 17:28:52 +00:00
Hans Boehm
70a46d674a Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
(cherry picked from commit e263e6c633)
2016-05-19 16:18:26 -07:00
Hans Boehm
fdad5af164 Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" am: 62212954ef
am: d657e639cf

* commit 'd657e639cf74e0ee5a32d0f67efe0097c3df17a1':
  Fix memory order and race bugs in Refbase.h & RefBase.cpp

Change-Id: I79106bb0399e7699d51d526235843504ab52708b
2016-05-19 22:12:01 +00:00
Hans Boehm
62212954ef Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" 2016-05-19 22:01:41 +00:00
Elliott Hughes
847d963598 Remove a dead header (<netutils/dhcp.h>).
9c07eb9dd8 removed the implementation, but
missed the header file.

Bug: http://b/27192644
Change-Id: I809a3eb0081b05783b70dbca0274cdde6b1b31a6
2016-05-18 14:22:15 -07:00
Hans Boehm
e263e6c633 Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
2016-05-17 16:11:11 -07:00
Elliott Hughes
cb4abee6ca Merge "Don\'t expose ashmem constants on the host." am: 54fed512b9
am: ed95190b69

* commit 'ed95190b690adf3a452001fc527881af913c5ccd':
  Don't expose ashmem constants on the host.

Change-Id: I930dd0b72e88647b1e94694e5fb183431c7d75c6
2016-05-16 17:34:13 +00:00
Michael Wright
2a9a993af9 Merge commit '8b452b876b90dcfff1dab9012b65b5e67c4531a4' into manual_merge_8b452b8
Change-Id: Iacdc2d521f669661b4979c03b0476512abdb37c7
2016-05-16 15:06:22 +01:00
Elliott Hughes
427c605b2a Don't expose ashmem constants on the host.
Change-Id: I86bf58841645114e382300228be7be69a555e76b
2016-05-13 14:47:30 -07:00
Mohamad Ayyash
8374276bfa Move canned_fs_config into libcutils
It's no longer specific to make_ext4fs, will be used for mksquashfs as
well.

BUG: 27467028
Change-Id: I41b8c2b168ada45c8378dee522391edfb8f6b9a6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
BUG: 28704419
2016-05-12 18:44:13 -07:00
Michael Wright
5bacef33c9 Add String16#contains and strstr16 methods.
These are needed for aapt to find javadoc comments that contain
"@removed" in order to skip them when printing styleable docs.

Bug: 28663748
Change-Id: I8866d2167c41e11d6c2586da369560d5815fd13e
2016-05-09 19:45:07 +01:00
Elliott Hughes
46ae7d36a4 Merge "Remove <utils/ashmem.h>." am: f9f76146a1
am: ee3202563b

* commit 'ee3202563be401328ad318d77d7c6c0622ab0960':
  Remove <utils/ashmem.h>.

Change-Id: I6d076a9097df4969b703fc2833d464a15692835b
2016-05-04 22:04:29 +00:00
Elliott Hughes
6d7823a54e Remove <utils/ashmem.h>.
Not to be confused with <cutils/ashmem.h> or <linux/ashmem.h>, one or other
of which is what you should be using instead.

Change-Id: Ie158530591b28b94c2cda9e2686cae56b7aeb1a3
2016-05-04 13:33:20 -07:00
Treehugger Robot
78440e8689 Merge "Change remaining Android logging macros to use C99 varidaic syntax" am: 3abd032
am: 499cfed

* commit '499cfed160bb3c0893880de7860f2a78394d4a1d':
  Change remaining Android logging macros to use C99 varidaic syntax

Change-Id: I74c5808315835069067dc2f68eac044d74247dc1
2016-04-27 22:49:05 +00:00
Alex Vakulenko
3b0d65ad10 Change remaining Android logging macros to use C99 varidaic syntax
Most of the system/core/include/log/log.h file uses the C99 syntax of
variadic macros (that is, '...' in parameter list and __VA_ARGS__
in arguments). Except for andoid_printLog and android_printAssert
which still uses GCC custom extension syntax.

Switched the remaining macros to use C99 syntax. GCC extension syntax
makes my editor's code parser puke.

BUG: None
Change-Id: Ia6ebc0f2044b64182c425b179da0229c7046be4a
2016-04-27 14:44:40 -07:00
Elliott Hughes
2131fd91a8 Merge "Remove libmincrypt." am: d93e7ca
am: 98ab3c0

* commit '98ab3c0ae7b47318e561f12cc11ebe81a459e62e':
  Remove libmincrypt.

Change-Id: I7f86494922cbc21ffe152dfd5bf1767edfc1468e
2016-04-14 15:29:14 +00:00
Elliott Hughes
6b11c13aed Remove libmincrypt.
Bug: http://b/27287913
Change-Id: Ie85a7d8fecc3577a16c0a79d5f95379ec3ecc15b
2016-04-12 16:20:23 -07:00
Treehugger Robot
85dd9157e1 Merge "binderwrapper: Resolve ambiguous base::Closure reference" am: 979ce0e
am: b0144b5

* commit 'b0144b5b999148de06b091383b40e5f6d12cd977':
  binderwrapper: Resolve ambiguous base::Closure reference

Change-Id: Icea03c86507cc5a4f333ee3644465fbc92a8521c
2016-04-12 22:15:20 +00:00
Christopher Wiley
09910f4baa binderwrapper: Resolve ambiguous base::Closure reference
Disambiguate between base and android::base namespaces.  This matters
when headers from libbase are indirectly included.

Bug: 27804373
Test: Compiles in that referenced situation.

Change-Id: Icb26595bb0013733aa8c03971c9f4a950c8b2ab1
2016-04-12 13:19:29 -07:00
Mohamad Ayyash
fa7c7dd87d Merge "Move canned_fs_config into libcutils" into nyc-dev
am: 3f28318

* commit '3f2831876107ad18422bd67a459e2070c66a3827':
  Move canned_fs_config into libcutils

Change-Id: I88019bfa08603b1df2f2cbe4c79e45f126d83a1b
2016-04-08 17:55:59 +00:00
Mohamad Ayyash
3f28318761 Merge "Move canned_fs_config into libcutils" into nyc-dev 2016-04-08 17:39:05 +00:00
Mohamad Ayyash
8c788588f4 Move canned_fs_config into libcutils
It's no longer specific to make_ext4fs, will be used for mksquashfs as
well.

BUG: 27467028
Change-Id: I41b8c2b168ada45c8378dee522391edfb8f6b9a6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-04-07 22:44:00 -07:00
Dan Stoza
76a903224f Merge "graphics.h: Add android_hdr_t" into nyc-dev
am: 1dcf560

* commit '1dcf56080f7a396d57a9bd0e2c601f739a4bdf9a':
  graphics.h: Add android_hdr_t

Change-Id: I816d5741dfec2b9f69fd3d1e4426bf00b9b8cee7
2016-04-07 21:41:15 +00:00
Dan Stoza
1dcf56080f Merge "graphics.h: Add android_hdr_t" into nyc-dev 2016-04-07 21:32:53 +00:00
Dan Stoza
7f7c1c5de6 graphics.h: Add android_hdr_t
Adds android_hdr_t, which specifies different types of high dynamic
range encodings to be used throughout the system.

Bug: 25684127
Change-Id: Ic92bb5dc64494e643b828a8e24af8760e74e2360
2016-04-06 14:52:10 -07:00
Greg Kaiser
e60b407d43 Merge "Mutex: Note that STL is generally prefered" into nyc-dev
am: a30a626

* commit 'a30a6263d632a7d2dedc4f09c6707ab20df3fb1a':
  Mutex: Note that STL is generally prefered

Change-Id: I69eec173bf9679dc592987bd78cc8edcc81a1fbb
2016-04-06 13:06:00 +00:00
Greg Kaiser
d62698d4a3 Mutex: Note that STL is generally prefered
This class was designed prior to Android having usable C++11
support.  With that support now in place, we prefer people to
start using the STL threading classes, unless the code needs
to build on Win32.

Change-Id: If1b4d9bdfcb1e65824909376f022842bab9653d6
2016-04-05 12:38:47 -07:00
Elliott Hughes
8ea300663e Merge "Fix Condition::waitRelative." am: 0d6bb55
am: 9bf8f9e

* commit '9bf8f9efd4945513f2713159c1d72a7a7bd9cfb5':
  Fix Condition::waitRelative.

Change-Id: I378c8cbdd1b8f2563b6f2e0f7fb3799f0127eff7
2016-04-05 16:54:44 +00:00
Elliott Hughes
fd376b97f7 Fix Condition::waitRelative.
HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE has never been defined for LP64,
so let's have everyone use the same code path.

Also fix the possible overflow.

Bug: http://b/26944282
Bug: http://b/27918161
Change-Id: I51fc0ebb1f6b860dc62d721f8ebfbcf724ce66e7
2016-04-04 14:51:21 -07:00
Pablo Ceballos
0daf872712 Merge "Rename single buffer mode to shared buffer mode" into nyc-dev
am: 0e28c1f

* commit '0e28c1fa4a759755f21bf8a10d9e645ae64d1f78':
  Rename single buffer mode to shared buffer mode
2016-03-28 21:01:03 +00:00
Pablo Ceballos
0e28c1fa4a Merge "Rename single buffer mode to shared buffer mode" into nyc-dev 2016-03-28 19:34:27 +00:00
Dan Stoza
42d5a1f941 Merge "graphics.h: Add android_color_transform_t" into nyc-dev
am: beda52b

* commit 'beda52b32a0c324ba54b67e52e4714c2cd303070':
  graphics.h: Add android_color_transform_t
2016-03-24 22:41:01 +00:00
Dan Stoza
bb1deda59b graphics.h: Add android_color_transform_t
Adds android_color_transform_t, which specifies a range of color
transforms which may be applied to the whole display.

Bug: 22767098
Change-Id: Iaf03915c09ac0bdd18512b5f78c39da1705bda08
2016-03-24 10:38:46 -07:00
Mattias Nissler
b82b279b3f Merge "Add nvram user."
am: 4c9b149

* commit '4c9b1494e278185c54e684b90264a654b705582c':
  Add nvram user.
2016-03-23 16:53:30 +00:00
Mattias Nissler
4c9b1494e2 Merge "Add nvram user." 2016-03-23 08:17:56 +00:00
Mark Salyzyn
b8e596eb5a Merge changes If37ef423,If93df3ae,I01b38637 into nyc-dev
am: df4e31b

* commit 'df4e31b031e14aacd8b1435ddf7a32923e6e1427':
  liblog: add __android_log_pmsg_file_read
  liblog: add __android_log_pmsg_file_write
  liblog: split out transports into separate files
2016-03-22 23:24:21 +00:00
Mark Salyzyn
2b8157d9fd liblog: add __android_log_pmsg_file_read
(cherry pick from commit 864e8e80e4)

- This is considered an Android Private function, not exported
  for general use.
- goal is to retreive a file's content from a series of log
  messages from pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- files are presented in reverse sorted order, first based on
  _any_ numerical content, then by alphanumeric order.
- Add a gTest for this function, relies on gTest for
  liblog.__android_log_pmsg_file_write from prior to reboot.

Bug: 27176738
Change-Id: If37ef423009bd28b598b233af3bccef3429bdc22
2016-03-22 14:08:00 -07:00
Mark Salyzyn
10bdf61e5f liblog: add __android_log_pmsg_file_write
(cherry pick from commit d4b061bde2)

- This is considered an Android Private function, not exported
  for general use.
- goal is to record a file's content into a series of log
  messages into pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- filename reference is converted to a tag-unique
  "<dirbase>:<filebase>".
- buffer and length representing the filename contents are
  recorded, along with a sequence number placed into the nsec
  time field to ANDROID_LOG_PMSG_FILE_MAX_SEQUENCE.
- Add a gTest for this function.

Bug: 27176738
Change-Id: If93df3ae8bfc1bb75516d4a1fd8dae0301af644b
2016-03-22 14:07:54 -07:00
Mark Salyzyn
864e8e80e4 liblog: add __android_log_pmsg_file_read
- This is considered an Android Private function, not exported
  for general use.
- goal is to retreive a file's content from a series of log
  messages from pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- files are presented in reverse sorted order, first based on
  _any_ numerical content, then by alphanumeric order.
- Add a gTest for this function, relies on gTest for
  liblog.__android_log_pmsg_file_write from prior to reboot.

Bug: 27176738
Change-Id: If37ef423009bd28b598b233af3bccef3429bdc22
2016-03-22 13:03:53 -07:00
Mark Salyzyn
d4b061bde2 liblog: add __android_log_pmsg_file_write
- This is considered an Android Private function, not exported
  for general use.
- goal is to record a file's content into a series of log
  messages into pmsg, to be retrieved after a reboot for
  transfer to a persistent location.
- filename reference is converted to a tag-unique
  "<dirbase>:<filebase>".
- buffer and length representing the filename contents are
  recorded, along with a sequence number placed into the nsec
  time field to ANDROID_LOG_PMSG_FILE_MAX_SEQUENCE.
- Add a gTest for this function.

Bug: 27176738
Change-Id: If93df3ae8bfc1bb75516d4a1fd8dae0301af644b
2016-03-22 13:03:36 -07:00
Mattias Nissler
0897ab0849 Add nvram user.
This is intended to be used by user space daemons that are part of
access-controlled NVRAM HAL implementations for Brillo. Because there
might be sensitive data flowing through the daemon, we'd like to run
it as a separate user.

BUG: 27764637
Change-Id: If6ad7923af3c650963ee9e926f732001b6a8cb5d
2016-03-22 10:11:26 +01:00
Pablo Ceballos
248e77156d Rename single buffer mode to shared buffer mode
Change-Id: If5d45b2955d1219687c624395799b81e432dcfcc
2016-03-17 16:11:08 -07:00
Brian Carlstrom
de6d6041c1 system/core: Make Thread::run threadName argument required
am: e71b914775

* commit 'e71b9147756ab4da306e4c16461ad23936769603':
  system/core: Make Thread::run threadName argument required
2016-03-14 15:24:54 +00:00
Brian Carlstrom
e71b914775 system/core: Make Thread::run threadName argument required
Bug: 27557176
Change-Id: Iae83a1e5489c86c2858fc8481f246b8480f0eec4
2016-03-12 21:32:52 -08:00
Christopher Ferris
7c970c8ada Add error reporting mechanism for failing Unwind.
am: c463ba45c4

* commit 'c463ba45c42b4e2d8ce30c02a626d7183102f46e':
  Add error reporting mechanism for failing Unwind.
2016-03-10 22:29:26 +00:00
Christopher Ferris
c463ba45c4 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879

(cherry picked from commit 206a3b9798)

Change-Id: If9e7cfeb6eb7b122679a734c1a9eacee8354ef18
2016-03-10 14:14:43 -08:00
Christopher Ferris
206a3b9798 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879
Change-Id: Ie81718d53fb0e519fa0a7db9fd5f314b72bfa431
2016-03-10 12:39:15 -08:00
Adam Lesinski
cbb6e057f3 libziparchive: ensure ReadAtOffset is atomic
am: b1911401e0

* commit 'b1911401e0008c2b12a3fe6c9dc34528bf7710a5':
  libziparchive: ensure ReadAtOffset is atomic
2016-03-10 01:42:42 +00:00
Adam Lesinski
b1911401e0 libziparchive: ensure ReadAtOffset is atomic
ag/880725 modified ReadAtOffset to seek then read from the open
file descriptor. Previously pread64 was used to provide atomic
behaviour.

This causes races when multiple threads are trying to access data from
the file. This is supported, so this change reverts the relevant parts
of the above CL to restore the old behaviour.
Bug:27563413

Change-Id: I7bffd78da8c558745dfc3c072ba9691b1b15bb5b
2016-03-09 17:17:19 -08:00
Jorge Lucangeli Obes
7e070eb29f Merge "Add notice for adding users in AOSP." am: acf69772ff
am: da6b7ef1e9

* commit 'da6b7ef1e9585a2a2cc62d3e64f537e477b226d5':
  Add notice for adding users in AOSP.
2016-02-27 00:53:26 +00:00
Stephen Hines
242393fec1 Merge "Fix windows 64-bit builds" into nyc-dev 2016-02-26 23:34:39 +00:00
Jorge Lucangeli Obes
5596cf04ff Add notice for adding users in AOSP.
Sometimes new users/groups get added in internal branches, and the list
gets out of sync. Add a comment to prompt developers to add users in
AOSP.

Bug: None
Change-Id: I5b2df391902b842f1af8a377c8eac4cdb36a0518
2016-02-26 15:03:44 -08:00
Lajos Molnar
0b4cc2f3e1 Merge "keep legacy HAL_DATASPACE enums unchanged" into nyc-dev
am: 1e86e1ba1a

* commit '1e86e1ba1acfec7a16cdad8ab87f262e7bfc3e52':
  keep legacy HAL_DATASPACE enums unchanged
2016-02-26 05:08:36 +00:00
Lajos Molnar
1e86e1ba1a Merge "keep legacy HAL_DATASPACE enums unchanged" into nyc-dev 2016-02-26 05:06:13 +00:00
Dan Willemsen
9dddd137c7 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718

(cherry picked from commit 86cf941c48)

Change-Id: I8d39d1951fea1b3011caf585c983e1da7959f7c0
2016-02-25 18:43:55 -08:00
Mark Salyzyn
1d5afc9e08 liblog: add android_log_write_string8_len
(cherry pick from commit 67d7eafd56)

android_log_write_string8_len(android_log_context ctx,
                              const char *value, size_t maxlen)

Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.

Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
2016-02-25 15:53:00 -08:00
Mark Salyzyn
79e0c9eeca Merge changes Ic15a87f4,I8a53ad3a,I6a03d405 am: 9377fa863a
am: acc6ca3eb8

* commit 'acc6ca3eb83606478123efd3fe5c2f22f16279e5':
  liblog: __android_log_error_write use event list library
  liblog: test: __android_log_error_write accuracy
  liblog: add android_log_write_string8_len
2016-02-25 21:59:37 +00:00
Mark Salyzyn
67d7eafd56 liblog: add android_log_write_string8_len
android_log_write_string8_len(android_log_context ctx,
                              const char *value, size_t maxlen)

Caps the supplied string to a maxlen length. Alter API to handle
a NULL pointer for the value string for this and
android_log_write_string8() and instead of returning -EINVAL,
act like a null string "" was supplied to preserve the list
location. API is also changed to report the number of characters
actually placed into the android_log_context.

Bug: 27356456
Bug: 19235719
Change-Id: I6a03d405eac1d741555dd05555513ec691e7a46e
2016-02-25 12:29:32 -08:00
Lajos Molnar
88a5ad3f13 keep legacy HAL_DATASPACE enums unchanged
Bug: 25975353
Change-Id: I092b568420aa605425c12de9b245bca7ed602f43
2016-02-24 15:36:57 -08:00
Jorge Lucangeli Obes
ddedf05738 Merge "Add more first-party Brillo system users." am: 21dd6feb1c
am: e2d720a61f

* commit 'e2d720a61fb6da6981d4cb086d708cee9706449b':
  Add more first-party Brillo system users.
2016-02-24 22:28:13 +00:00
Jorge Lucangeli Obes
1c13c3d388 Add more first-party Brillo system users.
Brillo is converging on a set of mandatory system services to be
included in all Brillo builds. We'd like these services to run as
separate users just like other native Android/Brillo system services.

Add users for these services:
-Firewalld: Brillo has more granular firewall requirements (think e.g.
  Brillo-powered router.) Firewalld exposes a (currently) D-Bus/
  (soon to be) Binder API to broker access to IPTables rules.
-Trunksd: Some Brillo product configs will require TPMs. Trunksd
  manages TPMs in Chrome OS and Brillo.

Bug: 27299198

Change-Id: Ibe3303acdd9398ea52da0a37dbef73e5c5a948f7
2016-02-24 13:38:01 -08:00
William Luh
769cba57e4 Add macro to call event logger for errors. DO NOT MERGE
Bug:23180694
Change-Id: I566a290334345f48013029534efef3e08e726e40
2016-02-23 16:04:34 -08:00
Chien-Yu Chen
0836c9e386 Sync internal<->AOSP user list.
Bug: 27299198

Cherry-picked from:

Restart cameraserver

Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-02-23 15:56:55 -08:00
Dimitry Ivanov
32912090e6 Merge "Move libnativeloader headers into libnativeloader." into nyc-dev 2016-02-23 19:45:22 +00:00
Mark Salyzyn
97ba9510d4 liblog: event log list logging handler
am: 9dd6510dd0

* commit '9dd6510dd09f40973b8834c5cad1217ce1c3011d':
  liblog: event log list logging handler
2016-02-23 15:52:22 +00:00
Mark Salyzyn
9dd6510dd0 liblog: event log list logging handler
(cherry pick from commit bd1ad049b2)

Based off an initial request and effort by williamluh@google.com

- Added the following functions:

* Composing and Writing:

android_log_context create_android_logger(uint32_t tag)

int android_log_write_list_begin(android_log_context ctx)
int android_log_write_list_end(android_log_context ctx)

int android_log_write_int32(android_log_context ctx, int32_t value)
int android_log_write_int64(android_log_context ctx, int64_t value)
int android_log_write_string8(android_log_context ctx, const char *value)
int android_log_write_float32(android_log_context ctx, float value)

int android_log_write_list(android_log_context ctx, log_id_t id)

* Reading and Interpreting:

android_log_context create_android_log_parser(const char *msg, size_t len)

android_log_list_element android_log_read_next(android_log_context ctx)
android_log_list_element android_log_peek_next(android_log_context ctx)

* Destroy context used above:

int android_log_destroy(android_log_context *ctx);

- Added unit gTests

We moved implemented android_log_buffer_to_string() to the test since
it is an alternate for already existing logprint functionality.
Please move into liblog should it be of some common use, otherwise
as is it is a good means of stessing the reading and interpreting
handlers.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 19235719
Change-Id: I4aa1927e8e6a75f0a129d15a27c891cf1ccd4f5c
2016-02-23 07:45:49 -08:00
Mark Salyzyn
bd1ad049b2 liblog: event log list logging handler
Based off an initial request and effort by williamluh@google.com

- Added the following functions:

* Composing and Writing:

android_log_context create_android_logger(uint32_t tag)

int android_log_write_list_begin(android_log_context ctx)
int android_log_write_list_end(android_log_context ctx)

int android_log_write_int32(android_log_context ctx, int32_t value)
int android_log_write_int64(android_log_context ctx, int64_t value)
int android_log_write_string8(android_log_context ctx, const char *value)
int android_log_write_float32(android_log_context ctx, float value)

int android_log_write_list(android_log_context ctx, log_id_t id)

* Reading and Interpreting:

android_log_context create_android_log_parser(const char *msg, size_t len)

android_log_list_element android_log_read_next(android_log_context ctx)
android_log_list_element android_log_peek_next(android_log_context ctx)

* Destroy context used above:

int android_log_destroy(android_log_context *ctx);

- Added unit gTests

We moved implemented android_log_buffer_to_string() to the test since
it is an alternate for already existing logprint functionality.
Please move into liblog should it be of some common use, otherwise
as is it is a good means of stessing the reading and interpreting
handlers.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 19235719
Change-Id: I4aa1927e8e6a75f0a129d15a27c891cf1ccd4f5c
2016-02-22 16:04:41 -08:00
Elliott Hughes
2a7f7e0090 Move libnativeloader headers into libnativeloader.
Change-Id: I227676276da1b08a84486f29fb0e1502c8dbdf4a
(cherry picked from commit e2b4e1e00c)
2016-02-22 15:23:22 -08:00
Calin Juravle
b219fe37c6 Merge "Create profiles folders" into nyc-dev
am: aed972dead

* commit 'aed972dead82d2a74c3a9be296ba3390477d30cf':
  Create profiles folders
2016-02-22 11:49:17 +00:00
Calin Juravle
aed972dead Merge "Create profiles folders" into nyc-dev 2016-02-22 11:42:02 +00:00
Pablo Ceballos
f9603bcb4f Merge "Add the setAutoRefresh interface in ANativeWindow" into nyc-dev
am: f411123ea0

* commit 'f411123ea06da276f435cfd27d824d11b2aebbfe':
  Add the setAutoRefresh interface in ANativeWindow
2016-02-20 18:38:58 +00:00
Pablo Ceballos
f411123ea0 Merge "Add the setAutoRefresh interface in ANativeWindow" into nyc-dev 2016-02-20 18:22:29 +00:00
Calin Juravle
807f23aff2 Create profiles folders
Current profiles (the ones which have not been used for
compilation) are stored in /data/misc/profiles/cur/0/pkgname/.

Reference profiles (the merged of all user profiles, used for
compilation) are stored in /data/misc/profiles/ref/pkgname/.

Add a method to get the shared app gid from an uid or appid.

Bug: 26719109
Bug: 26563023
Change-Id: I89601d7dbeb3041df882c141a9127dac200a645e
2016-02-19 13:42:37 +00:00
Samuel Tan
cf1649da00 Merge "libutils: add String8 and String16 std_string utility methods" am: fb0670d650
am: 941d48f0ee

* commit '941d48f0eeb98fac7c869beee22833ff659318bc':
  libutils: add String8 and String16 std_string utility methods
2016-02-19 04:49:17 +00:00
Samuel Tan
4b2e76966e Merge "libutils: remove whitespace from String8 files" am: e771e846a8
am: 450b9b7068

* commit '450b9b7068cac286ca442c404a90a8a8b57a79e8':
  libutils: remove whitespace from String8 files
2016-02-19 04:49:08 +00:00
Samuel Tan
9ac4e005b4 libutils: add String8 and String16 std_string utility methods
Add utility methods that convert String16 and String8 into
std::string.

Also, remove a repeated include of <utils/Unicode.h> in
String16.h, since it is not used in that header file,
and is already included in String16.cpp.

BUG: 27200800
Change-Id: I5238aeb70689499763060a99dff9950fbb7adb3e
TEST: libutils builds successfully.
2016-02-18 17:04:23 -08:00
Samuel Tan
95fd527065 libutils: remove whitespace from String8 files
Remove trailing whitespace from String8 header and
cpp files.

BUG: None
Change-Id: Ie77da3f0fbce9cdce20225ce1310cf62295179a4
2016-02-18 17:04:20 -08:00
Samuel Tan
9518b9db5b Merge "libutils: remove whitespaces in String16.cpp and String16.h"
am: 8c09555aac

* commit '8c09555aac6f00cb7fa7d62cb5c356e2f07a268b':
  libutils: remove whitespaces in String16.cpp and String16.h
2016-02-17 00:38:10 +00:00
Samuel Tan
8c09555aac Merge "libutils: remove whitespaces in String16.cpp and String16.h" 2016-02-17 00:33:31 +00:00
Samuel Tan
f9d16ef106 libutils: remove whitespaces in String16.cpp and String16.h
Remove trailing whitespaces in both these files.

BUG: None
Change-Id: I18eca5162871b5b2bf7757a7ef36a4e80073798c
2016-02-16 15:21:34 -08:00
Elliott Hughes
5ce57a6717 Merge "Move libnetutils headers into libnetutils."
am: d61ad3c44e

* commit 'd61ad3c44eba0d9b9248005a9068e6b477c06c32':
  Move libnetutils headers into libnetutils.
2016-02-16 22:11:31 +00:00
Elliott Hughes
d61ad3c44e Merge "Move libnetutils headers into libnetutils." 2016-02-16 21:25:52 +00:00
Elliott Hughes
3e08b8205c Merge "Move libdiskconfig headers into libdiskconfig."
am: 737325fb7c

* commit '737325fb7c0231eb530c75b7ea21466308fd3ea1':
  Move libdiskconfig headers into libdiskconfig.
2016-02-16 20:46:00 +00:00
Elliott Hughes
ffd662d259 Merge "Move libmemtrack headers into libmemtrack."
am: 1c3d784030

* commit '1c3d78403009008130d24c27ab3ea24ac6b14dfd':
  Move libmemtrack headers into libmemtrack.
2016-02-16 20:45:35 +00:00
Elliott Hughes
737325fb7c Merge "Move libdiskconfig headers into libdiskconfig." 2016-02-16 18:34:24 +00:00
Elliott Hughes
1c3d784030 Merge "Move libmemtrack headers into libmemtrack." 2016-02-16 17:14:11 +00:00
Elliott Hughes
8dccdbf3f8 Move libdiskconfig headers into libdiskconfig.
Change-Id: I5d8e29687dca39a2a134d92f311528479b4ea102
2016-02-13 12:48:23 -08:00
Elliott Hughes
c768bfc9f5 Merge "Move libnativeloader headers into libnativeloader."
am: 25aca65a93

* commit '25aca65a9385b32191f4016b644c9c27d66cfbb1':
  Move libnativeloader headers into libnativeloader.
2016-02-13 03:49:33 +00:00
Elliott Hughes
ab5ed09924 Move libmemtrack headers into libmemtrack.
Change-Id: I6f695b4a965e924331d1a07fc45e9d8b6bc43d92
2016-02-12 18:16:48 -08:00
Elliott Hughes
8501751bdf Move libnetutils headers into libnetutils.
Change-Id: I8e51b369b7617e780db78c2f77c8e28d0fb93445
2016-02-12 18:10:06 -08:00
Elliott Hughes
e2b4e1e00c Move libnativeloader headers into libnativeloader.
Change-Id: I227676276da1b08a84486f29fb0e1502c8dbdf4a
2016-02-12 18:07:29 -08:00
Lajos Molnar
e6c7f9a0c5 Expand HAL_DATASPACE to include range, standard and transfer bitfields
am: 9136922045

* commit '9136922045978385be99b0171c2c873aa6c2e186':
  Expand HAL_DATASPACE to include range, standard and transfer bitfields
2016-02-10 02:13:44 +00:00
Pablo Ceballos
3daa57490e Add the setAutoRefresh interface in ANativeWindow
Bug 24940410

Change-Id: I6c0d149c63236f169897c64b21563630fb034338
2016-02-09 17:17:21 -08:00
Lajos Molnar
9136922045 Expand HAL_DATASPACE to include range, standard and transfer bitfields
Bug: 25975353
Change-Id: Id2668508b523130e5fa3496440d9423682b31632
2016-02-10 00:21:37 +00:00
Dan Willemsen
cf1381c834 Merge "Fix windows 64-bit builds"
am: 3f68ba4dc6

* commit '3f68ba4dc67360d4c242110005e36bfe65c66098':
  Fix windows 64-bit builds
2016-02-08 23:59:59 +00:00
Dan Willemsen
86cf941c48 Fix windows 64-bit builds
pid_t is 64-bit in 64-bit mingw, but the windows process/thread
functions return a DWORD(uint32_t). Instead of promoting to a pid_t and
fixing the format strings, just use a uint32_t to store the values.

android_thread_id also cannot be a 64-bit pointer, so for windows just
force it to be a uint32_t.

libutils/ProcessCallStack only works under Linux, since it makes heavy
use of /proc. Don't compile it under Windows or Darwin.

Bug: 26957718
Change-Id: I4e43e7cf18a96f22b3a9a08dbab8c3e960c12930
2016-02-05 16:10:10 -08:00
Mattias Nissler
e98d9a076d Merge "graphics: Include stddef.h for size_t." 2016-02-03 21:37:39 +00:00
Mattias Nissler
9cf80c6b40 graphics: Include stddef.h for size_t.
graphics.h uses size_t, but doesn't pull in a declaration. This results
in compile errors if code that includes graphics.h (such as
hardware/hardware.h) doesn't happen to have a size_t declaration from
elsewhere.

Change-Id: I0f3882c3dce20425697d25366d49930b2251ef7f
2016-02-03 22:24:53 +01:00
David Pursell
f722c253e6 Merge "libcutils/fastboot: improve multi-buffer write." am: f6f800ef3c
am: ef0e01c346

* commit 'ef0e01c346b2f60b1941bf3335906de5996785d8':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:13:02 +00:00
David Pursell
b34e4a06ee libcutils/fastboot: improve multi-buffer write.
Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.

Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
2016-02-03 10:01:38 -08:00
David Pursell
2fe3a0b7a4 Merge "libcutils: add multi-buffer socket send." am: d95ecfc432
am: d56499b21d

* commit 'd56499b21d1411a7c799cdad316fb2138db26a7c':
  libcutils: add multi-buffer socket send.
2016-02-02 19:25:52 +00:00
David Pursell
e03df480b1 Merge "libcutils: add socket_get_local_port()." am: d90adbc45b
am: 9875e6c7e3

* commit '9875e6c7e318fe11a888b6b53c0472f5586410e4':
  libcutils: add socket_get_local_port().
2016-02-02 19:21:39 +00:00
David Pursell
8385fb299f libcutils: add multi-buffer socket send.
Unix and Windows both have functions to write multiple buffers to a
socket with a single call but they have very different signatures. This
CL creates some cross-platform functions to be able to perform these
operations in a uniform way, which will be required for upcoming
fastboot functionality.

This CL also fixes some inconsistent spacing in the touched files.

Bug: http://b/26558551
Change-Id: I8f14d52d3a1de1f3b464267666d6cd3b54263238
2016-02-02 11:18:56 -08:00
David Pursell
756e1c81e8 libcutils: add socket_get_local_port().
Tests that require a local server currently hardcode a test value,
which can run into conflicts depending on what's currently running on
the machine.

This CL adds socket_get_local_port(), which lets us pass 0 so the
system picks an open port and we can query which port it chose.

Bug: http://b/26236380
Change-Id: I01d1558884e7636081d9a357db6faa86929934f6
2016-02-02 09:52:02 -08:00
Tim Murray
6647bb5130 Enable top-app cpuset support.
Allows ActivityManager to use the top-app cpuset to grant the currently
focused app exclusive access to a CPU core.

Change-Id: I45bca5170477e413dec6e5889338399d0859706c
2016-02-01 15:03:16 -08:00
Dan Stoza
c003b515e9 Merge "Name the pixel format and transform enums" am: 53529ecacd
am: 65823b7820

* commit '65823b78207f7636e4d7ad8a4104ed663336c159':
  Name the pixel format and transform enums
2016-01-28 23:25:38 +00:00
Dan Stoza
53529ecacd Merge "Name the pixel format and transform enums" 2016-01-28 23:18:43 +00:00
Chien-Yu Chen
cd2ef4ef1c Restart cameraserver
Bug: 24511454
Change-Id: Ia27f4ef0eb71f891c789f637a21b04afe0b1c4e9
2016-01-25 11:52:40 -08:00
Marco Nelissen
0b17e3a362 Merge "uid for codec process" am: c7096b5e42
am: e40b58328f

* commit 'e40b58328f13c19d4954c760f7c7f7f86a8f2aa1':
  uid for codec process
2016-01-25 16:57:18 +00:00
Marco Nelissen
003c07238a uid for codec process
Change-Id: Iadf8012e6c177bcf487048e1b5a9b4fc51a0aeba
2016-01-25 07:49:39 -08:00
David Pursell
f6012df68d Merge "fastboot: use cutils socket functions." am: bbedd9523f
am: f0bfaf9503

* commit 'f0bfaf95038241c3f8ed65099c7d532a6c112e86':
  fastboot: use cutils socket functions.
2016-01-22 18:46:54 +00:00
David Pursell
572bce2908 fastboot: use cutils socket functions.
Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.

This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.

Bug: http://b/26558551

Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
2016-01-21 09:53:11 -08:00
David Pursell
cb56fb4b15 Merge "libcutils: share Windows networking code." am: 1906de1e0f
am: 7a568dbdd6

* commit '7a568dbdd6c1a39a90c01ab89092cb67a9a86198':
  libcutils: share Windows networking code.
2016-01-21 17:03:45 +00:00
David Pursell
1906de1e0f Merge "libcutils: share Windows networking code." 2016-01-21 16:40:00 +00:00
Christopher Ferris
df69064892 Merge "Allow setting an arbitrary alignment for an entry." am: ad12df20e9
am: 5633ccf042

* commit '5633ccf042f76a894fa31fe1579846ac516fa60c':
  Allow setting an arbitrary alignment for an entry.
2016-01-19 22:35:06 +00:00
Christopher Ferris
ad12df20e9 Merge "Allow setting an arbitrary alignment for an entry." 2016-01-19 22:28:02 +00:00
Christopher Ferris
5e9f3d44a3 Allow setting an arbitrary alignment for an entry.
The current code only allows the creation of an entry that is 32 bit
aligned.

Bug: 25446938

Change-Id: I6c924df12ef2bc067b3de7789257af7e3db7e904
2016-01-19 13:55:53 -08:00
Rubin Xu
c43b47a31c Merge "Add logd security buffer tag types and string write API." am: 95d1bd2421
am: 7fa35356a8

* commit '7fa35356a845ee301c442e51e35c5690c35e54d5':
  Add logd security buffer tag types and string write API.
2016-01-19 20:55:00 +00:00
Rubin Xu
95d1bd2421 Merge "Add logd security buffer tag types and string write API." 2016-01-19 20:40:16 +00:00
Elliott Hughes
7c452f80f6 Merge "Remove unused cruft from <log/log.h>." am: 6acf7663c2
am: b22c169f20

* commit 'b22c169f20d8887f214f1b99a8e4b54215ff5558':
  Remove unused cruft from <log/log.h>.
2016-01-19 17:33:06 +00:00
Rubin Xu
d545d2930e Add logd security buffer tag types and string write API.
Bug: 22860162
Change-Id: I1cceed3462eaebdd8208abf101b127f27f0023a7
2016-01-19 17:13:28 +00:00
Elliott Hughes
3a84b685e9 Remove unused cruft from <log/log.h>.
The callers are, in fact, already gone.

Change-Id: I665183ce595b542b1e47df79bc8990e069571b97
2016-01-16 11:11:19 -08:00
Christopher Ferris
469bf483b1 Merge "Add a ZipArchiveStreamEntry class." am: 9162c1496d
am: 64686bcd9e

* commit '64686bcd9edffdd29c4b7b19ddcbf5b8ab56ae73':
  Add a ZipArchiveStreamEntry class.
2016-01-15 23:58:02 +00:00
David Pursell
0eb8e1b706 libcutils: share Windows networking code.
This CL moves Windows networking code from fastboot to libcutils so
that it can be shared with other host programs such as adb.

Not all libcutils networking functions have been implemented for
Windows, just those necessary for fastboot. In the next CL I will do
the same for adb, adding any additional required functions.

Unit tests have also been added to test the functions using a loopback
connection.

Bug: http://b/26236380.
Change-Id: Ibc51a67030fe69a04c23512eefa9d19b055c7c12
2016-01-15 15:57:35 -08:00
Christopher Ferris
e6884ce56f Add a ZipArchiveStreamEntry class.
This allows someone to stream the data out of a zip archive
instead of extracting to a file or to memory.

Included in this change is a small cleanup of the makefile.

Change-Id: I8b679a679c3502ff4ea0bc4f9e918303657fa424
2016-01-14 12:30:20 -08:00
Jeff Sharkey
814640315a Be strict, but not that strict.
Certain apps decide that they want to chmod() their private data
directories to gain more security.  We still want to carefully
enforce owner UID/GID, but relax the mode check for now.

Bug: 26549892
Change-Id: I362d530ba0b20fb23f427ac082ee003864adc57d
2016-01-14 12:02:53 -07:00
Keun-young Park
27f961f93d Merge "libusbhost: add usb_device_reset" 2016-01-14 17:28:47 +00:00
Keun-young Park
f6411fa1ec libusbhost: add usb_device_reset
bug: 26404209
Change-Id: I8f307d6683afe70fe334746f5be2856b79782493
2016-01-13 16:01:42 -08:00
Jeff Sharkey
cf94fe152e Offer a stricter way to prepare directories.
Some callers, such as installd, have stricter requirements around
directory preparation, where they want to assert ownership and mode
without quietly fixing the values.

Bug: 26466827
Change-Id: Id44db5f29a3326cfe178b443fb450ad2edeaefd8
2016-01-12 13:07:52 -07:00
Josh Gao
d49815e42b Merge "debuggerd: fork and drop privileges when dumping." am: b8e9ebf8b4
am: 8a43d6ae06

* commit '8a43d6ae0641102965175aba25c514dae5ccd45c':
  debuggerd: fork and drop privileges when dumping.
2016-01-06 00:07:19 +00:00
Josh Gao
e7a9e52740 debuggerd: fork and drop privileges when dumping.
Bug: http://b/25195825
Change-Id: I913d8425232e79df3f7a051a8cc63de9c60f4780
2016-01-05 15:59:01 -08:00
Jorge Lucangeli Obes
e7598b9c53 Merge "android_filesystem_config.h: Add Brillo users." am: 8688dba547
am: a08f35c9fd

* commit 'a08f35c9fdb5863a5a9a4a70cee3efa466def178':
  android_filesystem_config.h: Add Brillo users.
2016-01-05 23:05:29 +00:00
Jorge Lucangeli Obes
4ae18025f7 android_filesystem_config.h: Add Brillo users.
-metrics_collector and metricsd gather and upload device metrics.
-webservd is part of the Weave (Brillo remote setup and management) stack.

Bug: 26337609
Change-Id: Icf6ce75e64293adbe773f2ee65e80629f2eeb737
2016-01-05 14:43:40 -08:00
Alex Vakulenko
78d0871950 Merge "libbinderwrapper: Add BinderWrapper::GetOrCreateInstance()" am: 946d8152b2
am: 1a0a184a54

* commit '1a0a184a541bfbbbdc4351ad2df8d0181f4263d6':
  libbinderwrapper: Add BinderWrapper::GetOrCreateInstance()
2016-01-04 21:08:21 +00:00
Alex Vakulenko
08c9891c9c libbinderwrapper: Add BinderWrapper::GetOrCreateInstance()
In libraries relying on binder it is useful to be able to obtain an
existing copy of BinderWrapper or create one if it doesn't exist.

This allows to abstract the actual RPC (binder) from clients who have
no other dependencies on this RPC.

BUG: 23782171
Change-Id: Ie775d3d8ab83d75e38abc7e1385eb39a363555ef
2016-01-04 12:56:27 -08:00
Pavlin Radoslavov
17d80c84e1 Use GID "wakelock" to control access to kernel wakelock
* Added new kernel GID named "wakelock" (AID_WAKELOCK = 3010)
* Changed the group access for /sys/power/wake_lock and
  /sys/power/wake_unlock from "system" to "wakelock"
* Added "wakelock" to the list of groups for the healthd process/service

Bug: 25864142
Change-Id: Ieabee9964cccec3107971a361a43aa9805164aa9
2015-12-28 14:57:28 -08:00
Pavlin Radoslavov
0eca107512 Use GID "wakelock" to control access to kernel wakelock
* Added new kernel GID named "wakelock" (AID_WAKELOCK = 3010)
* Changed the group access for /sys/power/wake_lock and
  /sys/power/wake_unlock from "system" to "wakelock"
* Added "wakelock" to the list of groups for the healthd process/service

Bug: 25864142
Change-Id: Ieabee9964cccec3107971a361a43aa9805164aa9
2015-12-28 19:33:30 +00:00
Rob Carr
d94ad78f7b Merge "Add comment to keep enum in sync." 2015-12-22 21:07:46 +00:00
Dimitry Ivanov
d2a6220001 Add parameter for shared namespaces
Shared namespaces are used for bundled app classloaders.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I163033f70c50ef9ddb4164676c033ab30748964e
(cherry picked from commit ef4639c1a5)
2015-12-19 23:38:28 -08:00
Jorge Lucangeli Obes
37211e1f3d Add audioserver UID.
(Originally in
https://googleplex-android-review.git.corp.google.com/#/c/804752).

Change-Id: I31951cad1bbcec58b21559be0d86581ba9187a92
2015-12-18 13:06:34 -08:00
Marco Nelissen
51544cc778 New uid for extractor process
Change-Id: I462d4736e772da0a08b4793fc1b971ff261667ea
2015-12-18 11:11:17 -08:00
Dan Stoza
48cd34080c Name the pixel format and transform enums
Adds an actual enum name for the HAL_PIXEL_FORMAT_* and
HAL_TRANSFORM_* enums.

Change-Id: I8d03c3695e8956b3b525559edcb37213ade6a0de
2015-12-17 13:58:19 -08:00
Robert Carr
f3954fba2d Add comment to keep enum in sync.
Now that we expose SCALING_MODE_* constants
out to Java add a comment to keep the bindings
in sync.

Bug: 26010823
Change-Id: I35473c673b79223ea3bebc118d3a31fc82f37381
2015-12-17 11:38:39 -08:00
Dimitry Ivanov
ef4639c1a5 Add parameter for shared namespaces
Shared namespaces are used for bundled app classloaders.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I163033f70c50ef9ddb4164676c033ab30748964e
2015-12-15 15:10:35 -08:00
Greg Hackmann
346db8a2c2 Merge "cutils: trace: add DATABASE tag" am: 461a29540c
am: d57d863e2e

* commit 'd57d863e2efd2c8a2e8246ed7f928a2c1b834e9e':
  cutils: trace: add DATABASE tag
2015-12-14 13:23:32 -08:00
Greg Hackmann
461a29540c Merge "cutils: trace: add DATABASE tag" 2015-12-14 21:12:52 +00:00
Andy Hung
c7ae5210a7 Merge "Add audioserver uid and restart service when needed" 2015-12-11 20:08:51 +00:00
Mark Salyzyn
829be0202a Merge "logd: liblog: logcat: Add LOG_ID_SECURITY" am: 86052a5d4f
am: 72398c0515

* commit '72398c051567d735df677a7527533f2f1dc5a882':
  logd: liblog: logcat: Add LOG_ID_SECURITY
2015-12-11 10:58:32 -08:00
Mark Salyzyn
d4ac73bd6a Merge changes I598c8c5c,I672b0f4d,Id882978b,Idff5e080,Ib124eca1, ... am: 30edbdce9b
am: 5afb3f5f67

* commit '5afb3f5f678627d42ceae617069ff38d9773a005':
  logger.h: reduce maximum payload so sum is page size
  liblog: test for maximum payload can not survive change
  liblog: logprint use uid name if length less then 5
  liblog: logprint add uid format modifier
  liblog: readlog apps get logger_entry_v4 for pstore
  logd: readlog apps get logger_entry_v4
  logger.h: Add definition for logger_entry_v4
2015-12-11 10:57:51 -08:00
Mark Salyzyn
86052a5d4f Merge "logd: liblog: logcat: Add LOG_ID_SECURITY" 2015-12-11 17:33:33 +00:00
Mark Salyzyn
30edbdce9b Merge changes I598c8c5c,I672b0f4d,Id882978b,Idff5e080,Ib124eca1, ...
* changes:
  logger.h: reduce maximum payload so sum is page size
  liblog: test for maximum payload can not survive change
  liblog: logprint use uid name if length less then 5
  liblog: logprint add uid format modifier
  liblog: readlog apps get logger_entry_v4 for pstore
  logd: readlog apps get logger_entry_v4
  logger.h: Add definition for logger_entry_v4
2015-12-11 16:42:28 +00:00
Dimitry Ivanov
fe029254e9 Merge "Apply permitted path to the classloader-namespace" am: 028aa205af
am: 584c26f872

* commit '584c26f872d9adfba9f5d2f200a53f837836b7bc':
  Apply permitted path to the classloader-namespace
2015-12-10 04:41:34 +00:00
Dimitry Ivanov
0d6e59407d Apply permitted path to the classloader-namespace
Bug: http://b/25853516
Bug: http://b/22548808
Change-Id: I283e6ee8d743bc3ab41aab9f36af0abbe729943f
2015-12-09 15:39:36 -08:00
Mark Salyzyn
b6a8d41e2a logger.h: reduce maximum payload so sum is page size
Reduce maximum log payload so that the sum with the maximum
length header logger_entry_v4 is a page size. This is a
performance measure.

Expect side effects, truncates messages 8 bytes earlier. The
length has a long history (2008) so there may be non-C code
somewhere that has it hard-coded rather than reflecting this
header. CTS tests may need to be adjusted.

Bug: 25996918
Change-Id: I598c8c5cc78f6b0afc2c1f30cc6f3c18eb8c4c9d
2015-12-09 08:12:07 -08:00
Mark Salyzyn
90e7af30a5 liblog: logprint add uid format modifier
Bug: 25996918
Change-Id: Idff5e080fc5c7b69e0c45d3f596eb9d632451cbd
2015-12-09 08:12:07 -08:00
Mark Salyzyn
9b292f563e logger.h: Add definition for logger_entry_v4
Extends logger_entry_v3 to add an uid field and moves some fields to
unsigned (easier to have zero'd bit-field for future adjustments).

Still no version field, not crossing that bridge, historical reasons.

Bug: 25996918
Change-Id: I18b7291666c3a5b170d6771a012363a41f2c5847
2015-12-09 08:12:07 -08:00
Mark Salyzyn
083b037c07 logd: liblog: logcat: Add LOG_ID_SECURITY
- Largish commit, buffer and access controls done together
- Add LOG_ID_SECURITY binary content log
- Add "default" meta buffer
- allow LOG_ID_SECURITY only from AID_SYSTEM and AID_ROOT UID & GID
- Use __android_log_security() to gate logging
- Add __android_log_security_bwrite() native access to security
  logging.
- Add liblog.__security_buffer end-to-end gTest

Bug: 26029733
Change-Id: Ibcf5b4660c17c1aa6902c0d93f8ffd29c93d9a93
2015-12-08 16:46:29 -08:00
Mark Salyzyn
ee6b51f210 Merge "liblog: Add __android_log_security()" am: 1631d36d95
am: e52a6d60cd

* commit 'e52a6d60cdb2233bd3d03723c73ce8f9bf33c929':
  liblog: Add __android_log_security()
2015-12-08 14:04:42 -08:00
Mark Salyzyn
ffbd86ff25 liblog: Add __android_log_security()
Return non-zero if ro.device_owner is set and not false
and persist.logd.security is true.

Bug: 26029733
Change-Id: Ie82ae11ae35e9c79017b6e873fefb39d79a1d4fe
2015-12-08 11:28:27 -08:00
Dimitry Ivanov
d686fb3474 Merge "Native loader as a separate library" am: beceb6ef53 am: 17f119eade
am: d6c9995d99

* commit 'd6c9995d992b4fdffe176acff207f1f066e2a920':
  Native loader as a separate library
2015-12-08 04:53:45 +00:00
Mark Salyzyn
9d216130ad Merge changes Ib441cecf,Ieb1bbe3d,I3e63e430,I531b4317,I8dd60545, ... am: d1379a8aed am: 154e1c15ae
am: 850045ca27

* commit '850045ca27b2a71d6b1fee873dc7246edfd0b8f2':
  logcat: Add --wrap timeout
  logcat: Add low hanging fruit long arguments
  logcat: Add long arguments to logcat, support for pid filter
  liblog: Support for ANDROID_LOG_WRAP mode flag on reader
  logd: test wakeup on wrap timeout
  logd: wakeup on wrap or timeout
2015-12-08 00:04:01 +00:00
Mark Salyzyn
e7b77665e3 Merge "logd: liblog: logcat: switch to android_log_clockid() (2)" am: 69504d646d am: d2fb3e10ee
am: 42901fb07d

* commit '42901fb07d69b699fa07bdd25aca4957c3dd0c10':
  logd: liblog: logcat: switch to android_log_clockid() (2)
2015-12-08 00:01:50 +00:00
Mark Salyzyn
e18f028637 Merge "Revert "logd: liblog: logcat: switch to android_log_clockid()"" am: b566435b02 am: a64dd2d0b4
am: b97aaca6b2

* commit 'b97aaca6b283573e5dd035d4cfd92fd5450ac96f':
  Revert "logd: liblog: logcat: switch to android_log_clockid()"
2015-12-08 00:00:04 +00:00
Mark Salyzyn
48946e48e5 Merge "logd: liblog: logcat: switch to android_log_clockid()" am: 9eca0e775b am: 8acc9bc1cb
am: 945bde67f3

* commit '945bde67f39f119d5c3b3136de4b7757f1adc7b6':
  logd: liblog: logcat: switch to android_log_clockid()
2015-12-07 23:59:51 +00:00
Elliott Hughes
ef119a14b8 Merge "Track rename of base/ to android-base/." am: 912ed3d8ca am: e2a9563be1
am: 3608ee5e90

* commit '3608ee5e903689ea7c433587be664649689816e1':
  Track rename of base/ to android-base/.
2015-12-07 23:59:44 +00:00
Dimitry Ivanov
beceb6ef53 Merge "Native loader as a separate library" 2015-12-07 23:45:50 +00:00
Mark Salyzyn
f8e546e609 liblog: Support for ANDROID_LOG_WRAP mode flag on reader
If ANDROID_LOG_WRAP is specified, add timeout=3600 to the reader
request. logd will comply by going to sleep with the socket open.
If the start time is about to wrap or get pruned in the specified log
buffers, then wakeup and dump the logs; or wakeup on timeout,
whichever comes first.

Bug: 25929746
Change-Id: I531b4317a20abcf3ba87d78c68fa2f268a4488ab
2015-12-07 14:24:02 -08:00
Dimitry Ivanov
ac1b1919f8 Native loader as a separate library
Extracted native loader to separate library in order to
be able to reuse it for NativeActivities related native code
in libandroid_runtime.so

Bug: http://b/22548808
Change-Id: Ibcf5ddcdc5aba22e32e4b72887840e9c171c1986
2015-12-07 12:59:02 -08:00
Mark Salyzyn
ba7a9a016b logd: liblog: logcat: switch to android_log_clockid() (2)
android_log_timestamp returns the property leading letter,
it is better to return a clockid_t with android_log_clockid()

Bug: 23668800
Change-Id: I38dee773bf3844177826b03a26b03215c79a5359
2015-12-07 18:45:31 +00:00