2 * Copyright (C) 2010 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include <storage/IObbActionListener.h>
18 #include <binder/Parcel.h>
23 TRANSACTION_onObbResult = IBinder::FIRST_CALL_TRANSACTION,
26 // This is a stub that real consumers should override.
27 class BpObbActionListener: public BpInterface<IObbActionListener> {
29 BpObbActionListener(const sp<IBinder>& impl)
30 : BpInterface<IObbActionListener>(impl)
33 virtual void onObbResult(const String16& /* filename */, const int32_t /* nonce */,
34 const int32_t /* state */) { }
37 IMPLEMENT_META_INTERFACE(ObbActionListener, "IObbActionListener")
39 // ----------------------------------------------------------------------
41 status_t BnObbActionListener::onTransact(
42 uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
45 case TRANSACTION_onObbResult: {
46 CHECK_INTERFACE(IObbActionListener, data, reply);
47 String16 filename = data.readString16();
48 int32_t nonce = data.readInt32();
49 int32_t state = data.readInt32();
50 onObbResult(filename, nonce, state);
51 reply->writeNoException();
55 return BBinder::onTransact(code, data, reply, flags);
59 // ----------------------------------------------------------------------