blob: e5de603cd5ee6d95de0e61f557c5b1a07737c52d [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/IMountShutdownObserver.h>
18#include <binder/Parcel.h>
19
20namespace android {
21
22enum {
23 TRANSACTION_onShutDownComplete = IBinder::FIRST_CALL_TRANSACTION,
24};
25
Sudheer Shanka34b33882016-11-01 00:13:51 -070026class BpMountShutdownObserver: public BpInterface<IMountShutdownObserver> {
27public:
28 explicit BpMountShutdownObserver(const sp<IBinder>& impl)
29 : BpInterface<IMountShutdownObserver>(impl) { }
30
31 virtual void onShutDownComplete(const int32_t /* statusCode */) {}
32};
33
Sudheer Shanka2250d562016-11-07 15:41:02 -080034IMPLEMENT_META_INTERFACE(MountShutdownObserver, "android.os.storage.IStorageShutdownObserver")
Sudheer Shanka34b33882016-11-01 00:13:51 -070035
Kenny Rootbe857d42010-08-18 15:59:25 -070036status_t BnMountShutdownObserver::onTransact(
37 uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
38{
39 switch(code) {
40 case TRANSACTION_onShutDownComplete: {
41 CHECK_INTERFACE(IMountShutdownObserver, data, reply);
42 int32_t statusCode = data.readInt32();
43 onShutDownComplete(statusCode);
44 reply->writeNoException();
45 return NO_ERROR;
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070046 }
Kenny Rootbe857d42010-08-18 15:59:25 -070047 default:
48 return BBinder::onTransact(code, data, reply, flags);
49 }
50}
51// ----------------------------------------------------------------------
52
Andreas Gampe2b3a8cd2014-10-21 23:38:52 -070053}