aboutsummaryrefslogtreecommitdiff
path: root/tests/android/aidl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/android/aidl')
-rw-r--r--tests/android/aidl/tests/CircularParcelable.aidl23
-rw-r--r--tests/android/aidl/tests/GenericStructuredParcelable.aidl1
-rw-r--r--tests/android/aidl/tests/ICircular.aidl23
-rw-r--r--tests/android/aidl/tests/ITestService.aidl38
-rw-r--r--tests/android/aidl/tests/permission/INoPermission.aidl6
-rw-r--r--tests/android/aidl/tests/permission/IProtected.aidl3
-rw-r--r--tests/android/aidl/tests/permission/IProtectedInterface.aidl3
7 files changed, 94 insertions, 3 deletions
diff --git a/tests/android/aidl/tests/CircularParcelable.aidl b/tests/android/aidl/tests/CircularParcelable.aidl
new file mode 100644
index 00000000..c314a59b
--- /dev/null
+++ b/tests/android/aidl/tests/CircularParcelable.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.ITestService;
+
+parcelable CircularParcelable {
+ @nullable ITestService testService;
+}
diff --git a/tests/android/aidl/tests/GenericStructuredParcelable.aidl b/tests/android/aidl/tests/GenericStructuredParcelable.aidl
index 066b24f1..ffbe6bdb 100644
--- a/tests/android/aidl/tests/GenericStructuredParcelable.aidl
+++ b/tests/android/aidl/tests/GenericStructuredParcelable.aidl
@@ -17,6 +17,7 @@
package android.aidl.tests;
@JavaDerive(toString=true)
+@RustDerive(PartialEq=true, Eq=true, Clone=true, Copy=true)
parcelable GenericStructuredParcelable<T, U, B> {
int a;
int b;
diff --git a/tests/android/aidl/tests/ICircular.aidl b/tests/android/aidl/tests/ICircular.aidl
new file mode 100644
index 00000000..10c857f8
--- /dev/null
+++ b/tests/android/aidl/tests/ICircular.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.aidl.tests;
+
+import android.aidl.tests.ITestService;
+
+interface ICircular {
+ @nullable ITestService GetTestService();
+}
diff --git a/tests/android/aidl/tests/ITestService.aidl b/tests/android/aidl/tests/ITestService.aidl
index 63c0c6c2..fd8b6b55 100644
--- a/tests/android/aidl/tests/ITestService.aidl
+++ b/tests/android/aidl/tests/ITestService.aidl
@@ -18,6 +18,8 @@ package android.aidl.tests;
import android.aidl.tests.BackendType;
import android.aidl.tests.ByteEnum;
+import android.aidl.tests.CircularParcelable;
+import android.aidl.tests.ICircular;
import android.aidl.tests.INamedCallback;
import android.aidl.tests.INewName;
import android.aidl.tests.IOldName;
@@ -31,7 +33,7 @@ import android.aidl.tests.extension.ExtendableParcelable;
/**
* interface comment
*/
-@SuppressWarnings(value={"inout-parameter", "mixed-oneway", "out-array"})
+@SuppressWarnings(value={"inout-parameter", "mixed-oneway", "out-array", "interface-name"})
@SensitiveData
@JavaDefault
@JavaDelegator
@@ -67,6 +69,24 @@ interface ITestService {
const String STRING_TEST_CONSTANT = "foo";
const String STRING_TEST_CONSTANT2 = "bar";
+ const float FLOAT_TEST_CONSTANT = 1.0f;
+ const float FLOAT_TEST_CONSTANT2 = -1.0f;
+ const float FLOAT_TEST_CONSTANT3 = +1.0f;
+ const float FLOAT_TEST_CONSTANT4 = +2.2f;
+ const float FLOAT_TEST_CONSTANT5 = -2.2f;
+ const float FLOAT_TEST_CONSTANT6 = -0.0f;
+ const float FLOAT_TEST_CONSTANT7 = +0.0f;
+
+ const double DOUBLE_TEST_CONSTANT = 1.0;
+ const double DOUBLE_TEST_CONSTANT2 = -1.0;
+ const double DOUBLE_TEST_CONSTANT3 = +1.0;
+ const double DOUBLE_TEST_CONSTANT4 = +2.2;
+ const double DOUBLE_TEST_CONSTANT5 = -2.2;
+ const double DOUBLE_TEST_CONSTANT6 = -0.0;
+ const double DOUBLE_TEST_CONSTANT7 = +0.0;
+ const double DOUBLE_TEST_CONSTANT8 = 1.1f;
+ const double DOUBLE_TEST_CONSTANT9 = -1.1f;
+
const @utf8InCpp String STRING_TEST_CONSTANT_UTF8 = "baz";
// This is to emulate a method that is added after the service is implemented.
@@ -118,6 +138,8 @@ interface ITestService {
// Test that clients can send and receive Binders.
@PropagateAllowBlocking INamedCallback GetOtherTestService(String name);
+ // returns true if the same service is already registered with the same name
+ boolean SetOtherTestService(String name, INamedCallback service);
boolean VerifyName(INamedCallback service, String name);
INamedCallback[] GetInterfaceArray(in String[] names);
boolean VerifyNamesWithInterfaceArray(in INamedCallback[] services, in String[] names);
@@ -291,5 +313,19 @@ interface ITestService {
@nullable Empty[] nullable_parcel_array;
List<Empty> parcel_list;
@nullable List<Empty> nullable_parcel_list;
+
+ // interface without I-
+ interface Foo {}
+
+ parcelable HasDeprecated {
+ /** @deprecated field */
+ int deprecated;
+ }
+ union UsingHasDeprecated {
+ int n;
+ HasDeprecated m;
+ }
}
+
+ ICircular GetCircular(out CircularParcelable cp);
}
diff --git a/tests/android/aidl/tests/permission/INoPermission.aidl b/tests/android/aidl/tests/permission/INoPermission.aidl
new file mode 100644
index 00000000..f72f0bf9
--- /dev/null
+++ b/tests/android/aidl/tests/permission/INoPermission.aidl
@@ -0,0 +1,6 @@
+package android.aidl.tests.permission;
+
+@RequiresNoPermission
+interface INoPermission {
+ void foo();
+}
diff --git a/tests/android/aidl/tests/permission/IProtected.aidl b/tests/android/aidl/tests/permission/IProtected.aidl
index 34071995..d2fdba5b 100644
--- a/tests/android/aidl/tests/permission/IProtected.aidl
+++ b/tests/android/aidl/tests/permission/IProtected.aidl
@@ -9,4 +9,7 @@ interface IProtected {
@EnforcePermission("android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK")
void NonManifestPermission();
+
+ // Used by the integration tests to dynamically set permissions that are considered granted.
+ @RequiresNoPermission void SetGranted(in List<String> permissions);
}
diff --git a/tests/android/aidl/tests/permission/IProtectedInterface.aidl b/tests/android/aidl/tests/permission/IProtectedInterface.aidl
index 93166427..f8d8cb41 100644
--- a/tests/android/aidl/tests/permission/IProtectedInterface.aidl
+++ b/tests/android/aidl/tests/permission/IProtectedInterface.aidl
@@ -3,6 +3,5 @@ package android.aidl.tests.permission;
@EnforcePermission("ACCESS_FINE_LOCATION")
interface IProtectedInterface {
void Method1();
-
- @EnforcePermission("INTERNET") void Method2();
+ void Method2();
}