Commit graph

776 commits

Author SHA1 Message Date
Greg Kaiser
cacc47d46e Merge "Revert "Remove unused String8::setPathName."" am: 615bf4ef14 am: 01f3306b69 am: 2cca5cc992 am: 6fd9460002
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1768145

Change-Id: Ia8c79e5a81b73b7d785b3bb14d7afe33efc3cdb1
2021-07-15 14:29:36 +00:00
Greg Kaiser
2cca5cc992 Merge "Revert "Remove unused String8::setPathName."" am: 615bf4ef14 am: 01f3306b69
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1768145

Change-Id: I9856b917353e57b048eeec2d3ed6d157165e1148
2021-07-15 13:56:01 +00:00
Greg Kaiser
70d9fb63e6 Revert "Remove unused String8::setPathName."
This reverts commit c214426e0c.

Reason for revert: This is not unused; broke build internally

Change-Id: I18e8b7954256ae015ad32743fa6a75850b00913e
2021-07-15 13:33:10 +00:00
Elliott Hughes
5814506607 Merge "Remove unused String8::setPathName." am: 40a0664b84 am: 5f7d548dc6 am: 941b1a61b0 am: 5c5854a383
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1765465

Change-Id: Ia505c88c596169a47e07c5f8fb869c0de68b42c2
2021-07-14 22:15:41 +00:00
Elliott Hughes
941b1a61b0 Merge "Remove unused String8::setPathName." am: 40a0664b84 am: 5f7d548dc6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1765465

Change-Id: If7b66e7de22107110fa595827611f1bb1a83a9dc
2021-07-14 21:48:06 +00:00
Elliott Hughes
c214426e0c Remove unused String8::setPathName.
Test: treehugger
Change-Id: Idc8d7e748b0df4ce8a26227dc73a5eef2b04244f
2021-07-13 17:20:53 -07:00
Treehugger Robot
cbd5c0d396 Merge "libutil: no special copy from StaticString16" am: 7d067aee62 am: ece939ecc9 am: b8e683537f am: 73fcfd0c52
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1751786

Change-Id: I5cc9831a8a940cdead57b4a0811e55eec34092ef
2021-06-30 03:17:45 +00:00
Treehugger Robot
b8e683537f Merge "libutil: no special copy from StaticString16" am: 7d067aee62 am: ece939ecc9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1751786

Change-Id: Ic13c3a84471160c534b0e84ac5d0987f457eef75
2021-06-30 02:51:49 +00:00
Treehugger Robot
1bdcd5fbbf Merge "String16 is moveable (noexcept)" am: 3551e457ca am: 32ceaa1299 am: dcd1cacbbb am: 131315c51c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1749261

Change-Id: I2ded754cebb3d529f1adc2413cfa8f11f108a556
2021-06-30 02:18:50 +00:00
Treehugger Robot
dcd1cacbbb Merge "String16 is moveable (noexcept)" am: 3551e457ca am: 32ceaa1299
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1749261

Change-Id: Ia658a7b6ad2c21c83ef109230a4c5f0a7d02068a
2021-06-30 01:48:14 +00:00
Jooyung Han
6f92640d45 libutil: no special copy from StaticString16
String16's ctors already handle static strings, so we don't need a
specialized constructor which accepts StaticString16.

Bug: n/a
Test: libutils_test
Change-Id: I93a1ba70d743ff9c73f113d53ffba73cef6adade
2021-06-30 09:04:29 +09:00
Jooyung Han
98b396e785 String16 is moveable (noexcept)
String16 is still in use by AIDL compiler. Because String16 is not
noexcept-move-constructible, the C++ compiler will complain when it is
used with non-copyable types (such as ParcelFileDescriptor).

For example, when vector<Foo> is resized, copy-ctor of Foo is called,
which is not available.

  parcelable Foo {
    String s;
    ParcelFileDescriptor[] pfds;
  }

By providing noexcept move-ctor for String16, vector<Foo> can be resized
with no problem.

Btw, copy from StaticString16 is specialized for efficiency and move
from StaticString16 don't need to be different from copy.

