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

Commit 5b274ca4 authored by Dongwon Kang's avatar Dongwon Kang Committed by android-build-merger
Browse files

Merge "MediaResourceMonitor: Change argument type from string to int" into nyc-dev

am: a8b00c1c

* commit 'a8b00c1c':
  MediaResourceMonitor: Change argument type from string to int
parents 1d458fc3 a8b00c1c
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -27,8 +27,13 @@ class IMediaResourceMonitor : public IInterface {
public:
    DECLARE_META_INTERFACE(MediaResourceMonitor);

    virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const String16& type,
            /*in*/ const String16& subType, /*in*/ int64_t value) = 0;
    // Values should be in sync with Intent.EXTRA_MEDIA_RESOURCE_TYPE_XXX.
    enum {
        TYPE_VIDEO_CODEC = 0,
        TYPE_AUDIO_CODEC = 1,
    };

    virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const int32_t type) = 0;

    enum {
        NOTIFY_RESOURCE_GRANTED = IBinder::FIRST_CALL_TRANSACTION,
+4 −9
Original line number Diff line number Diff line
@@ -28,15 +28,12 @@ public:
    BpMediaResourceMonitor(const sp<IBinder>& impl)
        : BpInterface<IMediaResourceMonitor>(impl) {}

    virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const String16& type,
            /*in*/ const String16& subType, /*in*/ int64_t value)
    virtual void notifyResourceGranted(/*in*/ int32_t pid, /*in*/ const int32_t type)
    {
        Parcel data, reply;
        data.writeInterfaceToken(IMediaResourceMonitor::getInterfaceDescriptor());
        data.writeInt32(pid);
        data.writeString16(type);
        data.writeString16(subType);
        data.writeInt64(value);
        data.writeInt32(type);
        remote()->transact(NOTIFY_RESOURCE_GRANTED, data, &reply, IBinder::FLAG_ONEWAY);
    }
};
@@ -51,10 +48,8 @@ status_t BnMediaResourceMonitor::onTransact( uint32_t code, const Parcel& data,
        case NOTIFY_RESOURCE_GRANTED: {
            CHECK_INTERFACE(IMediaResourceMonitor, data, reply);
            int32_t pid = data.readInt32();
            const String16 type = data.readString16();
            const String16 subType = data.readString16();
            int64_t value = data.readInt64();
            notifyResourceGranted(/*in*/ pid, /*in*/ type, /*in*/ subType, /*in*/ value);
            const int32_t type = data.readInt32();
            notifyResourceGranted(/*in*/ pid, /*in*/ type);
            return NO_ERROR;
        } break;
        default: