1a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent/* 2a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * Copyright (C) 2016 The Android Open Source Project 3a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * 4a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * Licensed under the Apache License, Version 2.0 (the "License"); 5a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * you may not use this file except in compliance with the License. 6a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * You may obtain a copy of the License at 7a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * 8a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * http://www.apache.org/licenses/LICENSE-2.0 9a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * 10a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * Unless required by applicable law or agreed to in writing, software 11a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * distributed under the License is distributed on an "AS IS" BASIS, 12a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * See the License for the specific language governing permissions and 14a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent * limitations under the License. 15a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent */ 16a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent#include "BroadcastRadioFactory.h" 17a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent#include "BroadcastRadio.h" 18a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent 19a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurentnamespace android { 20a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurentnamespace hardware { 21a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurentnamespace broadcastradio { 22a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurentnamespace V1_0 { 23a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurentnamespace implementation { 24a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent 25a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent// Methods from ::android::hardware::broadcastradio::V1_0::IBroadcastRadioFactory follow. 26a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric LaurentReturn<void> BroadcastRadioFactory::connectModule(Class classId, connectModule_cb _hidl_cb) { 27a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent sp<BroadcastRadio> impl = new BroadcastRadio(classId); 28a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent Result retval = Result::NOT_INITIALIZED; 29a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent if (impl != 0) { 30a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent retval = impl->initCheck(); 31a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent } 32a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent _hidl_cb(retval, impl); 33a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent return Void(); 34a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} 35a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent 36a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent 37a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric LaurentIBroadcastRadioFactory* HIDL_FETCH_IBroadcastRadioFactory(const char* /* name */) { 38a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent return new BroadcastRadioFactory(); 39a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} 40a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent 41a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} // namespace implementation 42a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} // namespace V1_0 43a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} // namespace broadcastradio 44a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} // namespace hardware 45a174588f8d2bb17cd0eb90ff3ed2700c000c8d65Eric Laurent} // namespace android 46