Bug: 192136980
Test: libutils_test
Change-Id: I13744a2ceebf5781c3ef7f3a04237a6750b0db0a
2021-06-29 10:18:23 +09:00
Elliott Hughes
c341dc774f Merge "Check for overflow in String16::append and String16::insert." into sc-dev am: eec890e173 am: 117b7cd3e9
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14940186

Change-Id: I6572e3288efc7e3ac203c8688ea2fc08c8260bfc
2021-06-15 22:50:02 +00:00
Elliott Hughes
e227beedde Merge "Check for overflow in String16::append and String16::insert." into sc-dev am: eec890e173
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14940186

Change-Id: I2f6c9abc6b2baf587980224698cdeba4d55ed2a8
2021-06-15 22:34:06 +00:00
Elliott Hughes
eec890e173 Merge "Check for overflow in String16::append and String16::insert." into sc-dev 2021-06-15 22:19:15 +00:00
Elliott Hughes
ddc464cd56 Merge "Check for overflow in String8::real_append." into sc-dev am: 20462789dc am: 78c0d1d623
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14941314

Change-Id: Iffb6b98e2db53ba153af2e376b2c4bce31e7a69b
2021-06-15 21:29:52 +00:00
Elliott Hughes
1ce243f7a6 Merge "Check for overflow in String8::real_append." into sc-dev am: 20462789dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14941314

Change-Id: Ib18670bec989f9ec4ec628647718ed97e81468b3
2021-06-15 21:16:47 +00:00
Elliott Hughes
a6be6f0acb Check for overflow in String16::append and String16::insert.
Bug: http://b/178802681
Bug: http://b/178821065
Test: new tests
Change-Id: I2352ea4c65e3f29e44e2ad6cad20ad610ceace1f
2021-06-10 17:06:26 -07:00
Elliott Hughes
59682761fb Check for overflow in String8::real_append.
Bug: http://b/178822418
Test: new tests
Change-Id: I73631a070ade0689441abe5645ba5a5f64a58675
2021-06-10 16:42:20 -07:00
Treehugger Robot
eb245bc746 Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" am: a14beb2dbc am: f4d3b9e85f am: 272d5034c2 am: 88f61126e5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1715473

Change-Id: I4165604813f52d37862f618fae684fed78e9f495
2021-05-22 05:40:49 +00:00
Treehugger Robot
272d5034c2 Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" am: a14beb2dbc am: f4d3b9e85f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1715473

Change-Id: I938079b95fa8cd7a9978a3713564bf34a7dd9536
2021-05-22 05:01:02 +00:00
Treehugger Robot
a14beb2dbc Merge "Fix implicit cast from ssize_t to size_t in KeyedVector.h" 2021-05-22 03:46:09 +00:00
Vishnu Nair
51b958d57c Fix implicit cast from ssize_t to size_t in KeyedVector.h
Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Bug: b/188792659

Change-Id: I1b9309c3530d6063d5cefcaa31af84d9cebc3f5d
Merged-In: I8866aef7f09ca5173604abe18c586b68bbf12ed6
2021-05-21 16:49:07 +00:00
Vishnu Nair
0878f71613 Fix implicit cast from ssize_t to size_t in KeyedVector.h
Fixes a compiler warning for implicit conversion changes from signed
to unsigned which surfaced when refactoring native input libraries.
Add an explicit cast to avoid adding -Wno-sign-conversion compile
flags.

Test: b libsurfaceflinger_unittest
Change-Id: I8866aef7f09ca5173604abe18c586b68bbf12ed6
2021-05-21 16:45:46 +00:00
Elliott Hughes
3b9238cf0f Merge "Increase coverage of Timers to 100%." am: 2dc28bcfc4 am: 1db66002c1 am: b9a7a9886f am: 72e2e0c164
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1710936

Change-Id: Ib4120727615f6b8e9d4ea963cd6e3d71e81d47be
2021-05-20 21:07:05 +00:00
Elliott Hughes
b9a7a9886f Merge "Increase coverage of Timers to 100%." am: 2dc28bcfc4 am: 1db66002c1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1710936

