1 //! Test service implementation for FMQ. 2 3 /* 4 * Copyright (C) 2024 The Android Open Source Project 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 use android_fmq_test::aidl::android::fmq::test::ITestAidlMsgQ::BnTestAidlMsgQ; 20 21 use fmq_test_service_rust_impl::MsgQTestService; 22 23 use android_fmq_test::binder; 24 main()25fn main() { 26 binder::ProcessState::start_thread_pool(); 27 28 let service: MsgQTestService = Default::default(); 29 30 const SERVICE_IDENTIFIER: &str = "android.fmq.test.ITestAidlMsgQ/default"; 31 log::info!("instance: {SERVICE_IDENTIFIER}"); 32 33 // Register AIDL service 34 let test_service_binder = 35 BnTestAidlMsgQ::new_binder(service, binder::BinderFeatures::default()); 36 binder::add_service(SERVICE_IDENTIFIER, test_service_binder.as_binder()) 37 .expect("Failed to register service"); 38 binder::ProcessState::join_thread_pool(); 39 40 std::process::exit(1); // Should not be reached 41 } 42