Revert "Track ashmem memory usage in Parcel"

This reverts commit e2f499fb734bc30a1e1c947112caa0727349b6ed.

Bug: 25169267
Bug: 25191602
Bug: 25004154
Change-Id: I24bb0da4e8739ee5a0c251e4adac9904827144e0
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 1c03585..7a4ddc4 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -96,7 +96,7 @@
 };
 
 void acquire_object(const sp<ProcessState>& proc,
-    const flat_binder_object& obj, const void* who, size_t* outAshmemSize)
+    const flat_binder_object& obj, const void* who)
 {
     switch (obj.type) {
         case BINDER_TYPE_BINDER:
@@ -123,13 +123,8 @@
             return;
         }
         case BINDER_TYPE_FD: {
-            if (obj.cookie != 0) {
-                // If we own an ashmem fd, keep track of how much memory it refers to.
-                int size = ashmem_get_size_region(obj.handle);
-                if (size > 0) {
-                    *outAshmemSize += size;
-                }
-            }
+            // intentionally blank -- nothing to do to acquire this, but we do
+            // recognize it as a legitimate object type.
             return;
         }
     }
@@ -138,7 +133,7 @@
 }
 
 void release_object(const sp<ProcessState>& proc,
-    const flat_binder_object& obj, const void* who, size_t* outAshmemSize)
+    const flat_binder_object& obj, const void* who)
 {
     switch (obj.type) {
         case BINDER_TYPE_BINDER:
@@ -165,14 +160,7 @@
             return;
         }
         case BINDER_TYPE_FD: {
-            if (obj.cookie != 0) {
-                int size = ashmem_get_size_region(obj.handle);
-                if (size > 0) {
-                    *outAshmemSize -= size;
-                }
-
-                close(obj.handle);
-            }
+            if (obj.cookie != 0) close(obj.handle);
             return;
         }
     }
@@ -516,7 +504,7 @@
 
             flat_binder_object* flat
                 = reinterpret_cast<flat_binder_object*>(mData + off);
-            acquire_object(proc, *flat, this, &mOpenAshmemSize);
+            acquire_object(proc, *flat, this);
 
             if (flat->type == BINDER_TYPE_FD) {
                 // If this is a file descriptor, we need to dup it so the
@@ -1038,7 +1026,7 @@
         // Need to write meta-data?
         if (nullMetaData || val.binder != 0) {
             mObjects[mObjectsSize] = mDataPos;
-            acquire_object(ProcessState::self(), val, this, &mOpenAshmemSize);
+            acquire_object(ProcessState::self(), val, this);
             mObjectsSize++;
         }
 
@@ -1621,7 +1609,7 @@
         i--;
         const flat_binder_object* flat
             = reinterpret_cast<flat_binder_object*>(data+objects[i]);
-        release_object(proc, *flat, this, &mOpenAshmemSize);
+        release_object(proc, *flat, this);
     }
 }
 
@@ -1635,7 +1623,7 @@
         i--;
         const flat_binder_object* flat
             = reinterpret_cast<flat_binder_object*>(data+objects[i]);
-        acquire_object(proc, *flat, this, &mOpenAshmemSize);
+        acquire_object(proc, *flat, this);
     }
 }
 
@@ -1817,7 +1805,7 @@
                     // will need to rescan because we may have lopped off the only FDs
                     mFdsKnown = false;
                 }
-                release_object(proc, *flat, this, &mOpenAshmemSize);
+                release_object(proc, *flat, this);
             }
             binder_size_t* objects =
                 (binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t));
@@ -1903,7 +1891,6 @@
     mAllowFds = true;
     mOwner = NULL;
     mBlobAshmemSize = 0;
-    mOpenAshmemSize = 0;
 }
 
 void Parcel::scanForFds() const
@@ -1926,11 +1913,6 @@
     return mBlobAshmemSize;
 }
 
-size_t Parcel::getOpenAshmemSize() const
-{
-    return mOpenAshmemSize;
-}
-
 // --- Parcel::Blob ---
 
 Parcel::Blob::Blob() :