1 /* 2 * Copyright (C) 2016 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 <hidl/HidlTransportSupport.h> 18 #include <hwbinder/IPCThreadState.h> 19 20 #include <android-base/logging.h> 21 #include <utils/StrongPointer.h> 22 23 #include "Offload.h" 24 25 // libhwbinder 26 using android::hardware::configureRpcThreadpool; 27 using android::hardware::joinRpcThreadpool; 28 29 using android::hardware::wifi::offload::V1_0::IOffload; 30 using android::hardware::wifi::offload::V1_0::implementation::Offload; 31 32 int main(int /*argc*/, char **argv) { 33 android::base::InitLogging( 34 argv, android::base::LogdLogger(android::base::SYSTEM)); 35 LOG(android::base::INFO) << "Wifi Offload HAL service start "; 36 37 // Setup hwbinder 38 configureRpcThreadpool(1, true /* callerWillJoin */); 39 40 // Register service 41 android::sp<IOffload> service = new Offload(); 42 CHECK_EQ(service->registerAsService(), android::NO_ERROR) 43 << "Failed to register Wifi Offload HAL"; 44 45 joinRpcThreadpool(); 46 47 LOG(android::base::INFO) << "Wifi Offload HAL service exit"; 48 return 0; 49 } 50