1 /* 2 * Copyright (C) 2025, 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 //! Implements and serves the hello.world.IHello interface for the 17 //! AIDL / Binder codelab 18 19 use binder::{Interface, Result}; 20 use hello_world::aidl::hello::world::IHello::IHello; 21 use log::info; 22 23 //pub mod hello_service; 24 25 /// Implementation for the IHello service used for a codelab 26 pub struct Hello; 27 28 impl Hello {} 29 30 impl Interface for Hello {} 31 32 impl IHello for Hello { LogMessage(&self, msg: &str) -> Result<()>33 fn LogMessage(&self, msg: &str) -> Result<()> { 34 info!("{}", msg); 35 Ok(()) 36 } getMessage(&self) -> Result<String>37 fn getMessage(&self) -> Result<String> { 38 Ok("Hello World!".to_string()) 39 } 40 } 41