Change-Id: Iffe5a4df00e9d4daaf0cbde46e1fb9969fbbc9da
2021-05-20 20:22:27 +00:00
Elliott Hughes
4139da606d Increase coverage of Timers to 100%.
Test: treehugger
Change-Id: I3dda9a1a60c88886e5ef42de72bf341ba6cd0361
2021-05-18 13:10:50 -07:00
Elliott Hughes
d64b91a43b Merge "Remove String16::remove." am: e9c7c5c80c am: 50d6fc417e am: 203cdf89fc am: 1056bd564e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1704013

Change-Id: I0e980e54b13f53f0dfdd58cad21de886bfda3870
2021-05-13 19:53:26 +00:00
Elliott Hughes
1056bd564e Merge "Remove String16::remove." am: e9c7c5c80c am: 50d6fc417e am: 203cdf89fc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1704013

Change-Id: I5e718c0920791a41ee4a5638b81465a406d783e1
2021-05-13 19:44:55 +00:00
Elliott Hughes
e9c7c5c80c Merge "Remove String16::remove." 2021-05-13 19:04:33 +00:00
Treehugger Robot
db0a816120 Merge "libutils: remove the unused StopWatch lap functionality." am: 0839837fa4 am: 5c28af9897 am: 038077c1c5 am: 70673be9dd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703652

Change-Id: I6e5461a9f1f3d3f7aa4ba8af8e65195896cfe671
2021-05-13 04:53:12 +00:00
Elliott Hughes
2cf0411910 Remove String16::remove.
This function, ironically, is being removed.

Even more amusing, it was never "remove" anyway --- it literally did
the opposite, and removed everything *except* the range you passed to
it, and should probably have been called "keep"!

I'm looking at reimplementing much of libutils, but first I'm improving
test coverage, and literally every test I wrote for this failed. And
then when I fixed the "obvious bugs" in the implementation, I found
there actually were a couple of existing unit tests --- that mostly
served to demonstrate just how counter-intuitive this function was.

Bug: http://b/156999009
Test: treehugger
Change-Id: I41fd85f7c0988070f4039f607d2e57523d862ed9
2021-05-12 20:24:26 +00:00
Treehugger Robot
70673be9dd Merge "libutils: remove the unused StopWatch lap functionality." am: 0839837fa4 am: 5c28af9897 am: 038077c1c5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703652

Change-Id: If73e10e9321af420ff32b992a6df4f8dd9e5a911
2021-05-12 19:00:08 +00:00
Elliott Hughes
418e0e0c06 Remove String16::remove tests. am: dc334a7c8f
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/core/+/14508384

Change-Id: Ia7b6aa12097e0ce5151f849c7d395bb7f4d12482
2021-05-12 04:27:02 +00:00
Elliott Hughes
dc334a7c8f Remove String16::remove tests.
These tests are only in internal right now, preventing me from removing
this function entirely. So let's get them out of the way...

Test: treehugger
Ignore-AOSP-First: workaround for presubmit merge conflict
Bug: http://b/35267372
Change-Id: Ib5de178ffad833c87e8e93bfd33e85a0ff504ac0
2021-05-12 03:57:26 +00:00
Treehugger Robot
0839837fa4 Merge "libutils: remove the unused StopWatch lap functionality." 2021-05-12 01:38:10 +00:00
Elliott Hughes
afa6e9fc04 libutils: remove the unused StopWatch lap functionality.
It's not tested, and it's not used. Also remove the fuzzer which is just
wasting CPU cycles.

This gets us to 100% function coverage, 100% line coverage, and N/A
branch coverage for StopWatch.

Test: treehugger
Change-Id: Ib5e08510ef1046a6f2af3f0b8a1c317a8bb39fd4
2021-05-11 16:33:47 -07:00
Treehugger Robot
81fe365db8 Merge "libutils: remove obsolete README." am: c85c9ee4e6 am: 542b434331 am: 47f22f9ba7 am: 6801ff60bb
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703649

