Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 5 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | //#define LOG_NDEBUG 0 |
michael@0 | 8 | #define LOG_TAG "IMediaResourceManagerClient" |
michael@0 | 9 | #include <utils/Log.h> |
michael@0 | 10 | |
michael@0 | 11 | #include <stdint.h> |
michael@0 | 12 | #include <sys/types.h> |
michael@0 | 13 | |
michael@0 | 14 | #include <binder/Parcel.h> |
michael@0 | 15 | |
michael@0 | 16 | #include "IMediaResourceManagerClient.h" |
michael@0 | 17 | |
michael@0 | 18 | namespace android { |
michael@0 | 19 | |
michael@0 | 20 | enum { |
michael@0 | 21 | STATUS_CHANGED = IBinder::FIRST_CALL_TRANSACTION |
michael@0 | 22 | }; |
michael@0 | 23 | |
michael@0 | 24 | class BpMediaResourceManagerClient : public BpInterface<IMediaResourceManagerClient> |
michael@0 | 25 | { |
michael@0 | 26 | public: |
michael@0 | 27 | BpMediaResourceManagerClient(const sp<IBinder>& impl) |
michael@0 | 28 | : BpInterface<IMediaResourceManagerClient>(impl) |
michael@0 | 29 | { |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | void statusChanged(int event) |
michael@0 | 33 | { |
michael@0 | 34 | Parcel data, reply; |
michael@0 | 35 | data.writeInterfaceToken(IMediaResourceManagerClient::getInterfaceDescriptor()); |
michael@0 | 36 | data.writeInt32(event); |
michael@0 | 37 | remote()->transact(STATUS_CHANGED, data, &reply, IBinder::FLAG_ONEWAY); |
michael@0 | 38 | } |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | IMPLEMENT_META_INTERFACE(MediaResourceManagerClient, "android.media.IMediaResourceManagerClient"); |
michael@0 | 42 | |
michael@0 | 43 | // ---------------------------------------------------------------------- |
michael@0 | 44 | |
michael@0 | 45 | status_t BnMediaResourceManagerClient::onTransact( |
michael@0 | 46 | uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) |
michael@0 | 47 | { |
michael@0 | 48 | switch(code) { |
michael@0 | 49 | case STATUS_CHANGED: { |
michael@0 | 50 | CHECK_INTERFACE(IMediaResourceManagerClient, data, reply); |
michael@0 | 51 | int event = data.readInt32(); |
michael@0 | 52 | statusChanged(event); |
michael@0 | 53 | return NO_ERROR; |
michael@0 | 54 | } break; |
michael@0 | 55 | default: |
michael@0 | 56 | return BBinder::onTransact(code, data, reply, flags); |
michael@0 | 57 | } |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | // ---------------------------------------------------------------------------- |
michael@0 | 61 | |
michael@0 | 62 | }; // namespace android |