michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //#define LOG_NDEBUG 0 michael@0: #define LOG_TAG "IMediaResourceManagerClient" michael@0: #include michael@0: michael@0: #include michael@0: #include michael@0: michael@0: #include michael@0: michael@0: #include "IMediaResourceManagerClient.h" michael@0: michael@0: namespace android { michael@0: michael@0: enum { michael@0: STATUS_CHANGED = IBinder::FIRST_CALL_TRANSACTION michael@0: }; michael@0: michael@0: class BpMediaResourceManagerClient : public BpInterface michael@0: { michael@0: public: michael@0: BpMediaResourceManagerClient(const sp& impl) michael@0: : BpInterface(impl) michael@0: { michael@0: } michael@0: michael@0: void statusChanged(int event) michael@0: { michael@0: Parcel data, reply; michael@0: data.writeInterfaceToken(IMediaResourceManagerClient::getInterfaceDescriptor()); michael@0: data.writeInt32(event); michael@0: remote()->transact(STATUS_CHANGED, data, &reply, IBinder::FLAG_ONEWAY); michael@0: } michael@0: }; michael@0: michael@0: IMPLEMENT_META_INTERFACE(MediaResourceManagerClient, "android.media.IMediaResourceManagerClient"); michael@0: michael@0: // ---------------------------------------------------------------------- michael@0: michael@0: status_t BnMediaResourceManagerClient::onTransact( michael@0: uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) michael@0: { michael@0: switch(code) { michael@0: case STATUS_CHANGED: { michael@0: CHECK_INTERFACE(IMediaResourceManagerClient, data, reply); michael@0: int event = data.readInt32(); michael@0: statusChanged(event); michael@0: return NO_ERROR; michael@0: } break; michael@0: default: michael@0: return BBinder::onTransact(code, data, reply, flags); michael@0: } michael@0: } michael@0: michael@0: // ---------------------------------------------------------------------------- michael@0: michael@0: }; // namespace android