libmediadrm: final libbinder cleanup

Bug: 134787536
Test: build
Change-Id: I7a0da8fdb1164486980bde835eb04089aaf78655
diff --git a/drm/libmediadrm/Android.bp b/drm/libmediadrm/Android.bp
index 4c411be..6b1b475 100644
--- a/drm/libmediadrm/Android.bp
+++ b/drm/libmediadrm/Android.bp
@@ -37,7 +37,6 @@
     ],
 
     shared_libs: [
-        "libbinder",
         "libbinder_ndk",
         "libcutils",
         "libdl",
diff --git a/drm/libmediadrm/CryptoHal.cpp b/drm/libmediadrm/CryptoHal.cpp
index 55b9bb8..18772e0 100644
--- a/drm/libmediadrm/CryptoHal.cpp
+++ b/drm/libmediadrm/CryptoHal.cpp
@@ -20,7 +20,6 @@
 
 #include <android/hardware/drm/1.0/types.h>
 #include <android/hidl/manager/1.2/IServiceManager.h>
-#include <binder/IMemory.h>
 #include <hidl/ServiceManagement.h>
 #include <hidlmemory/FrameworkUtils.h>
 #include <media/hardware/CryptoAPI.h>
@@ -251,7 +250,7 @@
 
 
 /**
- * If the heap base isn't set, get the heap base from the IMemory
+ * If the heap base isn't set, get the heap base from the HidlMemory
  * and send it to the HAL so it can map a remote heap of the same
  * size.  Once the heap base is established, shared memory buffers
  * are sent by providing an offset into the heap and a buffer size.
diff --git a/drm/libmediadrm/include/mediadrm/IDrm.h b/drm/libmediadrm/include/mediadrm/IDrm.h
index 48a7170..0177c24 100644
--- a/drm/libmediadrm/include/mediadrm/IDrm.h
+++ b/drm/libmediadrm/include/mediadrm/IDrm.h
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-#include <binder/IInterface.h>
-#include <binder/PersistableBundle.h>
 #include <media/stagefright/foundation/ABase.h>
 #include <media/drm/DrmAPI.h>
 #include <mediadrm/IDrmClient.h>
diff --git a/drm/libmediadrm/interface/mediadrm/DrmUtils.h b/drm/libmediadrm/interface/mediadrm/DrmUtils.h
index 3017274..37e0dc1 100644
--- a/drm/libmediadrm/interface/mediadrm/DrmUtils.h
+++ b/drm/libmediadrm/interface/mediadrm/DrmUtils.h
@@ -21,7 +21,6 @@
 #include <android/hardware/drm/1.0/IDrmFactory.h>
 #include <utils/Errors.h>  // for status_t
 #include <utils/StrongPointer.h>
-#include <binder/Parcel.h>
 #include <vector>
 
 using namespace ::android::hardware::drm;
@@ -39,17 +38,17 @@
 
 sp<ICrypto> MakeCrypto(status_t *pstatus = nullptr);
 
-template<typename BA>
-void WriteByteArray(Parcel &obj, const BA &vec) {
+template<typename BA, typename PARCEL>
+void WriteByteArray(PARCEL &obj, const BA &vec) {
     obj.writeInt32(vec.size());
     if (vec.size()) {
         obj.write(vec.data(), vec.size());
     }
 }
 
-template<typename ET, typename BA>
+template<typename ET, typename BA, typename PARCEL>
 void WriteEventToParcel(
-        Parcel &obj,
+        PARCEL &obj,
         ET eventType,
         const BA &sessionId,
         const BA &data) {
@@ -58,18 +57,18 @@
     obj.writeInt32(eventType);
 }
 
-template<typename BA>
+template<typename BA, typename PARCEL>
 void WriteExpirationUpdateToParcel(
-        Parcel &obj,
+        PARCEL &obj,
         const BA &sessionId,
         int64_t expiryTimeInMS) {
     WriteByteArray(obj, sessionId);
     obj.writeInt64(expiryTimeInMS);
 }
 
-template<typename BA, typename KSL>
+template<typename BA, typename KSL, typename PARCEL>
 void WriteKeysChange(
-        Parcel &obj,
+        PARCEL &obj,
         const BA &sessionId,
         const KSL &keyStatusList,
         bool hasNewUsableKey) {