parse named anonymous memory for dumpsys meminfo

Treat [anon:libc_malloc] as native heap and anything else that
starts with [anon: as unknown.

Bug: 10212959
Change-Id: Ifd120ae86e7a22291383df37d2b96f9f2dcd68b9
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 61ace4a..f5eb389 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -220,6 +220,8 @@
                 } else {
                     whichHeap = HEAP_ASHMEM;
                 }
+            } else if (strncmp(name, "[anon:libc_malloc]", 18) == 0) {
+                whichHeap = HEAP_NATIVE;
             } else if (strncmp(name, "[stack", 6) == 0) {
                 whichHeap = HEAP_STACK;
             } else if (strncmp(name, "/dev/", 5) == 0) {
@@ -246,6 +248,8 @@
             } else if (nameLen > 4 && strcmp(name+nameLen-4, ".art") == 0) {
                 whichHeap = HEAP_ART;
                 is_swappable = true;
+            } else if (strncmp(name, "[anon:", 6) == 0) {
+                whichHeap = HEAP_UNKNOWN;
             } else if (nameLen > 0) {
                 whichHeap = HEAP_UNKNOWN_MAP;
             } else if (start == prevEnd && prevHeap == HEAP_SO) {