Alan Stokes | b2cc79e | 2021-09-14 14:08:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | //! Simple command-line tool to drive composd for testing and debugging. |
| 18 | |
| 19 | use android_system_composd::{ |
| 20 | aidl::android::system::composd::IIsolatedCompilationService::IIsolatedCompilationService, |
| 21 | binder::{wait_for_interface, ProcessState}, |
| 22 | }; |
| 23 | use anyhow::{Context, Result}; |
| 24 | |
| 25 | fn main() -> Result<()> { |
| 26 | ProcessState::start_thread_pool(); |
| 27 | |
| 28 | let service = wait_for_interface::<dyn IIsolatedCompilationService>("android.system.composd") |
| 29 | .context("Failed to connect to composd service")?; |
| 30 | |
| 31 | service.runForcedCompile().context("Compilation failed")?; |
| 32 | |
| 33 | println!("All Ok!"); |
| 34 | |
| 35 | Ok(()) |
| 36 | } |