libmeminfo: link libdmabufinfo as part of libmeminfo
am: 3d40e5f208

Change-Id: I8ec30265767d3e900d4ddc219cb79bda2de7f7e2
diff --git a/Android.bp b/Android.bp
index 8dcc77b..e610f7e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -26,6 +26,9 @@
         "liblog",
         "libprocinfo",
     ],
+    static_libs: [
+        "libdmabufinfo",
+    ],
     target: {
         darwin: {
             enabled: false,
@@ -38,7 +41,10 @@
     name: "libmeminfo",
     host_supported: true,
     defaults: ["libmeminfo_defaults"],
-    export_include_dirs: ["include"],
+    export_include_dirs: [
+        "include",
+        "libdmabufinfo/include",
+    ],
     export_shared_lib_headers: ["libbase"],
     srcs: [
         "pageacct.cpp",
diff --git a/libdmabufinfo/Android.bp b/libdmabufinfo/Android.bp
index 4aed45c..a0318e6 100644
--- a/libdmabufinfo/Android.bp
+++ b/libdmabufinfo/Android.bp
@@ -33,6 +33,7 @@
 cc_library_static {
     name: "libdmabufinfo",
     vendor_available: true,
+    host_supported: true,
     defaults: ["dmabufinfo_defaults"],
     export_include_dirs: ["include"],
     srcs: [
diff --git a/libdmabufinfo/dmabufinfo.cpp b/libdmabufinfo/dmabufinfo.cpp
index 9fb22a1..ce30a7d 100644
--- a/libdmabufinfo/dmabufinfo.cpp
+++ b/libdmabufinfo/dmabufinfo.cpp
@@ -224,16 +224,15 @@
         // size     flags       mode        count  exp_name ino         name
         // 01048576 00000002    00000007    00000001    ion 00018758    CAMERA
         // 01048576 00000002    00000007    00000001    ion 00018758
-        uint64_t size, count;
+        uint64_t size, count, inode;
         char* exporter_name = nullptr;
-        ino_t inode;
         char* name = nullptr;
-        int matched = sscanf(line, "%" SCNu64 "%*x %*x %" SCNu64 " %ms %lu %ms", &size, &count,
-                             &exporter_name, &inode, &name);
+        int matched = sscanf(line, "%" SCNu64 "%*x %*x %" SCNu64 " %ms %" SCNu64 " %ms", &size,
+                             &count, &exporter_name, &inode, &name);
         if (matched < 4) {
             continue;
         }
-        dmabufs->emplace_back(inode, size, count, exporter_name, matched > 4 ? name : "");
+        dmabufs->emplace_back((ino_t)inode, size, count, exporter_name, matched > 4 ? name : "");
         free(exporter_name);
         free(name);
     }