Change-Id: I4cea6f36b9f049f68c9c6f44e7721f51a0decc04
2021-05-11 22:05:17 +00:00
Treehugger Robot
6801ff60bb Merge "libutils: remove obsolete README." am: c85c9ee4e6 am: 542b434331 am: 47f22f9ba7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703649

Change-Id: I1c3156ddd57102f5ba29c34b2b3b8474ca1aff7f
2021-05-11 21:46:30 +00:00
Elliott Hughes
af021e87a6 libutils: remove obsolete README.
This dates from when libutils was still part of frameworks, and talks
about stuff that *didn't* move out of frameworks.

Test: treehugger
Change-Id: Icf22eebc417bcb37abdbfdc89e9a3f14894e18c2
2021-05-11 12:01:26 -07:00
Steven Moreland
f59fb81121 Merge "libutils: LightRefBase: incStrongRequireStrong" am: 1c65d40154 am: b31a05bb47 am: 77b47c4185 am: 55862852fe
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1696268

Change-Id: Ied8436e131d709a8f5e5b0c9bb34abffdb4cd7c3
2021-05-05 01:08:44 +00:00
Steven Moreland
55862852fe Merge "libutils: LightRefBase: incStrongRequireStrong" am: 1c65d40154 am: b31a05bb47 am: 77b47c4185
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1696268

Change-Id: Ia753aaf062e8d58c60ca1113922165a2946a9a07
2021-05-05 00:44:45 +00:00
Steven Moreland
c2dc7cd31c libutils: LightRefBase: incStrongRequireStrong
Allow LightRefBase to be used with
ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION, mainly for
libhwui.

Bug: N/A
Test: libutils_test
Change-Id: I251c874a80f0a069572bc51da45f8f8e74ba6f5b
2021-05-04 21:42:26 +00:00
Steven Moreland
8eafcc0c7d Merge "libutils: sharedbuffer test - expect greatness!" am: 9dd80b6b04 am: 246739cc61 am: 161d760f31 am: 02ede6f998
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1688812

Change-Id: I1923123c1c81d0cfe533df0102da2e1a63d10814
2021-04-28 22:33:26 +00:00
Steven Moreland
02ede6f998 Merge "libutils: sharedbuffer test - expect greatness!" am: 9dd80b6b04 am: 246739cc61 am: 161d760f31
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1688812

Change-Id: Id6ec8ae3f744c1936faebdd66bb2f32b2e6cf814
2021-04-28 22:12:28 +00:00
Steven Moreland
128826ca07 libutils: sharedbuffer test - expect greatness!
This test previously expected failure - a machine which does not have
2GiB of memory. However, while today is becoming the past,
2GiB allocations working is no longer a dream of the future!

Fixes: 186569165
Test: libutils_test
Change-Id: I6a9ed608c0989d415b4e7735b8a451b8928b4083
2021-04-28 17:15:58 +00:00
Steven Moreland
a06e68cb7a Reland^2 "libutils: disable implicit ref base construction"
This reverts commit 2cb7593792.

Reason for revert: reland after fixing b/186468053
Bug: 184190315

Change-Id: I2a46b7a8148db444f9bd4b24746f64217cbba947
2021-04-27 00:09:23 +00:00
Steven Moreland
2cb7593792 Revert "Reland "libutils: disable implicit ref base construction""
This reverts commit 02c47655e7.

Reason for revert: broke another test b/186468053

Change-Id: I0ec82455ad203071e523092ae3cb5f0f1df6aac7
2021-04-27 00:07:55 +00:00
Steven Moreland
02c47655e7 Reland "libutils: disable implicit ref base construction"
This reverts commit 8e11f9e3f3.

Reason for revert: reland after fixing b/186028624
Bug: 184190315

Change-Id: Ia7339a46c3af7dd1a95bc82327cae5304f9f2e16
2021-04-26 17:19:17 +00:00
Steven Moreland
8e11f9e3f3 Revert "libutils: disable implicit ref base construction"
This reverts commit 9a1bf53c4b.

Reason for revert: b/186028624

Change-Id: Icb8b1623df2794222ce3fe34ed5f43506ccf2f68
2021-04-21 23:24:53 +00:00