• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.virtualmachineservice;
17 
18 /** {@hide} */
19 interface IVirtualMachineService {
20     /**
21      * Port number that VirtualMachineService listens on connections from the guest VMs for the
22      * payload input and output.
23      */
24     const int VM_STREAM_SERVICE_PORT = 3000;
25 
26     /**
27      * Port number that VirtualMachineService listens on connections from the guest VMs for the
28      * VirtualMachineService binder service.
29      */
30     const int VM_BINDER_SERVICE_PORT = 5000;
31 
32     /**
33      * Port number that VirtualMachineService listens on connections from the guest VMs for the
34      * tombtones
35      */
36     const int VM_TOMBSTONES_SERVICE_PORT = 2000;
37 
38     /**
39      * Notifies that the payload has started.
40      */
notifyPayloadStarted()41     void notifyPayloadStarted();
42 
43     /**
44      * Notifies that the payload is ready to serve.
45      */
notifyPayloadReady()46     void notifyPayloadReady();
47 
48     /**
49      * Notifies that the payload has finished.
50      */
notifyPayloadFinished(int exitCode)51     void notifyPayloadFinished(int exitCode);
52 
53     /**
54      * Notifies that an error has occurred. See the ERROR_* constants.
55      */
notifyError(int errorCode, in String message)56     void notifyError(int errorCode, in String message);
57 
58     /**
59      * Error code for all other errors not listed below.
60      */
61     const int ERROR_UNKNOWN = 0;
62 
63     /**
64      * Error code indicating that the payload can't be verified due to various reasons (e.g invalid
65      * merkle tree, invalid formats, etc).
66      */
67     const int ERROR_PAYLOAD_VERIFICATION_FAILED = 1;
68 
69     /**
70      * Error code indicating that the payload is verified, but has changed since the last boot.
71      */
72     const int ERROR_PAYLOAD_CHANGED = 2;
73 
74     /**
75      * Error code indicating that the payload config is invalid.
76      */
77     const int ERROR_PAYLOAD_INVALID_CONFIG = 3;
78 }
79