blob: 9656e655e22ce0032bd76e85911a94b5459e417f [file] [log] [blame]
Kenny Rootbe857d42010-08-18 15:59:25 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include <storage/IObbActionListener.h>
18#include <binder/Parcel.h>
19
20namespace android {
21
22enum {
23 TRANSACTION_onObbResult = IBinder::FIRST_CALL_TRANSACTION,
24};
25
26// This is a stub that real consumers should override.
27class BpObbActionListener: public BpInterface<IObbActionListener> {
28public:
29 BpObbActionListener(const sp<IBinder>& impl)
30 : BpInterface<IObbActionListener>(impl)
31 { }
32
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070033 virtual void onObbResult(const String16& /* filename */, const int32_t /* nonce */,
34 const int32_t /* state */) { }
Kenny Rootbe857d42010-08-18 15:59:25 -070035};
36
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070037IMPLEMENT_META_INTERFACE(ObbActionListener, "IObbActionListener")
Kenny Rootbe857d42010-08-18 15:59:25 -070038
39// ----------------------------------------------------------------------
40
41status_t BnObbActionListener::onTransact(
42 uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
43{
44 switch(code) {
45 case TRANSACTION_onObbResult: {
46 CHECK_INTERFACE(IObbActionListener, data, reply);
47 String16 filename = data.readString16();
Kenny Rootaf9d6672010-10-08 09:21:39 -070048 int32_t nonce = data.readInt32();
49 int32_t state = data.readInt32();
50 onObbResult(filename, nonce, state);
Kenny Rootbe857d42010-08-18 15:59:25 -070051 reply->writeNoException();
52 return NO_ERROR;
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070053 }
Kenny Rootbe857d42010-08-18 15:59:25 -070054 default:
55 return BBinder::onTransact(code, data, reply, flags);
56 }
57}
58
59// ----------------------------------------------------------------------
60
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070061}