1 /*
2  * Copyright 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 package android.system.composd;
17 
18 /**
19  * Interface to be implemented by clients of IIsolatedCompilationService to be notified when a
20  * requested compilation task completes.
21  */
22 oneway interface ICompilationTaskCallback {
23     enum FailureReason {
24         /** We failed to successfully start the VM and run compilation in it. */
25         CompilationFailed,
26         /** We ran compilation in the VM, but it reported a problem. */
27         UnexpectedCompilationResult,
28         /** We failed to enable fs-verity completely to the output artifacts. */
29         FailedToEnableFsverity,
30     }
31 
32     /**
33      * Called if a compilation task has ended successfully, generating all the required artifacts.
34      */
onSuccess()35     void onSuccess();
36 
37     /**
38      * Called if a compilation task has ended unsuccessfully.
39      */
onFailure(FailureReason reason, String message)40     void onFailure(FailureReason reason, String message);
41 }
42