Re-land ArrayUtils: add secure zeroization support
Add methods for allocating non-movable byte and char arrays, and methods
that make a best effort to securely zeroize byte and char arrays.
These methods will be used in code that handles the user's lockscreen
credential and the secrets derived or unlocked from it. These methods
provide the needed low-level primitives, and when possible they will be
accessed through helper classes such as LockscreenCredential.
The original version of this change was reverted due to not taking
Ravenwood (host-side unit testing) into account. That is now fixed.
CleanDataCache() is also now optimized to flush each line at most once.
Bug: 320392352
Test: atest FrameworksUtilTests:com.android.internal.util.ArrayUtilsTest
Test: atest FrameworksUtilTestsRavenwood:com.android.internal.util.ArrayUtilsTest
Change-Id: Ie7973d3617a4efa3aacb1ae93ee346d749db0379
5 files changed