tag | dea7ce461506fdcbc314aa7d46bbb48a89335bea | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu Feb 18 09:59:24 2021 -0800 |
object | 13ec36b90e265e3952c35f5593a8c4ad99b2685e |
Android S Preview 1
commit | 13ec36b90e265e3952c35f5593a8c4ad99b2685e | [log] [tgz] |
---|---|---|
author | Bob Badour <bbadour@google.com> | Wed Feb 03 20:08:34 2021 -0800 |
committer | Elliott Hughes <enh@google.com> | Thu Feb 04 19:34:26 2021 +0000 |
tree | 8afc805c2ba412cca5307296db488ceb5d540b55 | |
parent | 24fb1782d112dca7e4eddd3de6e7eb39cc0be2f2 [diff] |
Add LOCAL_LICENSE_KINDS to system/libbase Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I9af515edc64d1fd13070bd36bfb822c1d53d383f
This library is a collection of convenience functions to make common tasks easier and less error-prone.
In this context, “error-prone” covers both “hard to do correctly” and “hard to do with good performance”, but as a general purpose library, libbase's primary focus is on making it easier to do things easily and correctly when a compromise has to be made between “simplest API” on the one hand and “fastest implementation” on the other. Though obviously the ideal is to have both.
The intention is to cover the 80% use cases, not be all things to all users.
If you have a routine that‘s really useful in your project, congratulations. But that doesn’t mean it should be here rather than just in your project.
The question for libbase is “should everyone be doing this?”/“does this make everyone's code cleaner/safer?”. Historically we've considered the bar for inclusion to be “are there at least three unrelated projects that would be cleaned up by doing so”.
If your routine is actually something from a future C++ standard (that isn‘t yet in libc++), or it’s widely used in another library, that helps show that there's precedent. Being able to say “so-and-so has used this API for n years” is a good way to reduce concerns about API choices.
Unlike most Android code, code in libbase has to build for Mac and Windows too.
Code here is also expected to have good test coverage.
By its nature, it‘s difficult to change libbase API. It’s often best to start using your routine just in your project, and let it “graduate” after you're certain that the API is solid.