xref: /aosp_15_r20/system/core/trusty/test/binder/aidl/com/android/trusty/binder/test/ITestService.aidl (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1 /*
2  * Copyright (C) 2022 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 package com.android.trusty.binder.test;
18 
19 import com.android.trusty.binder.test.ByteEnum;
20 import com.android.trusty.binder.test.IntEnum;
21 import com.android.trusty.binder.test.LongEnum;
22 
23 interface ITestService {
24     const @utf8InCpp String PORT = "com.android.trusty.binder.test.service";
25 
26     const int TEST_CONSTANT = 42;
27     const int TEST_CONSTANT2 = -42;
28     const int TEST_CONSTANT3 = +42;
29     const int TEST_CONSTANT4 = +4;
30     const int TEST_CONSTANT5 = -4;
31     const int TEST_CONSTANT6 = -0;
32     const int TEST_CONSTANT7 = +0;
33     const int TEST_CONSTANT8 = 0;
34     const int TEST_CONSTANT9 = 0x56;
35     const int TEST_CONSTANT10 = 0xa5;
36     const int TEST_CONSTANT11 = 0xFA;
37     const int TEST_CONSTANT12 = 0xffffffff;
38 
39     const byte BYTE_TEST_CONSTANT = 17;
40     const long LONG_TEST_CONSTANT = 1L << 40;
41 
42     const String STRING_TEST_CONSTANT = "foo";
43     const String STRING_TEST_CONSTANT2 = "bar";
44 
45     // Test that primitives work as parameters and return types.
RepeatBoolean(boolean token)46     boolean RepeatBoolean(boolean token);
RepeatByte(byte token)47     byte RepeatByte(byte token);
RepeatChar(char token)48     char RepeatChar(char token);
RepeatInt(int token)49     int RepeatInt(int token);
RepeatLong(long token)50     long RepeatLong(long token);
RepeatFloat(float token)51     float RepeatFloat(float token);
RepeatDouble(double token)52     double RepeatDouble(double token);
RepeatString(String token)53     String RepeatString(String token);
RepeatByteEnum(ByteEnum token)54     ByteEnum RepeatByteEnum(ByteEnum token);
RepeatIntEnum(IntEnum token)55     IntEnum RepeatIntEnum(IntEnum token);
RepeatLongEnum(LongEnum token)56     LongEnum RepeatLongEnum(LongEnum token);
57 
58     // Test that arrays work as parameters and return types.
ReverseBoolean(in boolean[] input, out boolean[] repeated)59     boolean[] ReverseBoolean(in boolean[] input, out boolean[] repeated);
ReverseByte(in byte[] input, out byte[] repeated)60     byte[] ReverseByte(in byte[] input, out byte[] repeated);
ReverseChar(in char[] input, out char[] repeated)61     char[] ReverseChar(in char[] input, out char[] repeated);
ReverseInt(in int[] input, out int[] repeated)62     int[] ReverseInt(in int[] input, out int[] repeated);
ReverseLong(in long[] input, out long[] repeated)63     long[] ReverseLong(in long[] input, out long[] repeated);
ReverseFloat(in float[] input, out float[] repeated)64     float[] ReverseFloat(in float[] input, out float[] repeated);
ReverseDouble(in double[] input, out double[] repeated)65     double[] ReverseDouble(in double[] input, out double[] repeated);
ReverseString(in String[] input, out String[] repeated)66     String[] ReverseString(in String[] input, out String[] repeated);
ReverseByteEnum(in ByteEnum[] input, out ByteEnum[] repeated)67     ByteEnum[] ReverseByteEnum(in ByteEnum[] input, out ByteEnum[] repeated);
ReverseIntEnum(in IntEnum[] input, out IntEnum[] repeated)68     IntEnum[] ReverseIntEnum(in IntEnum[] input, out IntEnum[] repeated);
ReverseLongEnum(in LongEnum[] input, out LongEnum[] repeated)69     LongEnum[] ReverseLongEnum(in LongEnum[] input, out LongEnum[] repeated);
70 }
71