blob: 191d39a1006d86d73007f2e18eca9b2cef03e43d [file] [log] [blame]
Alan Stokesea1f0462024-02-19 16:25:47 +00001// Copyright 2024 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use android_system_virtualizationmaintenance::aidl::android::system::virtualizationmaintenance;
16use anyhow::anyhow;
17use binder::{BinderFeatures, ExceptionCode, Interface, IntoBinderResult, Strong};
18use virtualizationmaintenance::IVirtualizationMaintenance::{
19 BnVirtualizationMaintenance, IVirtualizationMaintenance,
20};
21
22pub(crate) fn new_binder() -> Strong<dyn IVirtualizationMaintenance> {
23 BnVirtualizationMaintenance::new_binder(
24 VirtualizationMaintenanceService {},
25 BinderFeatures::default(),
26 )
27}
28
29pub struct VirtualizationMaintenanceService;
30
31impl Interface for VirtualizationMaintenanceService {}
32
33#[allow(non_snake_case)]
34impl IVirtualizationMaintenance for VirtualizationMaintenanceService {
35 fn appRemoved(&self, _user_id: i32, _app_id: i32) -> binder::Result<()> {
36 Err(anyhow!("appRemoved not supported"))
37 .or_binder_exception(ExceptionCode::UNSUPPORTED_OPERATION)
38 }
39
40 fn userRemoved(&self, _user_id: i32) -> binder::Result<()> {
41 Err(anyhow!("userRemoved not supported"))
42 .or_binder_exception(ExceptionCode::UNSUPPORTED_OPERATION)
43 }
44}