IInterface.cpp revision 208059f67ed2dd9fa025e07fcb6954d3cb61c79e
129721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu/*
229721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * Copyright (C) 2005 The Android Open Source Project
329721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu *
429721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * Licensed under the Apache License, Version 2.0 (the "License");
529721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * you may not use this file except in compliance with the License.
6cca84643cc10cd72b0b453ff92ccb8643ba51493Jens Axboe * You may obtain a copy of the License at
729721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu *
829721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu *      http://www.apache.org/licenses/LICENSE-2.0
929721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu *
1029721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * Unless required by applicable law or agreed to in writing, software
1129721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * distributed under the License is distributed on an "AS IS" BASIS,
1229721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1329721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * See the License for the specific language governing permissions and
1429721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu * limitations under the License.
1529721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu */
1629721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu
1729721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu#include <utils/IInterface.h>
1829721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu
1929721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsunamespace android {
2029721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu
2129721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu// ---------------------------------------------------------------------------
2229721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu
2329721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsusp<IBinder> IInterface::asBinder()
24e0c4a4691b78163e8dfca9221147b2b076819cf3Jens Axboe{
25d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe    return this ? onAsBinder() : NULL;
26d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe}
27d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe
28d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboesp<const IBinder> IInterface::asBinder() const
29d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe{
30d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe    return this ? const_cast<IInterface*>(this)->onAsBinder() : NULL;
31d3cc4ebf58ec05037c3b0dd7c83c075a56f1dc62Jens Axboe}
32e0c4a4691b78163e8dfca9221147b2b076819cf3Jens Axboe
33e0c4a4691b78163e8dfca9221147b2b076819cf3Jens Axboe// ---------------------------------------------------------------------------
34e0c4a4691b78163e8dfca9221147b2b076819cf3Jens Axboe
3529721c9ce4f85775ff77dcb04bd26a7f10272e47Nobuhiro Iwamatsu}; // namespace android
365f739e0e2912b809635fac635a8c1140155577e6Nobuhiro Iwamatsu