Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3f9ba74 authored by Robert Shih's avatar Robert Shih
Browse files

libmediadrm: final libbinder cleanup

Bug: 134787536
Test: build
Change-Id: I7a0da8fdb1164486980bde835eb04089aaf78655
parent 68a4a194
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ cc_library_shared {
    ],

    shared_libs: [
        "libbinder",
        "libbinder_ndk",
        "libcutils",
        "libdl",
+1 −2
Original line number Diff line number Diff line
@@ -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 @@ bool CryptoHal::requiresSecureDecoderComponent(const char *mime) const {


/**
 * 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.
+0 −2
Original line number Diff line number Diff line
@@ -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>
+8 −9
Original line number Diff line number Diff line
@@ -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<IDrm> MakeDrm(status_t *pstatus = nullptr);

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 @@ void WriteEventToParcel(
    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) {