Deduplicate copied code in Android memory usage accounting

A big helper function was present both in newly added code and
in older code and that prevented jumbo compilation of
blink's controller (not yet enabled on master). This CL
deduplicates the code, and to not add the helper function
to to public API, makes it a private static member, with a
friend declaration that allows the other class to use it.

Bug: 920922
Change-Id: Ib24a2d9438a3e73c3f11276bb703516f67e75c23
Reviewed-by: Daniel Cheng <>
Reviewed-by: Kentaro Hara <>
Reviewed-by: Keishi Hattori <>
Commit-Queue: Daniel Bratell <>
Cr-Commit-Position: refs/heads/master@{#626025}
4 files changed