summaryrefslogtreecommitdiff
path: root/libutils
AgeCommit message (Collapse)Author
2022-02-17Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: I682501b298008e130a29cab70f947f12c140e314
2021-12-19Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: Id04e29c2e6639a50d8ad7accc675e03d38f50b6c
2021-12-10libutils: do not follow process's groupWei Wang
1) App doesn't have cgroup access and there is no purpose of reading cgroup for app. For system_server it should be known in foreground group. So there is no benefit of reading group. 2) Reading cgroup in apps can also cause contention for other cgroup operations. 3) vendor can change cgroup setting and get_sched_policy may return incorrect information for get_sched_policy_profile_name. Test: Boot Bug: 210011562 Signed-off-by: Wei Wang <wvw@google.com> Change-Id: I8e8c8b346984781c56ec93c0616121f7d5c99fe5
2021-10-07libutils: use system_background for low prio tasks in frameworkWei Wang
Bug: 201428466 Test: Build and boot check system_server's sched group Signed-off-by: Wei Wang <wvw@google.com> Change-Id: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c Merged-In: Iffc47fdaf3ef8fba6eb01a12cf534a0393e3e91c
2021-06-23Merge SP1A.210618.002Scott Lobdell
Change-Id: Idceaf62f282b29b7ae653e38ce302398bfad69a3
2021-06-15Merge "Check for overflow in String16::append and String16::insert." into sc-devElliott Hughes
2021-06-10Check for overflow in String16::append and String16::insert.Elliott Hughes
Bug: http://b/178802681 Bug: http://b/178821065 Test: new tests Change-Id: I2352ea4c65e3f29e44e2ad6cad20ad610ceace1f
2021-06-10Check for overflow in String8::real_append.Elliott Hughes
Bug: http://b/178822418 Test: new tests Change-Id: I73631a070ade0689441abe5645ba5a5f64a58675
2021-06-04Merge SP1A.210604.001Scott Lobdell
Change-Id: I5c88fe967b18abffb9e7d9147f3576ea4558ad67
2021-05-21Fix implicit cast from ssize_t to size_t in KeyedVector.hVishnu Nair
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-19Merge SP1A.210513.004Chris Gross
Change-Id: I9e72fbfdbfff79342269f330683fee1cd9f8ad11
2021-05-13Merge "Remove String16::remove." am: e9c7c5c80c am: 50d6fc417e am: 203cdf89fcElliott Hughes
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1704013 Change-Id: I5e718c0920791a41ee4a5638b81465a406d783e1
2021-05-13Merge "Remove String16::remove."Elliott Hughes
2021-05-12Remove String16::remove.Elliott Hughes
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-12Merge "libutils: remove the unused StopWatch lap functionality." am: ↵Treehugger Robot
0839837fa4 am: 5c28af9897 am: 038077c1c5 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703652 Change-Id: If73e10e9321af420ff32b992a6df4f8dd9e5a911
2021-05-12Remove String16::remove tests.Elliott Hughes
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-12Merge "libutils: remove the unused StopWatch lap functionality."Treehugger Robot
2021-05-11libutils: remove the unused StopWatch lap functionality.Elliott Hughes
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-11Merge "libutils: remove obsolete README." am: c85c9ee4e6 am: 542b434331 am: ↵Treehugger Robot
47f22f9ba7 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1703649 Change-Id: I1c3156ddd57102f5ba29c34b2b3b8474ca1aff7f
2021-05-11libutils: remove obsolete README.Elliott Hughes
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-11Merge SP1A.210510.001Brian Orr
Change-Id: If1e45c0407ebeee685e65e47b54a353ef88b401f
2021-05-05Merge "libutils: LightRefBase: incStrongRequireStrong" am: 1c65d40154 am: ↵Steven Moreland
b31a05bb47 am: 77b47c4185 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1696268 Change-Id: Ia753aaf062e8d58c60ca1113922165a2946a9a07
2021-05-04libutils: LightRefBase: incStrongRequireStrongSteven Moreland
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-04-28Merge "libutils: sharedbuffer test - expect greatness!" am: 9dd80b6b04 am: ↵Steven Moreland
246739cc61 am: 161d760f31 Original change: https://android-review.googlesource.com/c/platform/system/core/+/1688812 Change-Id: Id6ec8ae3f744c1936faebdd66bb2f32b2e6cf814
2021-04-28libutils: sharedbuffer test - expect greatness!Steven Moreland
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-26Merge SP1A.210425.001Scott Lobdell
Change-Id: I9729cc3087e7f15940babbf3afdf118941eb8b8a
2021-04-16Merge "Remove move dead code." am: acec0918e5 am: 1fc404900c am: 906a03fc49Elliott Hughes
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1677028 Change-Id: I7fb50216bcf983584f664a691321683dd79ae38d
2021-04-15Remove move dead code.Elliott Hughes
Test: treehugger Change-Id: I6a23b19d078400dfe90329a49ae1abbcb24ef2bf
2021-04-14Merge "Remove String8::toUpper()." am: 450f66bd8f am: ca3794ea68 am: 334a0b1c10Elliott Hughes
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1673886 Change-Id: Ica526ca8cb76065e4008a8dbd494beb795ea1390
2021-04-14Merge "Remove String8::toUpper()."Elliott Hughes
2021-04-13Merge "libutils: group deprecated RefBase functions" am: 4efe03b492 am: ↵Steven Moreland
7e2a6bf3b0 am: 20606f64bd Original change: https://android-review.googlesource.com/c/platform/system/core/+/1673555 Change-Id: I88aad9df554c90358b019200a26c5adfa0b440a3
2021-04-13Merge "libutils: group deprecated RefBase functions"Steven Moreland
2021-04-12libutils: group deprecated RefBase functionsSteven Moreland
Make it easier to see reference to usage documentation, as requested in review. Bug: 184190315 Test: libutils_test Change-Id: If9056e35b1c7a779dd78f2b986ad10d02f25eaf3
2021-04-12Remove String8::toUpper().Elliott Hughes
Actually, it looks like it's only toLower() that's used, so let's remove toUpper() separately, since it's so easy. Test: treehugger Change-Id: I8fae9fa513b2a34d5bd6b3f64e9305a1ee3c1ec4
2021-04-12Merge "Remove the weird range variants of String8::toLower() and ↵Elliott Hughes
String8::toUpper()." am: 561209ee66 am: 7e7ff3635d am: 685c0c9a7f Original change: https://android-review.googlesource.com/c/platform/system/core/+/1670567 Change-Id: Iedb8ab438496e0fa3f6697fb18b060e3a1acbc89
2021-04-12Merge "Remove the weird range variants of String8::toLower() and ↵Elliott Hughes
String8::toUpper()."
2021-04-12Merge SP1A.210412.001Scott Lobdell
Change-Id: I9f45475c251310373c18daad4eedb1dfa3cc0fcd
2021-04-09Remove the weird range variants of String8::toLower() and String8::toUpper().Elliott Hughes
I want to remove these bad ASCII-only APIs completely, but it might be easier to remove the range variants first. Test: treehugger Change-Id: I4c11f959a7bd8e670708cc03281ea72e9c461ff7
2021-04-09Merge "Remove String16::makeLower()."Treehugger Robot
2021-04-08Merge "Remove String16::makeLower()." into sc-devTreeHugger Robot
2021-04-08Merge changes I66c97386,Id205c88d am: 05a7dfa104 am: 25d87e4419 am: debdf364bdTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1668805 Change-Id: I15f849b229b1e505111d39983ec0a43ba2bf9841
2021-04-08Remove String16::makeLower().Elliott Hughes
If you need to do a case transformation for a Unicode string, you need to use icu4c. This only worked for ASCII, which is just silly. Luckily it doesn't seem to be used anywhere. Test: treehugger Change-Id: I4a864823ec35a0b57b50909587cc3efac3f531a7 Merged-In: I4a864823ec35a0b57b50909587cc3efac3f531a7 (cherry picked from commit c74d97c85442ea4d2bde2505750ab4bfe98ed325)
2021-04-08Merge SP1A.210407.002Scott Lobdell
Change-Id: I5fc9b14634cd9f2991dc43b2dedb514603d138a1
2021-04-07libutils: wp::fromExisting bugfixSteven Moreland
This API was tested before, but it wasn't used until it is needed in libbinder. Previously it passed the tests because wp::operator== compares weak_ptrs which are never deleted, but it doesn't check the value of m_ptr as well. This assumes that the RefBase implementation is self-consistent. Future considerations: - add additional CHECK (perf?) - add an additional optional CHECK? - update all refbase tests to use an embellished form of this operator Bug: 184190315 Test: libutils_test, boot and kill process when libbinder is using this API Change-Id: I66c97386d769529d5efae48e06775d4b4a344025
2021-04-07Remove String16::makeLower().Elliott Hughes
If you need to do a case transformation for a Unicode string, you need to use icu4c. This only worked for ASCII, which is just silly. Luckily it doesn't seem to be used anywhere. Test: treehugger Change-Id: I4a864823ec35a0b57b50909587cc3efac3f531a7 Merged-In: I4a864823ec35a0b57b50909587cc3efac3f531a7
2021-04-07libutils: add sp::cast methodSteven Moreland
Previously, sp::sp(T*) internally had a static cast, and people frequently wrote code like this: sp<A> a = ...; sp<B> b(a.get()); // implicit static cast Luckily, none of the other sp constructors have this implicit cast. So, for explicit code, rather than making those use static_cast internally, adding an sp::cast function. Bug: 184190315 Test: use in libbinder Change-Id: Id205c88d03e16cf85ccb8f493ce88b4bbc65a688
2021-04-05Merge "ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION" am: 99037347d6 ↵Steven Moreland
am: d8c4c860ef am: e1a51daf9b Original change: https://android-review.googlesource.com/c/platform/system/core/+/1660499 Change-Id: I72e661607a70876fa8f63f95318c3805cb26fb4b
2021-04-05ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTIONSteven Moreland
In form, inspired by ANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION. We get occasional bugs about sp double-ownership. When this flag is enabled, we have: - you must construct RefBase objects using sp<>::make - you must construct wp<> objects by converting them to sp<> - if you want to convert a raw pointer to an sp<> object (this is possible since the refcount is used internally, and is used commonly on this*), then you must use 'assertStrongRefExists' semantics which aborts if there is no strong ref held. That is, if a client uses std::make_shared and then calls a function which internally used to call `sp<T>(this)`, you would now call `sp<T>::assertStrongRefExists(this)`, and the double ownership problem would become a runtime error. Bug: 184190315 Test: libutils_test Change-Id: Ie18d3146420df1808e3733027070ec234dda4e9d
2021-04-02Merge "libutils: better docs for sp<>::make" am: 767f264fa4 am: fb91070a83 ↵Steven Moreland
am: 2eb2b5edbf Original change: https://android-review.googlesource.com/c/platform/system/core/+/1663182 Change-Id: I8c21003dbac86e0d57a4cf634f0c9b719f703e0a
2021-04-02libutils: better docs for sp<>::makeSteven Moreland
Bug: 184190315 Test: N/A Change-Id: I56621058b9d85122b7dca3727e40c8c85595031f