Reland: libmemtrack: Add support for AIDL memtrack HAL
Regarding the issues caused by the reverted version of these changes.
Root cause of the reported issues is that ServiceManager cannot get
the IMemtrack AIDL service, and getService() will busy loop for 5 seconds
trying to get the service.
12-22 12:22:22.501 1827 10885 W ServiceManager: Service android.hardware.memtrack.IMemtrack/default didn't start. Returning NULL
12-22 12:22:22.501 1827 10885 I ServiceManager: Waiting for service 'android.hardware.memtrack.IMemtrack/default' on '/dev/binder'...
Also because the results of this getService() was not cached, we will
attempt to get this service each time there is a new request from
libmemtrack, causing another 5 seconds delay each time.
We check if the service is declared before attempting to retrieve it.
We use the more efficient waitForService(), instead of getService()
which can busy loop for 5 seconds.
Cache the results of these operations so that we don’t have to retrieve
the service each time there is a request from libmemtrack.
Boot Time Regression Test
Test: adb shell logcat -b all | grep TotalBootTime
Old version of this topic: 44209ms
New version of this topic: 20058ms
Cts Graphics Test
Test: atest CtsGraphicsTestCases:android.graphics.cts.BitmapTest#testWrappedHardwareBufferBitmapNotLeaking
Old version of this topic: Fails
New version of this topic: Passes
Test: adb shell dumpsys meminfo
Old version of this topic: `*** SERVICE 'meminfo' DUMP TIMEOUT (10000ms) EXPIRED ***`
LKGB: <Expected output>
New version of this topic: <Expected output>
Battery Saver Test
Test: Unplug Device; Tap Battery Save Icon from the pull down menu
Old version of this topic: Battery Saver Icon does not become enabled (blue highlight)
LKGB: Battery Saver Icon Enabled
New version of this topic: Battery Saver Icon Enabled
2 files changed