Dimitry Ivanov
2c7960c8d9
Make libutils symbols protected
...
This change is a workaround for apps linking
libutils statically and dynamically which causes
them to crash for newer version of Android.
Bug: http://b/27313399
Change-Id: I47ac4146041b6eeef03cb605ea436719d552ec8f
2016-02-25 11:44:35 -08:00
James Hawkins
22b6f7a559
resolve merge conflicts of 0f5d443d0c
to nyc-dev-plus-aosp
...
Change-Id: I850bda0808ae17ade5bc0e667211a599d284d6e3
2016-02-19 11:10:30 -08:00
James Hawkins
bd04bb0d29
Merge "system/core: Cleanup direct calls to opendir by containing in a std::unique_ptr."
2016-02-19 17:49:13 +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
James Hawkins
588a2cad7f
system/core: Cleanup direct calls to opendir by containing in a
...
std::unique_ptr.
Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -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
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
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
Nick Kralevich
261952e570
Merge "more O_CLOEXEC" am: 920d637d25
...
am: 890cd99709
* commit '890cd997098795b7a58c1d56c49c23895da7b4f9':
more O_CLOEXEC
2015-12-18 23:05:34 -08:00
Nick Kralevich
c68c8862f9
more O_CLOEXEC
...
Change-Id: I330aef8d6f1fc35d6649995ef312954b84dff555
2015-12-18 20:57:25 -08:00
Sergio Giro
43f13d0d68
Merge "libutils: fix cache removal when callback invalidates the key" am: b0df9dca7c
am: e483305e47
...
am: a96cd36afb
* commit 'a96cd36afbff682e24365092dd85bbe9c9165afc':
libutils: fix cache removal when callback invalidates the key
2015-11-20 17:17:38 +00:00
Sergio Giro
b7170fe3fe
libutils: fix cache removal when callback invalidates the key
...
Bug: 24785286
Change-Id: I9d17d2247258a56ef7776b3a701389e825a9c533
2015-11-20 14:54:51 +00:00
Dan Albert
8f3ef3fd09
Merge "Use std::unique_ptr instead of UniquePtr." am: 0f61f86870
am: 0c69e9f271
...
am: 40f76c2fed
* commit '40f76c2fedb18664adab73e40b8b64227601d4e6':
Use std::unique_ptr instead of UniquePtr.
2015-11-05 21:11:03 +00:00
Dan Albert
f2d2509690
Use std::unique_ptr instead of UniquePtr.
...
Bug: http://b/22403888
Change-Id: I398fa43b8f33c9281d7ff238521d75f1dcb8a5e7
2015-11-05 01:09:22 -08:00
John Reck
dc7694eac5
Merge "Teach sp<> how to std::move" am: 518d043c86
am: bb12b91ae1
...
am: a573d6b186
* commit 'a573d6b18686266667c8efd9d7291ecd28efa67c':
Teach sp<> how to std::move
2015-11-03 00:14:15 +00:00
John Reck
bb12b91ae1
Merge "Teach sp<> how to std::move"
...
am: 518d043c86
* commit '518d043c8693835061b02ecbbee4b82fc61a776e':
Teach sp<> how to std::move
2015-11-02 21:39:24 +00:00
John Reck
d69089a742
Teach sp<> how to std::move
...
Arguably we should migrate to std::shared_ptr
but for now make std::vector<sp<>> a bit less
horrible
Change-Id: Ia458a2daff0b656b2f3310b3ea100565ec844c69
2015-10-29 07:17:40 -07:00
Andy Hung
6db2d260b2
Merge "Disable sanitization for LinearTransform" am: c52b3c08fa
am: 0d3b144372
...
am: eb1adff81e
* commit 'eb1adff81e8d7752248c42c4dcb525ec085853e1':
Disable sanitization for LinearTransform
2015-10-22 19:50:52 +00:00
Andy Hung
0d3b144372
Merge "Disable sanitization for LinearTransform"
...
am: c52b3c08fa
* commit 'c52b3c08fa5ea3680ffcd68c2a1d0542d09f0509':
Disable sanitization for LinearTransform
2015-10-22 19:46:20 +00:00
Andy Hung
13c19e7703
Disable sanitization for LinearTransform
...
Avoids potential crash on Fugu.
Bug: 25160007
Change-Id: I2e883539e36204821f3eb97f0ae4a4854014f048
2015-10-22 11:20:45 -07:00
Sergio Giro
d155004e78
am 51209a8b
: am 9443fd94
: am f8376607
: Merge "system/core: fix iterator for LruCache"
...
* commit '51209a8b93d85f8b7f3b6a106c41c1aa03190f2c':
system/core: fix iterator for LruCache
2015-10-13 07:45:36 +00:00
Sergio Giro
9443fd94e3
am f8376607
: Merge "system/core: fix iterator for LruCache"
...
* commit 'f83766079e248e04065103a4720364c0193777ee':
system/core: fix iterator for LruCache
2015-10-13 07:36:52 +00:00
Sergio Giro
0cb59c0dce
system/core: fix iterator for LruCache
...
Was failing to return the first element
Change-Id: Ic803f5d463a56519212014d0d190407cf4b859cf
2015-10-12 16:13:44 +01:00
Adam Lesinski
7e59e17474
am 0b2bce06
: am bda375fa
: am c6c6ab50
: Merge "Implement C++11 move semantics for android::FileMap"
...
* commit '0b2bce06382b5517a4dba33da5328c751f2c7a3e':
Implement C++11 move semantics for android::FileMap
2015-10-02 01:31:53 +00:00
Adam Lesinski
0b2bce0638
am bda375fa
: am c6c6ab50
: Merge "Implement C++11 move semantics for android::FileMap"
...
* commit 'bda375fa41c88e6b2f81a8cd88fc5fdda62bc723':
Implement C++11 move semantics for android::FileMap
2015-10-02 01:25:31 +00:00
Adam Lesinski
bda375fa41
am c6c6ab50
: Merge "Implement C++11 move semantics for android::FileMap"
...
* commit 'c6c6ab50bc11d55f3135312ceccbcf0c400b437e':
Implement C++11 move semantics for android::FileMap
2015-10-02 01:19:25 +00:00
Sergio Giro
a5f71e075a
system/core: remove BasicHashtable
...
Towards deprecation of SharedBuffer
Change-Id: Id6d1c8637583df38b6f28398b6804d9c1e96472a
(cherry picked from commit f84a4906fa
)
2015-10-01 13:18:13 -07:00
Adam Lesinski
6f8885bc14
Implement C++11 move semantics for android::FileMap
...
FileMaps should be movable, thereby not requiring them to be only used
with a unique_ptr as they currently are.
Change-Id: I0fb8013bf398a2ced5420d85ba888c2a7fc5a496
2015-10-01 12:47:49 -07:00
Sergio Giro
3412280cbc
resolved conflicts for 075f690d
to master
...
Change-Id: I35b870a1e43b9a4b9f09ecabee68c54f993b036f
2015-10-01 20:21:56 +01:00
Sergio Giro
075f690dae
am bdae9bf2
: resolved conflicts for 70808827
to stage-aosp-master
...
* commit 'bdae9bf2ec3bbf8e33a34caa412bd8fd7bc2d434':
system/core: remove BasicHashtable
2015-10-01 18:59:59 +00:00
Sergio Giro
bdae9bf2ec
resolved conflicts for 70808827
to stage-aosp-master
...
Change-Id: I2de8a63fa5be5423846df4c2e8ccc5f12e843f09
2015-10-01 19:49:22 +01:00
Sergio Giro
45dd164bff
Revert "resolved conflicts for 70808827
to stage-aosp-master"
...
This reverts commit 5cf2d5c9cc
.
Change-Id: Ifcffff034d4610c0d318cf67b0d98a28551c9605
2015-10-01 18:33:25 +00:00
Sergio Giro
5cf2d5c9cc
resolved conflicts for 70808827
to stage-aosp-master
...
Change-Id: I5e5030a20f2be3bd15b9fec8192dd22ec5a34d87
2015-10-01 18:54:33 +01:00
Sergio Giro
f84a4906fa
system/core: remove BasicHashtable
...
Towards deprecation of SharedBuffer
Change-Id: Id6d1c8637583df38b6f28398b6804d9c1e96472a
2015-10-01 11:44:47 +01:00
Sergio Giro
58a25053c6
am c559a9b5
: am b5a00d6b
: am e0453334
: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
...
* commit 'c559a9b52fe79c5be32121f8f82c672a5eac94ef':
system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:20:21 +00:00
Sergio Giro
c559a9b52f
am b5a00d6b
: am e0453334
: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
...
* commit 'b5a00d6b2e9a386701cf9f3f5997837496a5aa57':
system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:11:38 +00:00
Sergio Giro
b5a00d6b2e
am e0453334
: Merge "system/core: remove methods returning SharedBuffer in String8, String16"
...
* commit 'e045333445ab3ebb8d602d25ed750169f135baa6':
system/core: remove methods returning SharedBuffer in String8, String16
2015-09-30 20:04:50 +00:00
Sergio Giro
0e7fb13d57
libutils: fix compile error in SharedBufferTest
...
Change-Id: Ib1185d417457d03efa102989a64b5b5e4eb5c82a
2015-09-30 10:44:17 -07:00
Sergio Giro
e045333445
Merge "system/core: remove methods returning SharedBuffer in String8, String16"
2015-09-30 15:21:48 +00:00
Sergio Giro
282efae9c3
system/core: remove methods returning SharedBuffer in String8, String16
...
Towards deprecation of SharedBuffer
Change-Id: I3069837db32837bcc0f5d8f1118ccd502c9070dc
2015-09-30 15:42:02 +01:00
Sergio Giro
9428978318
am fbb259e8
: am 8e2c8208
: am 730fdbb1
: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
...
* commit 'fbb259e83633c35c5e6ede1d5f55f5672ab433d0':
system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:31:45 +00:00
Sergio Giro
fbb259e836
am 8e2c8208
: am 730fdbb1
: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
...
* commit '8e2c8208198c1c73c7192b1bd5e87868b53297c6':
system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:26:23 +00:00
Sergio Giro
8e2c820819
am 730fdbb1
: Merge "system/core: change LruCache to use unordered_set instead of BasicHashTable"
...
* commit '730fdbb1ca4c39a4d69868f7a261b023f2bea296':
system/core: change LruCache to use unordered_set instead of BasicHashTable
2015-09-30 13:20:02 +00:00
Sergio Giro
bb58cde899
system/core: change LruCache to use unordered_set instead of BasicHashTable
...
Towards deprecation of BasicHashTable
Change-Id: I3f3d904636a85a794cccf972f6e4a94e7f3808f5
2015-09-30 13:48:30 +01:00
Sergio Giro
21ca798137
resolved conflicts for 8dba9a7b
to master
...
Change-Id: I314e3fc4dffbff1f7030533a821696692d03b33d
2015-09-23 22:03:30 +01:00
Sergio Giro
8dba9a7bf1
libutils: fix compile error in SharedBufferTest
...
Change-Id: Ib1185d417457d03efa102989a64b5b5e4eb5c82a
2015-09-23 21:22:14 +01:00
Sergio Giro
fa2f9d603c
am c565bdb6
: am f777655d
: resolved conflicts for 6ee734cf
to stage-aosp-master
...
* commit 'c565bdb67b801fe2b4965b44e53dccfd9097993c':
libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
2015-09-23 19:50:33 +00:00
Sergio Giro
c565bdb67b
am f777655d
: resolved conflicts for 6ee734cf
to stage-aosp-master
...
* commit 'f777655d85af3aefa4a1683f289da1ec67988330':
libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
2015-09-23 17:15:12 +00:00
Sergio Giro
f777655d85
resolved conflicts for 6ee734cf
to stage-aosp-master
...
Change-Id: Ia06c4d941d9b8828707299bb363f51fab5549897
2015-09-23 17:58:25 +01:00
Sergio Giro
d2529f2830
libutils: hide SharedBuffer by moving SharedBuffer.h to the implementation directory
...
Some methods in header files of classes using SharedBuffer need
to be moved to the implementation files accordingly
Change-Id: I891f3ace2b940ab219e4e449040bfed71c0547db
2015-09-23 16:22:59 +01:00
Brian Carlstrom
7ae1d6590b
am 16bed965
: am 742d0173
: am 661600dd
: am 110f705e
: resolved conflicts for 832a0d1c
to mnc-dev
...
* commit '16bed9650aa493194b4091700ac81c9c882d96b2':
libutils: Fix integer overflows in VectorImpl.
2015-09-20 01:25:14 +00:00
Brian Carlstrom
16bed9650a
am 742d0173
: am 661600dd
: am 110f705e
: resolved conflicts for 832a0d1c
to mnc-dev
...
* commit '742d0173e8bd41e137d175c04860c532270b3f5b':
libutils: Fix integer overflows in VectorImpl.
2015-09-20 01:21:47 +00:00
Brian Carlstrom
110f705e10
resolved conflicts for 832a0d1c
to mnc-dev
...
Change-Id: Ic46ee60de7bc500f4e1d5fe841524db80918a8d9
2015-09-19 17:29:42 -07:00
Brian Carlstrom
832a0d1c64
resolved conflicts for cf676a86
to lmp-mr1-ub-dev
...
Change-Id: Ifd9a44777a472ae893f894391bff7ef81456d92c
2015-09-19 16:13:00 -07:00
Narayan Kamath
419e6c3c68
libutils: Fix integer overflows in VectorImpl.
...
Use external/safe-iop to check for overflows on arithmetic
operations.
Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.
Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.
bug: 22953624
(cherry picked from commit c609c31fb5
)
Change-Id: I61644633db6b54fa230683615de9724f7fabf6fb
2015-09-09 12:05:06 +01:00
Narayan Kamath
69b9a8bf21
am 51e740f8
: resolved conflicts for 32d86587
to mnc-dr-dev-plus-aosp
...
* commit '51e740f802083cc250a2f6228222bcbbcec79887':
libutils: Fix integer overflows in VectorImpl.
2015-09-08 13:07:52 +00:00
Narayan Kamath
51e740f802
resolved conflicts for 32d86587
to mnc-dr-dev-plus-aosp
...
Change-Id: I381133e7dd93f908bd3d2b42e8af83d954e428af
2015-09-08 13:59:49 +01:00
Sergio Giro
df5151d30f
libutils: add test for String8
...
Test crashes with SIGSEGV without the fix in b/23290056, passes otherwise.
Bug: 23290056
Change-Id: I6daca0aa07b5e97b004a9606a0227227fae11896
2015-09-07 17:12:45 +01:00
Dan Willemsen
c91a974e2e
am 54afdbae
: am a4b8f9f1
: am bfe32228
: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
...
* commit '54afdbaef79c7265395d0b84f54c96c7c9f11322':
Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 02:25:35 +00:00
Dan Willemsen
a4b8f9f1c2
am bfe32228
: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
...
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Dan Willemsen
87a419c8b1
Remove USE_MINGW/CYGWIN; Whitelist windows modules
...
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.
Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Narayan Kamath
c609c31fb5
libutils: Fix integer overflows in VectorImpl.
...
Use external/safe-iop to check for overflows on arithmetic
operations.
Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.
Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.
bug: 22953624
Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
2015-09-02 12:37:49 +01:00
Nick Kralevich
63e5142283
am 6b86f3fe
: am 5e44f5cc
: am 2c58af52
: Merge "VectorImpl.cpp: fix benign multiplication overflow"
...
* commit '6b86f3fe304c7aa4f2c629a1cacd84428aad9a3e':
VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:46:51 +00:00
Nick Kralevich
5e44f5cc0c
am 2c58af52
: Merge "VectorImpl.cpp: fix benign multiplication overflow"
...
* commit '2c58af52232f0c8b4ab09d75eba66d1283805cab':
VectorImpl.cpp: fix benign multiplication overflow
2015-08-28 17:28:37 +00:00
Nick Kralevich
c76698f24e
VectorImpl.cpp: fix benign multiplication overflow
...
j is a ssize_t, which can go negative. If it goes negative,
the resulting multiplication of mItemSize*j doesn't make
any sense. Since the value is never used, just don't perform
the calculation if j < 0.
Bug: 23607865
Change-Id: I14f6f6506645d582f7d67a2e2d60ead3cb18b957
2015-08-28 06:40:23 -07:00
Abhishek Arya
09f2d36e1d
am 5b33306d
: Merge "libutils: fix overflow in SharedBuffer [DO NOT MERGE]" into mnc-dev
...
* commit '5b33306dba456ec906f7c9bd522681c1de137f78':
libutils: fix overflow in SharedBuffer [DO NOT MERGE]
2015-08-26 20:12:44 +00:00
Bart Sears
170bde83ae
resolved conflicts for merge of 7c327194
to lmp-mr1-ub-dev
...
Change-Id: I236367bd60046ba06669cbcdae81184f9d0a74c7
2015-08-26 12:59:28 -07:00
Sergio Giro
d95e47f136
libutils: fix overflow in SharedBuffer [DO NOT MERGE]
...
See
https://code.google.com/p/android/issues/detail?id=181910
Bug: 22952485
(cherry picked from commit 66b6eb9490
)
Change-Id: I363f49b5b3c6b7b3ac08cba2c14d72c431588c5a
2015-08-25 17:40:47 +01:00
Sergio Giro
0cc9a6e6e1
libutils: fix overflow in SharedBuffer [DO NOT MERGE]
...
See
https://code.google.com/p/android/issues/detail?id=181910
Bug: 22952485
(cherry picked from commit 66b6eb9490
)
Change-Id: Ic71dd0025b9a7588c4f3bb1c7be1bd13d2ff5105
2015-08-25 16:18:16 +01:00
Nick Kralevich
223286e396
am b37862e4
: am 7ec4c228
: am e80ec0c5
: Merge "libutils: Enable LOCAL_SANITIZE := integer"
...
* commit 'b37862e4988f90fdbc3e2e48dd72368690579d6d':
libutils: Enable LOCAL_SANITIZE := integer
2015-08-24 23:40:16 +00:00
Nick Kralevich
b37862e498
am 7ec4c228
: am e80ec0c5
: Merge "libutils: Enable LOCAL_SANITIZE := integer"
...
* commit '7ec4c228ee9d50d16306331abacb607bc70fadd8':
libutils: Enable LOCAL_SANITIZE := integer
2015-08-24 21:51:14 +00:00
Nick Kralevich
2bcb9221d4
am 7ec4c228
: am e80ec0c5
: Merge "libutils: Enable LOCAL_SANITIZE := integer"
...
* commit '7ec4c228ee9d50d16306331abacb607bc70fadd8':
libutils: Enable LOCAL_SANITIZE := integer
2015-08-24 21:51:09 +00:00
Nick Kralevich
4d587f2f9a
libutils: Enable LOCAL_SANITIZE := integer
...
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.
Change-Id: I475e5e9fb04160dd2d201e926ab2b897539f8bb6
2015-08-24 10:51:38 -07:00
Nick Kralevich
58e3d3e627
am 567bb226
: am 4f0a7cb8
: am 786e5e26
: Merge "libutils: cleanups for -fsanitize=integer"
...
* commit '567bb2265039097d8fe272240596b12af35468c4':
libutils: cleanups for -fsanitize=integer
2015-08-24 16:27:12 +00:00
Nick Kralevich
567bb22650
am 4f0a7cb8
: am 786e5e26
: Merge "libutils: cleanups for -fsanitize=integer"
...
* commit '4f0a7cb8e15ce50f7da6a71c96335bd0b7394492':
libutils: cleanups for -fsanitize=integer
2015-08-24 16:02:51 +00:00
Nick Kralevich
50659902d2
am 4f0a7cb8
: am 786e5e26
: Merge "libutils: cleanups for -fsanitize=integer"
...
* commit '4f0a7cb8e15ce50f7da6a71c96335bd0b7394492':
libutils: cleanups for -fsanitize=integer
2015-08-24 16:02:36 +00:00
Nick Kralevich
1f28698998
libutils: cleanups for -fsanitize=integer
...
* Hashing functions rely on integer overflow behavior.
Mark those functions as safe.
* abort() if a passed in size_t value is greater than
UINT32_MAX. This can occur on 64 bit builds where size_t
is larger than uint32_t.
* Special case the index lookup for an empty sorted vector.
Without the special case, size() == 0, and size()-1 underflows.
Change-Id: I343a14b589fc8f0d221c1998ae5d6f0b9e2781f8
2015-08-24 15:52:22 +00:00
Sergio Giro
7987b83553
libutils: fix overflow in SharedBuffer
...
See
https://code.google.com/p/android/issues/detail?id=181910
Bug: 22952485
Change-Id: Idcc7e581a69436c8a623659fbd9add9e5f0d4c74
2015-08-21 14:17:32 +01:00
Abhishek Arya
d1a6188e8c
am a77a0487
: am 219a006f
: am fc5fdc85
: am e45d96d6
: am 19398a71
: am d34846b7
: am cd407a17
: am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit 'a77a0487525df3add570605e58a7eb3a03eca6a8':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 07:40:02 +00:00
Abhishek Arya
64e2d8c0dc
am 219a006f
: am fc5fdc85
: am e45d96d6
: am 19398a71
: am d34846b7
: am cd407a17
: am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit '219a006f89a5448a9a6eeb1f37ad0088e85bd3f8':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 07:12:31 +00:00
Abhishek Arya
219a006f89
am fc5fdc85
: am e45d96d6
: am 19398a71
: am d34846b7
: am cd407a17
: am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit 'fc5fdc85683f87c42d5ce7bcee4e2b70ef0acdd0':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 07:05:07 +00:00
Abhishek Arya
fc5fdc8568
am e45d96d6
: am 19398a71
: am d34846b7
: am cd407a17
: am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit 'e45d96d6bf592f0ae20bb021ea529acc94e0cb55':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 06:54:21 +00:00
Abhishek Arya
d34846b70b
am cd407a17
: am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit 'cd407a17fe326f3e18866ddddb1c747b06a45fc0':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 06:23:50 +00:00
Abhishek Arya
cd407a17fe
am e0dce90b
: Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
* commit 'e0dce90b0de2b2b7c2baae8035f810a55526effb':
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-21 06:18:47 +00:00
Abhishek Arya
e0dce90b0d
Fix compile failure after rIfe1dc0791040150132bea6884f1e6c8d31972d1b
...
Bug: 23290056
Change-Id: If6e22b0159de6635a8ca5305895b7718f15becc7
2015-08-20 21:55:55 -07:00
Sergio Giro
93f106b8d0
am e97682be
: am a1a22b57
: am e67b5848
: am 4956c0fe
: am 5b85b1d4
: libutils: fix overflow in String8::allocFromUTF8
...
* commit 'e97682be0634fe773f70097bc518e5d034efe8f7':
libutils: fix overflow in String8::allocFromUTF8
2015-08-20 22:58:19 +00:00
Sergio Giro
e67b584869
am 4956c0fe
: am 5b85b1d4
: libutils: fix overflow in String8::allocFromUTF8
...
* commit '4956c0fe1e582a8497aff34a41aeb8bf4748eef0':
libutils: fix overflow in String8::allocFromUTF8
2015-08-20 22:28:53 +00:00
Sergio Giro
4956c0fe1e
am 5b85b1d4
: libutils: fix overflow in String8::allocFromUTF8
...
* commit '5b85b1d40d619c2064d321364f212ebfeb6ba185':
libutils: fix overflow in String8::allocFromUTF8
2015-08-20 22:23:47 +00:00
Sergio Giro
5b85b1d40d
libutils: fix overflow in String8::allocFromUTF8
...
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908
Bug: 23290056
(cherry picked from commit 4eeacbeec0
)
Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b
(cherry picked from commit ebabef2752
)
2015-08-18 20:52:25 +00:00
Sergio Giro
c4abbcbdde
am f468d1e1
: am 1d44be87
: Merge "libutils: fix overflow in String8::allocFromUTF8"
...
* commit 'f468d1e14c0bb777d557a6a86dead260e40ff8aa':
libutils: fix overflow in String8::allocFromUTF8
2015-08-18 17:25:33 +00:00
Sergio Giro
ba71601aac
am 29c12755
: Merge "libutils: fix overflow in String8::allocFromUTF8" into mnc-dev
...
* commit '29c1275519ef85fa3f30be351f19dc6e7eedbee9':
libutils: fix overflow in String8::allocFromUTF8
2015-08-18 17:19:10 +00:00
Sergio Giro
ebabef2752
libutils: fix overflow in String8::allocFromUTF8
...
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908
Bug: 23290056
(cherry picked from commit 4eeacbeec0
)
Change-Id: Ife1dc0791040150132bea6884f1e6c8d31972d1b
2015-08-18 18:06:38 +01:00
Sergio Giro
1d44be87ff
Merge "libutils: fix overflow in String8::allocFromUTF8"
2015-08-18 17:04:07 +00:00
Sergio Giro
4eeacbeec0
libutils: fix overflow in String8::allocFromUTF8
...
Patch contributed in:
https://code.google.com/p/android/issues/detail?id=182908
Bug: 23290056
Change-Id: Ide0e9a8acc4e95a9104bab3ae803aa3a40098222
2015-08-18 14:44:54 +01:00
Nick Kralevich
eec5baa0f7
am 77b9868a
: am 6d814037
: Merge "libutils: fix signed/unsigned comparison warnings"
...
* commit '77b9868af9313ab5b7f62d7fea709dbfb519dd2c':
libutils: fix signed/unsigned comparison warnings
2015-08-18 04:16:13 +00:00
Nick Kralevich
a0683307e7
am 77b9868a
: am 6d814037
: Merge "libutils: fix signed/unsigned comparison warnings"
...
* commit '77b9868af9313ab5b7f62d7fea709dbfb519dd2c':
libutils: fix signed/unsigned comparison warnings
2015-08-18 04:15:23 +00:00
Nick Kralevich
3e6c451908
libutils: fix signed/unsigned comparison warnings
...
Change-Id: Ib283c85a404a20688c5357fa513e5d07c2f42803
2015-08-17 20:54:15 -07:00
Elliott Hughes
5ec940aed8
am fb1ecbc5
: am e6e71608
: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
...
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:27 +00:00
Elliott Hughes
145afc2cc4
am fb1ecbc5
: am e6e71608
: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
...
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:15 +00:00
Elliott Hughes
e6e71608bd
Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
2015-07-30 16:34:47 +00:00
Elliott Hughes
9b828adfad
Use __ANDROID__ instead of HAVE_ANDROID_OS.
...
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
bb9c0a0031
am 42dbc4b1
: am 44443bea
: Merge "Use _WIN32 rather than HAVE_WINSOCK."
...
* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:17:38 +00:00
Elliott Hughes
c6dbc85845
am 42dbc4b1
: am 44443bea
: Merge "Use _WIN32 rather than HAVE_WINSOCK."
...
* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:17:07 +00:00
Elliott Hughes
adbf442a51
Use _WIN32 rather than HAVE_WINSOCK.
...
Change-Id: I9855b6fe72e2f2f3a8360c0993a67cb988024ee4
2015-07-29 17:45:24 -07:00
Elliott Hughes
2c1917f156
am 34c92f46
: am fc2f1e61
: Merge "Move libutils off AndroidConfig.h."
...
* commit '34c92f4652651697a7de7fa10c214afed9a6658a':
Move libutils off AndroidConfig.h.
2015-07-30 00:16:18 +00:00
Elliott Hughes
92a3d2ba32
am 34c92f46
: am fc2f1e61
: Merge "Move libutils off AndroidConfig.h."
...
* commit '34c92f4652651697a7de7fa10c214afed9a6658a':
Move libutils off AndroidConfig.h.
2015-07-30 00:15:35 +00:00
Elliott Hughes
1f8bc86a7d
Move libutils off AndroidConfig.h.
...
Change-Id: Ia0e4a4f968c640eb44317821d2dc6b195f9f490e
2015-07-29 14:31:54 -07:00
Elliott Hughes
5b8ff09578
resolved conflicts for merge of b40ebc54
to mnc-dev-plus-aosp
...
Change-Id: I9da05b46da2326ae21d164b137be57a9b5220f7b
2015-06-30 15:17:14 -07:00
Elliott Hughes
6ed68cc412
Consistently use strerror in libutils.
...
It's easier for people to debug, and side-steps the problem that errno
values differ between architectures.
Bug: http://b/17458391
Change-Id: I1db9b2cbb653839d3936b91e37e5cff02671318a
2015-06-30 10:41:15 -07:00
Evgenii Stepanov
fc21508615
am 3c90808d
: am c1c7f457
: Merge "Add a space before :=."
...
* commit '3c90808d6d257d75d5ebd64af5d0374aa4f03cb4':
Add a space before :=.
2015-06-13 02:25:34 +00:00
Evgenii Stepanov
6aaf740834
Add a space before :=.
...
Change-Id: Ib1d94648cdc163675ac7b6acf86408d5be6b5ad2
2015-06-12 14:18:33 -07:00
Jeff Brown
20432c237c
Merge "Work around spurious epoll notifications." into mnc-dev
2015-05-30 00:43:10 +00:00
Jeff Brown
18a574f715
Work around spurious epoll notifications.
...
Sometimes it seems like we can get into a situation where we are
unable to remove an fd from the epoll set but it keeps sending us
events anyhow. Defensively rebuild the epoll set in this case
to prevent us from spinning forever.
Bug: 21271428
Change-Id: I5607e565f2e12460d7113a1f62a70d38d334e271
2015-05-29 17:40:25 -07:00
Michael Lentine
6078805023
Adding a build id check to blob cache.
...
Add a build id field to the header structure in blob cache. Add build
id support with reading and writing the cache. When the cache gets
written it writes the build id at the end of the header. When read it
checks to see if there is a match between the current version and the
version in the cache. If not, it invalidates the cache which would
typically only occur during an ota update. Also remove blob cache
from the host build.
bug: 18262905
Change-Id: I753b1de1986703a4c1c8691b9d2bb533b2546143
2015-05-18 13:14:32 -07:00
John Reck
52fc3e9aa8
Move LinearAlloc to libhwui
...
Change-Id: I83a70959ed0dcab2237faaf1dddc02b5eb0363c9
2015-04-23 15:07:54 -07:00
Elliott Hughes
c72bd16ce8
am 8d2cd035
: am 2ddb9cb1
: am ed43be39
: Merge "Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it\'s not needed."
...
* commit '8d2cd03547c76f6c670b33d4fe6d44b646c14b45':
Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.
2015-04-02 22:07:16 +00:00
Elliott Hughes
bcc2b5f44a
Remove LOCAL_ADDITIONAL_DEPENDENCIES in cases where it's not needed.
...
Change-Id: I720b8ef1050da45a7833adef8219b6acb2cf3a38
2015-04-02 14:31:07 -07:00
Tim Kilbourn
8892ce6383
Use eventfd instead of pipe in Looper.
...
Bug: 19933224
Change-Id: I6611e918db960bbb0e74f8308e10bdf79510b899
2015-03-27 09:15:43 -07:00
Dan Albert
a83ba64a23
Revert "Revert "Create libbase.""
...
This reverts commit a7870d8816
.
(cherry picked from commit c007bc3856
)
2015-03-16 13:48:07 -07:00
Dan Albert
c007bc3856
Revert "Revert "Create libbase.""
...
This reverts commit a7870d8816
.
2015-03-16 10:08:46 -07:00
Nicolas Geoffray
a6000e81dc
am 90a968f0
: am dd581695
: Merge "Revert "Create libbase.""
...
* commit '90a968f0e3fb903aad41f6689c337a7e4a8d5c7b':
Revert "Create libbase."
2015-03-16 11:25:38 +00:00
Nicolas Geoffray
a7870d8816
Revert "Create libbase."
...
Breaks internal master.
This reverts commit 98ff77204c
.
Change-Id: I18dc6021cb43efff8aa88486c2d980dc2b8eedba
2015-03-16 11:07:29 +00:00
Dan Albert
06d60af714
am 517f65da
: am a68c8148
: Merge "Create libbase."
...
* commit '517f65daef177d06d7835300a1c23ce3409c0643':
Create libbase.
2015-03-15 22:33:53 +00:00
Dan Albert
98ff77204c
Create libbase.
...
Move StringPrintf and the string based file I/O from libutils to
libbase.
Change-Id: I0297a6063874b9d92100e0dd5123fddfbda932fe
2015-03-14 16:36:18 -07:00
Jeff Brown
e7d54f80cb
Fix issues related to removing Looper callbacks after close.
...
When a file descriptor is closed before removing it from the
epoll set, it will normally be removed automatically from the
epoll set by the kernel. However if there exists a duplicate
then the original file descriptor may remain in the set and
continue to receive events until all duplicates have been closed.
Unfortunately due to kernel limitations we need to rebuild the epoll
set from scratch because it may contain an old file handle that we are
now unable to remove since its file descriptor is no longer valid.
No such problem would have occurred if we were using the poll system
call instead, but that approach carries others disadvantages.
Bug: 19715279
Change-Id: If1ab8ebda0825755a416d513e888942a02ee3948
2015-03-12 19:44:49 -07:00
Jeff Brown
7a0310ef67
Fixed subtle bugs related to file descriptor recycling.
...
Added code to protect against situations that may occur when a
Looper callback has the side-effect of closing the file descriptor that
it is watching before it returns. This code pattern is very
convenient for implementation but it does expose issues in how
the list of callbacks is maintained. In particular, we
need to watch out for file descriptors which have been reused.
This change may resolve previously unexplained ANRs associated with
log messages such as: "Error modifying epoll events for fd 44, errno=2"
Bug: 10349083
Change-Id: I20eedf6ffbdeda382653ca0104962505194741b0
2015-03-11 15:00:36 -07:00
Jeff Brown
27e5721860
Rename Looper::isIdling() to isPolling() to resolve confusion.
...
The loop isn't technically idle at this time, it's just checking
whether any file descriptors have pending events. However it's
still a good signal as to whether the loop is alive.
Bug: 19532373
Change-Id: I555c473e70ffd8a56e1b10aa60026eb674a16de9
2015-03-11 15:00:36 -07:00
Narayan Kamath
6832a7a4e0
Remove useless refCounting from FileMap.
...
Nobody ever called acquire() so release() was always
equivalent to delete. Just use delete instead so that
people can use unique_ptr directly (or shared_ptr if
they really want refcounts).
Change-Id: I9e3ad5e0f6a4fcc4e02e5a2ff7ef9514fe234415
2015-02-23 15:49:43 +00:00
Narayan Kamath
1158c7d5fe
Merge "Remove reference to NOT_USING_KLIBC and cygwin."
2015-02-20 16:40:33 +00:00
Narayan Kamath
5955a9f5e4
Remove reference to NOT_USING_KLIBC and cygwin.
...
The reference to NOT_USING_KLIBC appears to be the only one
in our codebase. This change also removes some cygwin specific
retry logic - all other supported platforms in this section
of the code should support mapping at an offset.
Note that i've reversed the sense of the check, we always sysconf
since that's recommended practice.
Change-Id: Ib985fb665193d7a07a282f7092cd77c0bc508a66
2015-02-19 18:36:27 +00:00
Elliott Hughes
9d1f515ed1
Fix the WriteStringToFile overload that takes mode/owner/group.
...
The actual bug is == instead of !=, but the real cause was me trying to be
too clever. This patch switches to much simpler code, and -- since the
intended use of this code is security anyway -- adds logging if anything
goes wrong.
Bug: 19361774
Change-Id: If2af07d31a5002f9010b838247b691f6b28bdfb1
2015-02-17 10:25:23 -08:00
Elliott Hughes
f682b4786a
Clean up reading and writing in init.
...
This isn't particularly useful in and of itself, but it does introduce the
first (trivial) unit test, improves the documentation (including details
about how to debug init crashes), and made me aware of how unpleasant the
existing parser is.
I also fixed a bug in passing --- unless you thought the "peboot" and "pm"
commands were features...
Bug: 19217569
Change-Id: I6ab76129a543ce3ed3dab52ef2c638009874c3de
2015-02-06 14:20:30 -08:00
Elliott Hughes
31fa09c1c6
Fix Windows build.
...
Only two days in, and I'm already really regretting putting this code
somewhere that builds for Mac OS and Windows...
Change-Id: I576ee4a9e647e10dc2d47c7e1e38aedee2bf404c
2015-02-04 19:38:28 -08:00
Elliott Hughes
202f024dee
Add a WriteStringToFile overload that cares about permissions.
...
Change-Id: I857a80b61768d4e9610bdd149eff2d9d8e48d2c0
2015-02-04 14:30:23 -08:00
Elliott Hughes
6b3be2902d
Add Google-style StringPrintf.
...
Change-Id: If333c28b8ed047346a2dd85e591c4bedbab874cc
2015-02-03 15:21:07 -08:00
Elliott Hughes
af4885a4a8
Fix Mac build.
...
I knew I should have created a new library that doesn't build for the
Mac or Windows rather than adding to libutils...
Change-Id: I7c07eaa93affb7e83d4da384f03652c39065562a
2015-02-03 13:02:57 -08:00
Elliott Hughes
dec12b2b71
Add Google-style ReadFileToString and WriteStringToFile.
...
Bug: 19217569
Change-Id: I64789d3fa6777ee30a324cdf00fdc275c1230e1b
2015-02-03 12:18:11 -08:00
Yabin Cui
4a6e5a3b64
Kill HAVE_PTHREADS.
...
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Elliott Hughes
292ccd3c18
Fix references to HAVE_PRCTL.
...
Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
2014-12-15 12:52:53 -08:00
Trevor Drake
dabdbf9a6e
Clean up libutils Android.mk
...
Removed LOCAL_C_INCLUDES as the external/zlib headers are no longer
referenced by anything in libutils.
Removed unused host_commonLdlibs build variable. This was referenced
by the lib64utils host target which was removed in commit 03cc1f747
Tested compiling some of the projects that make use of libcutils
using a clean out dir with the folllowing targets
aosp_arm-eng : make -j16 logd dexdump
aosp-flouder-userdebug : make -j16 keystore vold libjavacore logd
aosp-x86_64-eng : make -j16 keystore vold libjavacore logd dexdump
Change-Id: I663e52bbf28dde27866dad9429bf95ada6b594a5
2014-12-06 09:27:19 +00:00
Elliott Hughes
22a40e6a7a
Use __arm__ instead of ARCH_ARM.
...
Change-Id: I777da5757f01d8328d5475e654d56d81dc802655
2014-12-04 14:17:26 -08:00
Andreas Gampe
a53c815323
Libutils: Comment out unused constants
...
For build-system CFLAGS clean-up, "remove" unused variables.
Change-Id: Ic96f066981cd96ca16af81ee3fdbc972507e8c81
2014-11-24 09:43:10 -08:00
Elliott Hughes
97ac0e1bb4
Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.
...
Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
2014-11-21 23:10:45 -08:00
Yabin Cui
745c5f6ad0
kill HAVE_MADVISE
...
Change to avoid "unused parameter" warning.
Bug: 18397020
Change-Id: I4b26de55314c78237daead8e873385b97cafe4d4
2014-11-19 04:03:27 +00:00
Yabin Cui
819b480b93
kill HAVE_MADVISE
...
Bug: 18397020
Change-Id: Ibc8d886d729c51932a403531888214de4e541452
2014-11-18 18:15:40 -08:00
Dan Albert
890442a02d
Move libutils to libc++.
...
Bug: 15193147
Change-Id: I85aff3bcabb5ee3c8be9918b7bef0fd1bbfa98e3
2014-11-15 16:32:26 -08:00