aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-05-11 17:02:57 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-05-11 17:02:57 +0000
commite4807afa473bc8195e01ff8fc418d571ea05450c (patch)
tree3b1ee4966e00fe8605d923816e5aeb0f99471319
parent756c770aa7720d9ea4d9b0f91d7d7f25d49af941 (diff)
parent98a9d1c9bade6a278cca417329bde9480637cca8 (diff)
downloadaidl-e4807afa473bc8195e01ff8fc418d571ea05450c.tar.gz
Compile tests for '@deprecated' am: 46a7688a04 am: 98a9d1c9ba
Original change: https://android-review.googlesource.com/c/platform/system/tools/aidl/+/1702605 Change-Id: I3467cdac0c15a6a95448adea6b5f6ff00f376895
-rw-r--r--Android.bp5
-rw-r--r--tests/aidl_test_service.cpp2
-rw-r--r--tests/android/aidl/tests/DeprecatedEnum.aidl25
-rw-r--r--tests/android/aidl/tests/DeprecatedParcelable.aidl20
-rw-r--r--tests/android/aidl/tests/IDeprecated.aidl20
-rw-r--r--tests/android/aidl/tests/ITestService.aidl6
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp35
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp76
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp51
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h22
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h99
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h24
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h1
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h54
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h54
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h30
-rw-r--r--tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h4
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java11
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d2
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java48
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d2
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java98
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d2
-rw-r--r--tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java143
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp38
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp86
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp.d2
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/ITestService.cpp249
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h22
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h20
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpTestService.h1
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h52
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h56
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/IDeprecated.h41
-rw-r--r--tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/ITestService.h101
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs8
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d2
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs55
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d2
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs40
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d2
-rw-r--r--tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs130
-rw-r--r--tests/java/src/android/aidl/service/TestServiceServer.java2
-rw-r--r--tests/rust/test_service.rs4
59 files changed, 1472 insertions, 295 deletions
diff --git a/Android.bp b/Android.bp
index 38ad98c9..077be214 100644
--- a/Android.bp
+++ b/Android.bp
@@ -275,12 +275,15 @@ filegroup {
"tests/android/aidl/tests/BackendType.aidl",
"tests/android/aidl/tests/ByteEnum.aidl",
"tests/android/aidl/tests/ConstantExpressionEnum.aidl",
+ "tests/android/aidl/tests/DeprecatedEnum.aidl",
+ "tests/android/aidl/tests/DeprecatedParcelable.aidl",
"tests/android/aidl/tests/GenericStructuredParcelable.aidl",
+ "tests/android/aidl/tests/IDeprecated.aidl",
"tests/android/aidl/tests/INamedCallback.aidl",
"tests/android/aidl/tests/INewName.aidl",
- "tests/android/aidl/tests/IntEnum.aidl",
"tests/android/aidl/tests/IOldName.aidl",
"tests/android/aidl/tests/ITestService.aidl",
+ "tests/android/aidl/tests/IntEnum.aidl",
"tests/android/aidl/tests/LongEnum.aidl",
"tests/android/aidl/tests/OtherParcelableForToString.aidl",
"tests/android/aidl/tests/ParcelableForToString.aidl",
diff --git a/tests/aidl_test_service.cpp b/tests/aidl_test_service.cpp
index 373afbd5..22cd42b2 100644
--- a/tests/aidl_test_service.cpp
+++ b/tests/aidl_test_service.cpp
@@ -298,6 +298,8 @@ class NativeService : public BnTestService {
Status TestOneway() override { return Status::fromStatusT(android::UNKNOWN_ERROR); }
+ Status Deprecated() override { return Status::ok(); }
+
Status RepeatBoolean(bool token, bool* _aidl_return) override {
LogRepeatedToken(token ? 1 : 0);
*_aidl_return = token;
diff --git a/tests/android/aidl/tests/DeprecatedEnum.aidl b/tests/android/aidl/tests/DeprecatedEnum.aidl
new file mode 100644
index 00000000..465a6004
--- /dev/null
+++ b/tests/android/aidl/tests/DeprecatedEnum.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2021 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;
+
+/** @deprecated test */
+@Backing(type="int")
+enum DeprecatedEnum {
+ A,
+ B,
+ C,
+}
diff --git a/tests/android/aidl/tests/DeprecatedParcelable.aidl b/tests/android/aidl/tests/DeprecatedParcelable.aidl
new file mode 100644
index 00000000..42737c43
--- /dev/null
+++ b/tests/android/aidl/tests/DeprecatedParcelable.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2021 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;
+
+/** @deprecated test */
+parcelable DeprecatedParcelable {}
diff --git a/tests/android/aidl/tests/IDeprecated.aidl b/tests/android/aidl/tests/IDeprecated.aidl
new file mode 100644
index 00000000..f143b692
--- /dev/null
+++ b/tests/android/aidl/tests/IDeprecated.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2021 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;
+
+/** @deprecated test */
+interface IDeprecated {}
diff --git a/tests/android/aidl/tests/ITestService.aidl b/tests/android/aidl/tests/ITestService.aidl
index 1520f3d3..1914a4c7 100644
--- a/tests/android/aidl/tests/ITestService.aidl
+++ b/tests/android/aidl/tests/ITestService.aidl
@@ -63,6 +63,12 @@ interface ITestService {
// methods to be added and removed.
int UnimplementedMethod(int arg);
+ /**
+ * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+ * of deprecated and make sure this is reflected in goldens
+ */
+ void Deprecated();
+
oneway void TestOneway();
// Test that primitives work as parameters and return types.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 00000000..eb1d7cbc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1 @@
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 00000000..6f9c39b7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 00000000..ba4b15b4
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,35 @@
+#include <android/aidl/tests/DeprecatedParcelable.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+::android::status_t DeprecatedParcelable::readFromParcel(const ::android::Parcel* _aidl_parcel) {
+ ::android::status_t _aidl_ret_status = ::android::OK;
+ [[maybe_unused]] size_t _aidl_start_pos = _aidl_parcel->dataPosition();
+ int32_t _aidl_parcelable_raw_size = _aidl_parcel->readInt32();
+ if (_aidl_parcelable_raw_size < 0) return ::android::BAD_VALUE;
+ [[maybe_unused]] size_t _aidl_parcelable_size = static_cast<size_t>(_aidl_parcelable_raw_size);
+ if (_aidl_start_pos > SIZE_MAX - _aidl_parcelable_size) return ::android::BAD_VALUE;
+ _aidl_parcel->setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+ return _aidl_ret_status;
+}
+
+::android::status_t DeprecatedParcelable::writeToParcel(::android::Parcel* _aidl_parcel) const {
+ ::android::status_t _aidl_ret_status = ::android::OK;
+ auto _aidl_start_pos = _aidl_parcel->dataPosition();
+ _aidl_parcel->writeInt32(0);
+ auto _aidl_end_pos = _aidl_parcel->dataPosition();
+ _aidl_parcel->setDataPosition(_aidl_start_pos);
+ _aidl_parcel->writeInt32(_aidl_end_pos - _aidl_start_pos);
+ _aidl_parcel->setDataPosition(_aidl_end_pos);
+ return _aidl_ret_status;
+}
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 00000000..f11d82f2
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 00000000..4adb4e75
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,76 @@
+#include <android/aidl/tests/IDeprecated.h>
+#include <android/aidl/tests/BpDeprecated.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+DO_NOT_DIRECTLY_USE_ME_IMPLEMENT_META_INTERFACE(Deprecated, "android.aidl.tests.IDeprecated")
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
+#include <android/aidl/tests/BpDeprecated.h>
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <android-base/macros.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+BpDeprecated::BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl)
+ : BpInterface<IDeprecated>(_aidl_impl){
+}
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
+#include <android/aidl/tests/BnDeprecated.h>
+#include <binder/Parcel.h>
+#include <binder/Stability.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+BnDeprecated::BnDeprecated()
+{
+ ::android::internal::Stability::markCompilationUnit(this);
+}
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
+::android::status_t BnDeprecated::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
+ ::android::status_t _aidl_ret_status = ::android::OK;
+ switch (_aidl_code) {
+ default:
+ {
+ _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags);
+ }
+ break;
+ }
+ if (_aidl_ret_status == ::android::UNEXPECTED_NULL) {
+ _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeToParcel(_aidl_reply);
+ }
+ return _aidl_ret_status;
+}
+
+#pragma clang diagnostic pop
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 00000000..ef80a77d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-cpp-source/gen/android/aidl/tests/IDeprecated.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
index bb31474a..f3cd198c 100644
--- a/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/android/aidl/tests/ITestService.cpp
@@ -82,6 +82,36 @@ BpTestService::BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl
return _aidl_status;
}
+::android::binder::Status BpTestService::Deprecated() {
+ ::android::Parcel _aidl_data;
+ _aidl_data.markSensitive();
+ _aidl_data.markForBinder(remoteStrong());
+ ::android::Parcel _aidl_reply;
+ ::android::status_t _aidl_ret_status = ::android::OK;
+ ::android::binder::Status _aidl_status;
+ _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor());
+ if (((_aidl_ret_status) != (::android::OK))) {
+ goto _aidl_error;
+ }
+ _aidl_ret_status = remote()->transact(BnTestService::TRANSACTION_Deprecated, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_CLEAR_BUF);
+ if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && ITestService::getDefaultImpl())) {
+ return ITestService::getDefaultImpl()->Deprecated();
+ }
+ if (((_aidl_ret_status) != (::android::OK))) {
+ goto _aidl_error;
+ }
+ _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply);
+ if (((_aidl_ret_status) != (::android::OK))) {
+ goto _aidl_error;
+ }
+ if (!_aidl_status.isOk()) {
+ return _aidl_status;
+ }
+ _aidl_error:
+ _aidl_status.setFromStatusT(_aidl_ret_status);
+ return _aidl_status;
+}
+
::android::binder::Status BpTestService::TestOneway() {
::android::Parcel _aidl_data;
_aidl_data.markSensitive();
@@ -2045,6 +2075,9 @@ BnTestService::BnTestService()
::android::internal::Stability::markCompilationUnit(this);
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+
::android::status_t BnTestService::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) {
::android::status_t _aidl_ret_status = ::android::OK;
switch (_aidl_code) {
@@ -2074,6 +2107,22 @@ BnTestService::BnTestService()
}
}
break;
+ case BnTestService::TRANSACTION_Deprecated:
+ {
+ if (!(_aidl_data.checkInterface(this))) {
+ _aidl_ret_status = ::android::BAD_TYPE;
+ break;
+ }
+ ::android::binder::Status _aidl_status(Deprecated());
+ _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply);
+ if (((_aidl_ret_status) != (::android::OK))) {
+ break;
+ }
+ if (!_aidl_status.isOk()) {
+ break;
+ }
+ }
+ break;
case BnTestService::TRANSACTION_TestOneway:
{
if (!(_aidl_data.checkInterface(this))) {
@@ -3448,6 +3497,8 @@ BnTestService::BnTestService()
return _aidl_ret_status;
}
+#pragma clang diagnostic pop
+
} // namespace tests
} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 00000000..fc82d8bd
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <binder/IInterface.h>
+#include <android/aidl/tests/IDeprecated.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+class __attribute__((deprecated("test"))) BnDeprecated : public ::android::BnInterface<IDeprecated> {
+public:
+ explicit BnDeprecated();
+ ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
+}; // class BnDeprecated
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 00000000..d717a4ab
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) enums do not have bn classes \ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 00000000..ce72aa31
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) parcelables do not have bn classes \ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
index ca25ef36..7035616a 100644
--- a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BnTestService.h
@@ -12,55 +12,56 @@ namespace tests {
class BnTestService : public ::android::BnInterface<ITestService> {
public:
static constexpr uint32_t TRANSACTION_UnimplementedMethod = ::android::IBinder::FIRST_CALL_TRANSACTION + 0;
- static constexpr uint32_t TRANSACTION_TestOneway = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
- static constexpr uint32_t TRANSACTION_RepeatBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
- static constexpr uint32_t TRANSACTION_RepeatByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
- static constexpr uint32_t TRANSACTION_RepeatChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
- static constexpr uint32_t TRANSACTION_RepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
- static constexpr uint32_t TRANSACTION_RepeatLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
- static constexpr uint32_t TRANSACTION_RepeatFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
- static constexpr uint32_t TRANSACTION_RepeatDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 8;
- static constexpr uint32_t TRANSACTION_RepeatString = ::android::IBinder::FIRST_CALL_TRANSACTION + 9;
- static constexpr uint32_t TRANSACTION_RepeatByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 10;
- static constexpr uint32_t TRANSACTION_RepeatIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 11;
- static constexpr uint32_t TRANSACTION_RepeatLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 12;
- static constexpr uint32_t TRANSACTION_ReverseBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 13;
- static constexpr uint32_t TRANSACTION_ReverseByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 14;
- static constexpr uint32_t TRANSACTION_ReverseChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 15;
- static constexpr uint32_t TRANSACTION_ReverseInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 16;
- static constexpr uint32_t TRANSACTION_ReverseLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 17;
- static constexpr uint32_t TRANSACTION_ReverseFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 18;
- static constexpr uint32_t TRANSACTION_ReverseDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 19;
- static constexpr uint32_t TRANSACTION_ReverseString = ::android::IBinder::FIRST_CALL_TRANSACTION + 20;
- static constexpr uint32_t TRANSACTION_ReverseByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 21;
- static constexpr uint32_t TRANSACTION_ReverseIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 22;
- static constexpr uint32_t TRANSACTION_ReverseLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 23;
- static constexpr uint32_t TRANSACTION_GetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 24;
- static constexpr uint32_t TRANSACTION_VerifyName = ::android::IBinder::FIRST_CALL_TRANSACTION + 25;
- static constexpr uint32_t TRANSACTION_ReverseStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 26;
- static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = ::android::IBinder::FIRST_CALL_TRANSACTION + 27;
- static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 28;
- static constexpr uint32_t TRANSACTION_ThrowServiceException = ::android::IBinder::FIRST_CALL_TRANSACTION + 29;
- static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 30;
- static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 31;
- static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 32;
- static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 33;
- static constexpr uint32_t TRANSACTION_RepeatNullableString = ::android::IBinder::FIRST_CALL_TRANSACTION + 34;
- static constexpr uint32_t TRANSACTION_RepeatNullableStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 35;
- static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 36;
- static constexpr uint32_t TRANSACTION_TakesAnIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 37;
- static constexpr uint32_t TRANSACTION_TakesANullableIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 38;
- static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 39;
- static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 40;
- static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 41;
- static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 42;
- static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 43;
- static constexpr uint32_t TRANSACTION_GetCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 44;
- static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 45;
- static constexpr uint32_t TRANSACTION_GetOldNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 46;
- static constexpr uint32_t TRANSACTION_GetNewNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 47;
- static constexpr uint32_t TRANSACTION_GetCppJavaTests = ::android::IBinder::FIRST_CALL_TRANSACTION + 48;
- static constexpr uint32_t TRANSACTION_getBackendType = ::android::IBinder::FIRST_CALL_TRANSACTION + 49;
+ static constexpr uint32_t TRANSACTION_Deprecated = ::android::IBinder::FIRST_CALL_TRANSACTION + 1;
+ static constexpr uint32_t TRANSACTION_TestOneway = ::android::IBinder::FIRST_CALL_TRANSACTION + 2;
+ static constexpr uint32_t TRANSACTION_RepeatBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 3;
+ static constexpr uint32_t TRANSACTION_RepeatByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 4;
+ static constexpr uint32_t TRANSACTION_RepeatChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 5;
+ static constexpr uint32_t TRANSACTION_RepeatInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 6;
+ static constexpr uint32_t TRANSACTION_RepeatLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 7;
+ static constexpr uint32_t TRANSACTION_RepeatFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 8;
+ static constexpr uint32_t TRANSACTION_RepeatDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 9;
+ static constexpr uint32_t TRANSACTION_RepeatString = ::android::IBinder::FIRST_CALL_TRANSACTION + 10;
+ static constexpr uint32_t TRANSACTION_RepeatByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 11;
+ static constexpr uint32_t TRANSACTION_RepeatIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 12;
+ static constexpr uint32_t TRANSACTION_RepeatLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 13;
+ static constexpr uint32_t TRANSACTION_ReverseBoolean = ::android::IBinder::FIRST_CALL_TRANSACTION + 14;
+ static constexpr uint32_t TRANSACTION_ReverseByte = ::android::IBinder::FIRST_CALL_TRANSACTION + 15;
+ static constexpr uint32_t TRANSACTION_ReverseChar = ::android::IBinder::FIRST_CALL_TRANSACTION + 16;
+ static constexpr uint32_t TRANSACTION_ReverseInt = ::android::IBinder::FIRST_CALL_TRANSACTION + 17;
+ static constexpr uint32_t TRANSACTION_ReverseLong = ::android::IBinder::FIRST_CALL_TRANSACTION + 18;
+ static constexpr uint32_t TRANSACTION_ReverseFloat = ::android::IBinder::FIRST_CALL_TRANSACTION + 19;
+ static constexpr uint32_t TRANSACTION_ReverseDouble = ::android::IBinder::FIRST_CALL_TRANSACTION + 20;
+ static constexpr uint32_t TRANSACTION_ReverseString = ::android::IBinder::FIRST_CALL_TRANSACTION + 21;
+ static constexpr uint32_t TRANSACTION_ReverseByteEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 22;
+ static constexpr uint32_t TRANSACTION_ReverseIntEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 23;
+ static constexpr uint32_t TRANSACTION_ReverseLongEnum = ::android::IBinder::FIRST_CALL_TRANSACTION + 24;
+ static constexpr uint32_t TRANSACTION_GetOtherTestService = ::android::IBinder::FIRST_CALL_TRANSACTION + 25;
+ static constexpr uint32_t TRANSACTION_VerifyName = ::android::IBinder::FIRST_CALL_TRANSACTION + 26;
+ static constexpr uint32_t TRANSACTION_ReverseStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 27;
+ static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = ::android::IBinder::FIRST_CALL_TRANSACTION + 28;
+ static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 29;
+ static constexpr uint32_t TRANSACTION_ThrowServiceException = ::android::IBinder::FIRST_CALL_TRANSACTION + 30;
+ static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 31;
+ static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 32;
+ static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 33;
+ static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = ::android::IBinder::FIRST_CALL_TRANSACTION + 34;
+ static constexpr uint32_t TRANSACTION_RepeatNullableString = ::android::IBinder::FIRST_CALL_TRANSACTION + 35;
+ static constexpr uint32_t TRANSACTION_RepeatNullableStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 36;
+ static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 37;
+ static constexpr uint32_t TRANSACTION_TakesAnIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 38;
+ static constexpr uint32_t TRANSACTION_TakesANullableIBinder = ::android::IBinder::FIRST_CALL_TRANSACTION + 39;
+ static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 40;
+ static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 41;
+ static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 42;
+ static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = ::android::IBinder::FIRST_CALL_TRANSACTION + 43;
+ static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = ::android::IBinder::FIRST_CALL_TRANSACTION + 44;
+ static constexpr uint32_t TRANSACTION_GetCallback = ::android::IBinder::FIRST_CALL_TRANSACTION + 45;
+ static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = ::android::IBinder::FIRST_CALL_TRANSACTION + 46;
+ static constexpr uint32_t TRANSACTION_GetOldNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 47;
+ static constexpr uint32_t TRANSACTION_GetNewNameInterface = ::android::IBinder::FIRST_CALL_TRANSACTION + 48;
+ static constexpr uint32_t TRANSACTION_GetCppJavaTests = ::android::IBinder::FIRST_CALL_TRANSACTION + 49;
+ static constexpr uint32_t TRANSACTION_getBackendType = ::android::IBinder::FIRST_CALL_TRANSACTION + 50;
explicit BnTestService();
::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override;
}; // class BnTestService
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 00000000..88fb62d7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <utils/Errors.h>
+#include <android/aidl/tests/IDeprecated.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+class __attribute__((deprecated("test"))) BpDeprecated : public ::android::BpInterface<IDeprecated> {
+public:
+ explicit BpDeprecated(const ::android::sp<::android::IBinder>& _aidl_impl);
+ virtual ~BpDeprecated() = default;
+}; // class BpDeprecated
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 00000000..9c951e04
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) enums do not have bp classes \ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 00000000..27af6b1c
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) parcelables do not have bp classes \ No newline at end of file
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
index 153119fa..bee25bf9 100644
--- a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/BpTestService.h
@@ -16,6 +16,7 @@ public:
explicit BpTestService(const ::android::sp<::android::IBinder>& _aidl_impl);
virtual ~BpTestService() = default;
::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) override;
+ ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
::android::binder::Status TestOneway() override;
::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) override;
::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) override;
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 00000000..3f3e84d0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#include <array>
+#include <binder/Enums.h>
+#include <cstdint>
+#include <string>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+ A = 0,
+ B = 1,
+ C = 2,
+};
+
+ __attribute__((deprecated("test")))static inline std::string toString(DeprecatedEnum val) {
+ switch(val) {
+ case DeprecatedEnum::A:
+ return "A";
+ case DeprecatedEnum::B:
+ return "B";
+ case DeprecatedEnum::C:
+ return "C";
+ default:
+ return std::to_string(static_cast<int32_t>(val));
+ }
+}
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
+namespace android {
+
+namespace internal {
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<::android::aidl::tests::DeprecatedEnum, 3> __attribute__((deprecated("test"))) enum_values<::android::aidl::tests::DeprecatedEnum> = {
+ ::android::aidl::tests::DeprecatedEnum::A,
+ ::android::aidl::tests::DeprecatedEnum::B,
+ ::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+
+} // namespace internal
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 00000000..59c7f203
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#include <android/binder_to_string.h>
+#include <binder/Parcel.h>
+#include <binder/Status.h>
+#include <tuple>
+#include <utils/String16.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+class __attribute__((deprecated("test"))) DeprecatedParcelable : public ::android::Parcelable {
+public:
+ inline bool operator!=(const DeprecatedParcelable&) const {
+ return std::tie() != std::tie();
+ }
+ inline bool operator<(const DeprecatedParcelable&) const {
+ return std::tie() < std::tie();
+ }
+ inline bool operator<=(const DeprecatedParcelable&) const {
+ return std::tie() <= std::tie();
+ }
+ inline bool operator==(const DeprecatedParcelable&) const {
+ return std::tie() == std::tie();
+ }
+ inline bool operator>(const DeprecatedParcelable&) const {
+ return std::tie() > std::tie();
+ }
+ inline bool operator>=(const DeprecatedParcelable&) const {
+ return std::tie() >= std::tie();
+ }
+
+ ::android::status_t readFromParcel(const ::android::Parcel* _aidl_parcel) final;
+ ::android::status_t writeToParcel(::android::Parcel* _aidl_parcel) const final;
+ static const ::android::String16& getParcelableDescriptor() {
+ static const ::android::StaticString16 DESCIPTOR (u"android.aidl.tests.DeprecatedParcelable");
+ return DESCIPTOR;
+ }
+ inline std::string toString() const {
+ std::ostringstream os;
+ os << "DeprecatedParcelable{";
+ os << "}";
+ return os.str();
+ }
+}; // class DeprecatedParcelable
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
new file mode 100644
index 00000000..73931ead
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <binder/IBinder.h>
+#include <binder/IInterface.h>
+#include <binder/Status.h>
+#include <utils/StrongPointer.h>
+
+namespace android {
+
+namespace aidl {
+
+namespace tests {
+
+class __attribute__((deprecated("test"))) IDeprecated : public ::android::IInterface {
+public:
+ DECLARE_META_INTERFACE(Deprecated)
+}; // class IDeprecated
+
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+ ::android::IBinder* onAsBinder() override {
+ return nullptr;
+ }
+}; // class IDeprecatedDefault
+
+} // namespace tests
+
+} // namespace aidl
+
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
index 05efe5a3..9d91e0e8 100644
--- a/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
+++ b/tests/golden_output/aidl-test-interface-cpp-source/gen/include/android/aidl/tests/ITestService.h
@@ -109,6 +109,7 @@ public:
static const ::android::String16& STRING_TEST_CONSTANT2();
static const ::std::string& STRING_TEST_CONSTANT_UTF8();
virtual ::android::binder::Status UnimplementedMethod(int32_t arg, int32_t* _aidl_return) = 0;
+ virtual ::android::binder::Status Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
virtual ::android::binder::Status TestOneway() = 0;
virtual ::android::binder::Status RepeatBoolean(bool token, bool* _aidl_return) = 0;
virtual ::android::binder::Status RepeatByte(int8_t token, int8_t* _aidl_return) = 0;
@@ -168,6 +169,9 @@ public:
::android::binder::Status UnimplementedMethod(int32_t, int32_t*) override {
return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
}
+ ::android::binder::Status Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) {
+ return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
+ }
::android::binder::Status TestOneway() override {
return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION);
}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
new file mode 100644
index 00000000..143b87ae
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java
@@ -0,0 +1,11 @@
+/*
+ * This file is auto-generated. DO NOT MODIFY.
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public @interface DeprecatedEnum {
+ public static final int A = 0;
+ public static final int B = 1;
+ public static final int C = 2;
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
new file mode 100644
index 00000000..e4716256
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedEnum.java : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
new file mode 100644
index 00000000..f1444bad
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java
@@ -0,0 +1,48 @@
+/*
+ * This file is auto-generated. DO NOT MODIFY.
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public class DeprecatedParcelable implements android.os.Parcelable
+{
+ public static final android.os.Parcelable.Creator<DeprecatedParcelable> CREATOR = new android.os.Parcelable.Creator<DeprecatedParcelable>() {
+ @Override
+ public DeprecatedParcelable createFromParcel(android.os.Parcel _aidl_source) {
+ DeprecatedParcelable _aidl_out = new DeprecatedParcelable();
+ _aidl_out.readFromParcel(_aidl_source);
+ return _aidl_out;
+ }
+ @Override
+ public DeprecatedParcelable[] newArray(int _aidl_size) {
+ return new DeprecatedParcelable[_aidl_size];
+ }
+ };
+ @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
+ {
+ int _aidl_start_pos = _aidl_parcel.dataPosition();
+ _aidl_parcel.writeInt(0);
+ int _aidl_end_pos = _aidl_parcel.dataPosition();
+ _aidl_parcel.setDataPosition(_aidl_start_pos);
+ _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
+ _aidl_parcel.setDataPosition(_aidl_end_pos);
+ }
+ public final void readFromParcel(android.os.Parcel _aidl_parcel)
+ {
+ int _aidl_start_pos = _aidl_parcel.dataPosition();
+ int _aidl_parcelable_size = _aidl_parcel.readInt();
+ try {
+ if (_aidl_parcelable_size < 0) return;
+ } finally {
+ if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
+ throw new android.os.BadParcelableException("Overflow in the size of parcelable");
+ }
+ _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
+ }
+ }
+ @Override
+ public int describeContents() {
+ int _mask = 0;
+ return _mask;
+ }
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
new file mode 100644
index 00000000..94f6de22
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/DeprecatedParcelable.java : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
new file mode 100644
index 00000000..0290c7a7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java
@@ -0,0 +1,98 @@
+/*
+ * This file is auto-generated. DO NOT MODIFY.
+ */
+package android.aidl.tests;
+/** @deprecated test */
+@Deprecated
+public interface IDeprecated extends android.os.IInterface
+{
+ /** Default implementation for IDeprecated. */
+ public static class Default implements android.aidl.tests.IDeprecated
+ {
+ @Override
+ public android.os.IBinder asBinder() {
+ return null;
+ }
+ }
+ /** Local-side IPC implementation stub class. */
+ public static abstract class Stub extends android.os.Binder implements android.aidl.tests.IDeprecated
+ {
+ /** Construct the stub at attach it to the interface. */
+ public Stub()
+ {
+ this.attachInterface(this, DESCRIPTOR);
+ }
+ /**
+ * Cast an IBinder object into an android.aidl.tests.IDeprecated interface,
+ * generating a proxy if needed.
+ */
+ public static android.aidl.tests.IDeprecated asInterface(android.os.IBinder obj)
+ {
+ if ((obj==null)) {
+ return null;
+ }
+ android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
+ if (((iin!=null)&&(iin instanceof android.aidl.tests.IDeprecated))) {
+ return ((android.aidl.tests.IDeprecated)iin);
+ }
+ return new android.aidl.tests.IDeprecated.Stub.Proxy(obj);
+ }
+ @Override public android.os.IBinder asBinder()
+ {
+ return this;
+ }
+ @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
+ {
+ java.lang.String descriptor = DESCRIPTOR;
+ switch (code)
+ {
+ case INTERFACE_TRANSACTION:
+ {
+ reply.writeString(descriptor);
+ return true;
+ }
+ }
+ switch (code)
+ {
+ default:
+ {
+ return super.onTransact(code, data, reply, flags);
+ }
+ }
+ }
+ private static class Proxy implements android.aidl.tests.IDeprecated
+ {
+ private android.os.IBinder mRemote;
+ Proxy(android.os.IBinder remote)
+ {
+ mRemote = remote;
+ }
+ @Override public android.os.IBinder asBinder()
+ {
+ return mRemote;
+ }
+ public java.lang.String getInterfaceDescriptor()
+ {
+ return DESCRIPTOR;
+ }
+ public static android.aidl.tests.IDeprecated sDefaultImpl;
+ }
+ public static boolean setDefaultImpl(android.aidl.tests.IDeprecated impl) {
+ // Only one user of this interface can use this function
+ // at a time. This is a heuristic to detect if two different
+ // users in the same process use this function.
+ if (Stub.Proxy.sDefaultImpl != null) {
+ throw new IllegalStateException("setDefaultImpl() called twice");
+ }
+ if (impl != null) {
+ Stub.Proxy.sDefaultImpl = impl;
+ return true;
+ }
+ return false;
+ }
+ public static android.aidl.tests.IDeprecated getDefaultImpl() {
+ return Stub.Proxy.sDefaultImpl;
+ }
+ }
+ public static final java.lang.String DESCRIPTOR = "android$aidl$tests$IDeprecated".replace('$', '.');
+}
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
new file mode 100644
index 00000000..f97a90cc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-java-source/gen/android/aidl/tests/IDeprecated.java : \
+ system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
index ba14ba40..4d6f9fd9 100644
--- a/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
+++ b/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ITestService.java
@@ -22,6 +22,13 @@ public interface ITestService extends android.os.IInterface
{
return 0;
}
+ /**
+ * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+ * of deprecated and make sure this is reflected in goldens
+ */
+ @Override public void Deprecated() throws android.os.RemoteException
+ {
+ }
@Override public void TestOneway() throws android.os.RemoteException
{
}
@@ -278,6 +285,13 @@ public interface ITestService extends android.os.IInterface
reply.writeInt(_result);
return true;
}
+ case TRANSACTION_Deprecated:
+ {
+ data.enforceInterface(descriptor);
+ this.Deprecated();
+ reply.writeNoException();
+ return true;
+ }
case TRANSACTION_TestOneway:
{
data.enforceInterface(descriptor);
@@ -975,6 +989,30 @@ public interface ITestService extends android.os.IInterface
}
return _result;
}
+ /**
+ * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+ * of deprecated and make sure this is reflected in goldens
+ */
+ @Override public void Deprecated() throws android.os.RemoteException
+ {
+ android.os.Parcel _data = android.os.Parcel.obtain();
+ _data.markSensitive();android.os.Parcel _reply = android.os.Parcel.obtain();
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ boolean _status = mRemote.transact(Stub.TRANSACTION_Deprecated, _data, _reply, android.os.IBinder.FLAG_CLEAR_BUF);
+ if (!_status) {
+ if (getDefaultImpl() != null) {
+ getDefaultImpl().Deprecated();
+ return;
+ }
+ }
+ _reply.readException();
+ }
+ finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ }
@Override public void TestOneway() throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
@@ -2229,55 +2267,56 @@ public interface ITestService extends android.os.IInterface
public static android.aidl.tests.ITestService sDefaultImpl;
}
static final int TRANSACTION_UnimplementedMethod = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
- static final int TRANSACTION_TestOneway = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
- static final int TRANSACTION_RepeatBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
- static final int TRANSACTION_RepeatByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
- static final int TRANSACTION_RepeatChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
- static final int TRANSACTION_RepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
- static final int TRANSACTION_RepeatLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
- static final int TRANSACTION_RepeatFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
- static final int TRANSACTION_RepeatDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
- static final int TRANSACTION_RepeatString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9);
- static final int TRANSACTION_RepeatByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10);
- static final int TRANSACTION_RepeatIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11);
- static final int TRANSACTION_RepeatLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12);
- static final int TRANSACTION_ReverseBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13);
- static final int TRANSACTION_ReverseByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14);
- static final int TRANSACTION_ReverseChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15);
- static final int TRANSACTION_ReverseInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16);
- static final int TRANSACTION_ReverseLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17);
- static final int TRANSACTION_ReverseFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18);
- static final int TRANSACTION_ReverseDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19);
- static final int TRANSACTION_ReverseString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20);
- static final int TRANSACTION_ReverseByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21);
- static final int TRANSACTION_ReverseIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22);
- static final int TRANSACTION_ReverseLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23);
- static final int TRANSACTION_GetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24);
- static final int TRANSACTION_VerifyName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25);
- static final int TRANSACTION_ReverseStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26);
- static final int TRANSACTION_RepeatParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27);
- static final int TRANSACTION_ReverseParcelFileDescriptorArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28);
- static final int TRANSACTION_ThrowServiceException = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29);
- static final int TRANSACTION_RepeatNullableIntArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30);
- static final int TRANSACTION_RepeatNullableByteEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31);
- static final int TRANSACTION_RepeatNullableIntEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32);
- static final int TRANSACTION_RepeatNullableLongEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33);
- static final int TRANSACTION_RepeatNullableString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34);
- static final int TRANSACTION_RepeatNullableStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35);
- static final int TRANSACTION_RepeatNullableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36);
- static final int TRANSACTION_TakesAnIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37);
- static final int TRANSACTION_TakesANullableIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38);
- static final int TRANSACTION_RepeatUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39);
- static final int TRANSACTION_RepeatNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 40);
- static final int TRANSACTION_ReverseUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 41);
- static final int TRANSACTION_ReverseNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 42);
- static final int TRANSACTION_ReverseUtf8CppStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 43);
- static final int TRANSACTION_GetCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 44);
- static final int TRANSACTION_FillOutStructuredParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 45);
- static final int TRANSACTION_GetOldNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 46);
- static final int TRANSACTION_GetNewNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 47);
- static final int TRANSACTION_GetCppJavaTests = (android.os.IBinder.FIRST_CALL_TRANSACTION + 48);
- static final int TRANSACTION_getBackendType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 49);
+ static final int TRANSACTION_Deprecated = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
+ static final int TRANSACTION_TestOneway = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
+ static final int TRANSACTION_RepeatBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
+ static final int TRANSACTION_RepeatByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
+ static final int TRANSACTION_RepeatChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
+ static final int TRANSACTION_RepeatInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
+ static final int TRANSACTION_RepeatLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7);
+ static final int TRANSACTION_RepeatFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8);
+ static final int TRANSACTION_RepeatDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9);
+ static final int TRANSACTION_RepeatString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10);
+ static final int TRANSACTION_RepeatByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11);
+ static final int TRANSACTION_RepeatIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12);
+ static final int TRANSACTION_RepeatLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13);
+ static final int TRANSACTION_ReverseBoolean = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14);
+ static final int TRANSACTION_ReverseByte = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15);
+ static final int TRANSACTION_ReverseChar = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16);
+ static final int TRANSACTION_ReverseInt = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17);
+ static final int TRANSACTION_ReverseLong = (android.os.IBinder.FIRST_CALL_TRANSACTION + 18);
+ static final int TRANSACTION_ReverseFloat = (android.os.IBinder.FIRST_CALL_TRANSACTION + 19);
+ static final int TRANSACTION_ReverseDouble = (android.os.IBinder.FIRST_CALL_TRANSACTION + 20);
+ static final int TRANSACTION_ReverseString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 21);
+ static final int TRANSACTION_ReverseByteEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 22);
+ static final int TRANSACTION_ReverseIntEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 23);
+ static final int TRANSACTION_ReverseLongEnum = (android.os.IBinder.FIRST_CALL_TRANSACTION + 24);
+ static final int TRANSACTION_GetOtherTestService = (android.os.IBinder.FIRST_CALL_TRANSACTION + 25);
+ static final int TRANSACTION_VerifyName = (android.os.IBinder.FIRST_CALL_TRANSACTION + 26);
+ static final int TRANSACTION_ReverseStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 27);
+ static final int TRANSACTION_RepeatParcelFileDescriptor = (android.os.IBinder.FIRST_CALL_TRANSACTION + 28);
+ static final int TRANSACTION_ReverseParcelFileDescriptorArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 29);
+ static final int TRANSACTION_ThrowServiceException = (android.os.IBinder.FIRST_CALL_TRANSACTION + 30);
+ static final int TRANSACTION_RepeatNullableIntArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 31);
+ static final int TRANSACTION_RepeatNullableByteEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 32);
+ static final int TRANSACTION_RepeatNullableIntEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 33);
+ static final int TRANSACTION_RepeatNullableLongEnumArray = (android.os.IBinder.FIRST_CALL_TRANSACTION + 34);
+ static final int TRANSACTION_RepeatNullableString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 35);
+ static final int TRANSACTION_RepeatNullableStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 36);
+ static final int TRANSACTION_RepeatNullableParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 37);
+ static final int TRANSACTION_TakesAnIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 38);
+ static final int TRANSACTION_TakesANullableIBinder = (android.os.IBinder.FIRST_CALL_TRANSACTION + 39);
+ static final int TRANSACTION_RepeatUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 40);
+ static final int TRANSACTION_RepeatNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 41);
+ static final int TRANSACTION_ReverseUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 42);
+ static final int TRANSACTION_ReverseNullableUtf8CppString = (android.os.IBinder.FIRST_CALL_TRANSACTION + 43);
+ static final int TRANSACTION_ReverseUtf8CppStringList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 44);
+ static final int TRANSACTION_GetCallback = (android.os.IBinder.FIRST_CALL_TRANSACTION + 45);
+ static final int TRANSACTION_FillOutStructuredParcelable = (android.os.IBinder.FIRST_CALL_TRANSACTION + 46);
+ static final int TRANSACTION_GetOldNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 47);
+ static final int TRANSACTION_GetNewNameInterface = (android.os.IBinder.FIRST_CALL_TRANSACTION + 48);
+ static final int TRANSACTION_GetCppJavaTests = (android.os.IBinder.FIRST_CALL_TRANSACTION + 49);
+ static final int TRANSACTION_getBackendType = (android.os.IBinder.FIRST_CALL_TRANSACTION + 50);
public static boolean setDefaultImpl(android.aidl.tests.ITestService impl) {
// Only one user of this interface can use this function
// at a time. This is a heuristic to detect if two different
@@ -2386,6 +2425,12 @@ public interface ITestService extends android.os.IInterface
// "::android::IBinder::FIRST_CALL_TRANSACTION + 0" value and allow
// methods to be added and removed.
public int UnimplementedMethod(int arg) throws android.os.RemoteException;
+ /**
+ * @deprecated to make sure we have something in system/tools/aidl which does a compile check
+ * of deprecated and make sure this is reflected in goldens
+ */
+ @Deprecated
+ public void Deprecated() throws android.os.RemoteException;
public void TestOneway() throws android.os.RemoteException;
// Test that primitives work as parameters and return types.
public boolean RepeatBoolean(boolean token) throws android.os.RemoteException;
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp
new file mode 100644
index 00000000..eb1d7cbc
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp
@@ -0,0 +1 @@
+// This file is intentionally left blank as placeholder for enum declaration.
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
new file mode 100644
index 00000000..42ac6a30
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedEnum.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
new file mode 100644
index 00000000..13fc6c20
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp
@@ -0,0 +1,38 @@
+#include "aidl/android/aidl/tests/DeprecatedParcelable.h"
+
+#include <android/binder_parcel_utils.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+const char* DeprecatedParcelable::descriptor = "android.aidl.tests.DeprecatedParcelable";
+
+binder_status_t DeprecatedParcelable::readFromParcel(const AParcel* parcel) {
+ int32_t _aidl_parcelable_size;
+ int32_t _aidl_start_pos = AParcel_getDataPosition(parcel);
+ binder_status_t _aidl_ret_status = AParcel_readInt32(parcel, &_aidl_parcelable_size);
+ if (_aidl_start_pos > INT32_MAX - _aidl_parcelable_size) return STATUS_BAD_VALUE;
+ if (_aidl_parcelable_size < 0) return STATUS_BAD_VALUE;
+ if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+ AParcel_setDataPosition(parcel, _aidl_start_pos + _aidl_parcelable_size);
+ return _aidl_ret_status;
+}
+binder_status_t DeprecatedParcelable::writeToParcel(AParcel* parcel) const {
+ binder_status_t _aidl_ret_status;
+ size_t _aidl_start_pos = AParcel_getDataPosition(parcel);
+ _aidl_ret_status = AParcel_writeInt32(parcel, 0);
+ if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status;
+
+ size_t _aidl_end_pos = AParcel_getDataPosition(parcel);
+ AParcel_setDataPosition(parcel, _aidl_start_pos);
+ AParcel_writeInt32(parcel, _aidl_end_pos - _aidl_start_pos);
+ AParcel_setDataPosition(parcel, _aidl_end_pos);
+ return _aidl_ret_status;
+}
+
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
new file mode 100644
index 00000000..168cf664
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/DeprecatedParcelable.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp
new file mode 100644
index 00000000..a6513c25
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp
@@ -0,0 +1,86 @@
+#include <android/binder_parcel_utils.h>
+#include <aidl/android/aidl/tests/BpDeprecated.h>
+#include <aidl/android/aidl/tests/BnDeprecated.h>
+#include <aidl/android/aidl/tests/IDeprecated.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
+static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
+ (void)_aidl_in;
+ (void)_aidl_out;
+ binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION;
+ (void)_aidl_binder;
+ (void)_aidl_code;
+ return _aidl_ret_status;
+}
+
+static AIBinder_Class* _g_aidl_clazz = ::ndk::ICInterface::defineClass(IDeprecated::descriptor, _aidl_onTransact);
+
+#pragma clang diagnostic pop
+BpDeprecated::BpDeprecated(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
+BpDeprecated::~BpDeprecated() {}
+
+// Source for BnDeprecated
+BnDeprecated::BnDeprecated() {}
+BnDeprecated::~BnDeprecated() {}
+::ndk::SpAIBinder BnDeprecated::createBinder() {
+ AIBinder* binder = AIBinder_new(_g_aidl_clazz, static_cast<void*>(this));
+ #ifdef BINDER_STABILITY_SUPPORT
+ AIBinder_markCompilationUnitStability(binder);
+ #endif // BINDER_STABILITY_SUPPORT
+ return ::ndk::SpAIBinder(binder);
+}
+// Source for IDeprecated
+const char* IDeprecated::descriptor = "android.aidl.tests.IDeprecated";
+IDeprecated::IDeprecated() {}
+IDeprecated::~IDeprecated() {}
+
+
+std::shared_ptr<IDeprecated> IDeprecated::fromBinder(const ::ndk::SpAIBinder& binder) {
+ if (!AIBinder_associateClass(binder.get(), _g_aidl_clazz)) { return nullptr; }
+ std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get());
+ if (interface) {
+ return std::static_pointer_cast<IDeprecated>(interface);
+ }
+ return ::ndk::SharedRefBase::make<BpDeprecated>(binder);
+}
+
+binder_status_t IDeprecated::writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance) {
+ return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr);
+}
+binder_status_t IDeprecated::readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance) {
+ ::ndk::SpAIBinder binder;
+ binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR());
+ if (status != STATUS_OK) return status;
+ *instance = IDeprecated::fromBinder(binder);
+ return STATUS_OK;
+}
+bool IDeprecated::setDefaultImpl(const std::shared_ptr<IDeprecated>& impl) {
+ // Only one user of this interface can use this function
+ // at a time. This is a heuristic to detect if two different
+ // users in the same process use this function.
+ assert(!IDeprecated::default_impl);
+ if (impl) {
+ IDeprecated::default_impl = impl;
+ return true;
+ }
+ return false;
+}
+const std::shared_ptr<IDeprecated>& IDeprecated::getDefaultImpl() {
+ return IDeprecated::default_impl;
+}
+std::shared_ptr<IDeprecated> IDeprecated::default_impl = nullptr;
+::ndk::SpAIBinder IDeprecatedDefault::asBinder() {
+ return ::ndk::SpAIBinder();
+}
+bool IDeprecatedDefault::isRemote() {
+ return false;
+}
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp.d b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp.d
new file mode 100644
index 00000000..5bc40c06
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/IDeprecated.cpp : \
+ system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/ITestService.cpp b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/ITestService.cpp
index 6d00c22a..515707aa 100644
--- a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/ITestService.cpp
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/android/aidl/tests/ITestService.cpp
@@ -16,6 +16,8 @@ namespace aidl {
namespace android {
namespace aidl {
namespace tests {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated"
static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) {
(void)_aidl_in;
(void)_aidl_out;
@@ -40,13 +42,23 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 1 /*TestOneway*/): {
+ case (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/): {
+
+ ::ndk::ScopedAStatus _aidl_status = _aidl_impl->Deprecated();
+ _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get());
+ if (_aidl_ret_status != STATUS_OK) break;
+
+ if (!AStatus_isOk(_aidl_status.get())) break;
+
+ break;
+ }
+ case (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/): {
::ndk::ScopedAStatus _aidl_status = _aidl_impl->TestOneway();
_aidl_ret_status = STATUS_OK;
break;
}
- case (FIRST_CALL_TRANSACTION + 2 /*RepeatBoolean*/): {
+ case (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/): {
bool in_token;
bool _aidl_return;
@@ -64,7 +76,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 3 /*RepeatByte*/): {
+ case (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/): {
int8_t in_token;
int8_t _aidl_return;
@@ -82,7 +94,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 4 /*RepeatChar*/): {
+ case (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/): {
char16_t in_token;
char16_t _aidl_return;
@@ -100,7 +112,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 5 /*RepeatInt*/): {
+ case (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/): {
int32_t in_token;
int32_t _aidl_return;
@@ -118,7 +130,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 6 /*RepeatLong*/): {
+ case (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/): {
int64_t in_token;
int64_t _aidl_return;
@@ -136,7 +148,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 7 /*RepeatFloat*/): {
+ case (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/): {
float in_token;
float _aidl_return;
@@ -154,7 +166,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 8 /*RepeatDouble*/): {
+ case (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/): {
double in_token;
double _aidl_return;
@@ -172,7 +184,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 9 /*RepeatString*/): {
+ case (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/): {
std::string in_token;
std::string _aidl_return;
@@ -190,7 +202,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 10 /*RepeatByteEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/): {
::aidl::android::aidl::tests::ByteEnum in_token;
::aidl::android::aidl::tests::ByteEnum _aidl_return;
@@ -208,7 +220,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 11 /*RepeatIntEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/): {
::aidl::android::aidl::tests::IntEnum in_token;
::aidl::android::aidl::tests::IntEnum _aidl_return;
@@ -226,7 +238,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 12 /*RepeatLongEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/): {
::aidl::android::aidl::tests::LongEnum in_token;
::aidl::android::aidl::tests::LongEnum _aidl_return;
@@ -244,7 +256,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 13 /*ReverseBoolean*/): {
+ case (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/): {
std::vector<bool> in_input;
std::vector<bool> out_repeated;
std::vector<bool> _aidl_return;
@@ -269,7 +281,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 14 /*ReverseByte*/): {
+ case (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/): {
std::vector<uint8_t> in_input;
std::vector<uint8_t> out_repeated;
std::vector<uint8_t> _aidl_return;
@@ -294,7 +306,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 15 /*ReverseChar*/): {
+ case (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/): {
std::vector<char16_t> in_input;
std::vector<char16_t> out_repeated;
std::vector<char16_t> _aidl_return;
@@ -319,7 +331,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 16 /*ReverseInt*/): {
+ case (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/): {
std::vector<int32_t> in_input;
std::vector<int32_t> out_repeated;
std::vector<int32_t> _aidl_return;
@@ -344,7 +356,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 17 /*ReverseLong*/): {
+ case (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/): {
std::vector<int64_t> in_input;
std::vector<int64_t> out_repeated;
std::vector<int64_t> _aidl_return;
@@ -369,7 +381,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 18 /*ReverseFloat*/): {
+ case (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/): {
std::vector<float> in_input;
std::vector<float> out_repeated;
std::vector<float> _aidl_return;
@@ -394,7 +406,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 19 /*ReverseDouble*/): {
+ case (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/): {
std::vector<double> in_input;
std::vector<double> out_repeated;
std::vector<double> _aidl_return;
@@ -419,7 +431,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 20 /*ReverseString*/): {
+ case (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/): {
std::vector<std::string> in_input;
std::vector<std::string> out_repeated;
std::vector<std::string> _aidl_return;
@@ -444,7 +456,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 21 /*ReverseByteEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/): {
std::vector<::aidl::android::aidl::tests::ByteEnum> in_input;
std::vector<::aidl::android::aidl::tests::ByteEnum> out_repeated;
std::vector<::aidl::android::aidl::tests::ByteEnum> _aidl_return;
@@ -469,7 +481,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 22 /*ReverseIntEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/): {
std::vector<::aidl::android::aidl::tests::IntEnum> in_input;
std::vector<::aidl::android::aidl::tests::IntEnum> out_repeated;
std::vector<::aidl::android::aidl::tests::IntEnum> _aidl_return;
@@ -494,7 +506,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 23 /*ReverseLongEnum*/): {
+ case (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/): {
std::vector<::aidl::android::aidl::tests::LongEnum> in_input;
std::vector<::aidl::android::aidl::tests::LongEnum> out_repeated;
std::vector<::aidl::android::aidl::tests::LongEnum> _aidl_return;
@@ -519,7 +531,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 24 /*GetOtherTestService*/): {
+ case (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/): {
std::string in_name;
std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
@@ -537,7 +549,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 25 /*VerifyName*/): {
+ case (FIRST_CALL_TRANSACTION + 26 /*VerifyName*/): {
std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> in_service;
std::string in_name;
bool _aidl_return;
@@ -559,7 +571,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 26 /*ReverseStringList*/): {
+ case (FIRST_CALL_TRANSACTION + 27 /*ReverseStringList*/): {
std::vector<std::string> in_input;
std::vector<std::string> out_repeated;
std::vector<std::string> _aidl_return;
@@ -581,7 +593,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 27 /*RepeatParcelFileDescriptor*/): {
+ case (FIRST_CALL_TRANSACTION + 28 /*RepeatParcelFileDescriptor*/): {
::ndk::ScopedFileDescriptor in_read;
::ndk::ScopedFileDescriptor _aidl_return;
@@ -599,7 +611,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 28 /*ReverseParcelFileDescriptorArray*/): {
+ case (FIRST_CALL_TRANSACTION + 29 /*ReverseParcelFileDescriptorArray*/): {
std::vector<::ndk::ScopedFileDescriptor> in_input;
std::vector<::ndk::ScopedFileDescriptor> out_repeated;
std::vector<::ndk::ScopedFileDescriptor> _aidl_return;
@@ -624,7 +636,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 29 /*ThrowServiceException*/): {
+ case (FIRST_CALL_TRANSACTION + 30 /*ThrowServiceException*/): {
int32_t in_code;
_aidl_ret_status = AParcel_readInt32(_aidl_in, &in_code);
@@ -638,7 +650,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 30 /*RepeatNullableIntArray*/): {
+ case (FIRST_CALL_TRANSACTION + 31 /*RepeatNullableIntArray*/): {
std::optional<std::vector<int32_t>> in_input;
std::optional<std::vector<int32_t>> _aidl_return;
@@ -656,7 +668,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 31 /*RepeatNullableByteEnumArray*/): {
+ case (FIRST_CALL_TRANSACTION + 32 /*RepeatNullableByteEnumArray*/): {
std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> in_input;
std::optional<std::vector<::aidl::android::aidl::tests::ByteEnum>> _aidl_return;
@@ -674,7 +686,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 32 /*RepeatNullableIntEnumArray*/): {
+ case (FIRST_CALL_TRANSACTION + 33 /*RepeatNullableIntEnumArray*/): {
std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> in_input;
std::optional<std::vector<::aidl::android::aidl::tests::IntEnum>> _aidl_return;
@@ -692,7 +704,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 33 /*RepeatNullableLongEnumArray*/): {
+ case (FIRST_CALL_TRANSACTION + 34 /*RepeatNullableLongEnumArray*/): {
std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> in_input;
std::optional<std::vector<::aidl::android::aidl::tests::LongEnum>> _aidl_return;
@@ -710,7 +722,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 34 /*RepeatNullableString*/): {
+ case (FIRST_CALL_TRANSACTION + 35 /*RepeatNullableString*/): {
std::optional<std::string> in_input;
std::optional<std::string> _aidl_return;
@@ -728,7 +740,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 35 /*RepeatNullableStringList*/): {
+ case (FIRST_CALL_TRANSACTION + 36 /*RepeatNullableStringList*/): {
std::vector<std::string> in_input;
std::vector<std::string> _aidl_return;
@@ -746,7 +758,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 36 /*RepeatNullableParcelable*/): {
+ case (FIRST_CALL_TRANSACTION + 37 /*RepeatNullableParcelable*/): {
std::optional<::aidl::android::aidl::tests::StructuredParcelable> in_input;
std::optional<::aidl::android::aidl::tests::StructuredParcelable> _aidl_return;
@@ -764,7 +776,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 37 /*TakesAnIBinder*/): {
+ case (FIRST_CALL_TRANSACTION + 38 /*TakesAnIBinder*/): {
::ndk::SpAIBinder in_input;
_aidl_ret_status = ::ndk::AParcel_readRequiredStrongBinder(_aidl_in, &in_input);
@@ -778,7 +790,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 38 /*TakesANullableIBinder*/): {
+ case (FIRST_CALL_TRANSACTION + 39 /*TakesANullableIBinder*/): {
::ndk::SpAIBinder in_input;
_aidl_ret_status = ::ndk::AParcel_readNullableStrongBinder(_aidl_in, &in_input);
@@ -792,7 +804,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 39 /*RepeatUtf8CppString*/): {
+ case (FIRST_CALL_TRANSACTION + 40 /*RepeatUtf8CppString*/): {
std::string in_token;
std::string _aidl_return;
@@ -810,7 +822,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableUtf8CppString*/): {
+ case (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableUtf8CppString*/): {
std::optional<std::string> in_token;
std::optional<std::string> _aidl_return;
@@ -828,7 +840,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 41 /*ReverseUtf8CppString*/): {
+ case (FIRST_CALL_TRANSACTION + 42 /*ReverseUtf8CppString*/): {
std::vector<std::string> in_input;
std::vector<std::string> out_repeated;
std::vector<std::string> _aidl_return;
@@ -853,7 +865,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 42 /*ReverseNullableUtf8CppString*/): {
+ case (FIRST_CALL_TRANSACTION + 43 /*ReverseNullableUtf8CppString*/): {
std::optional<std::vector<std::optional<std::string>>> in_input;
std::optional<std::vector<std::optional<std::string>>> out_repeated;
std::optional<std::vector<std::optional<std::string>>> _aidl_return;
@@ -878,7 +890,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 43 /*ReverseUtf8CppStringList*/): {
+ case (FIRST_CALL_TRANSACTION + 44 /*ReverseUtf8CppStringList*/): {
std::vector<std::string> in_input;
std::vector<std::string> out_repeated;
std::vector<std::string> _aidl_return;
@@ -900,7 +912,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 44 /*GetCallback*/): {
+ case (FIRST_CALL_TRANSACTION + 45 /*GetCallback*/): {
bool in_return_null;
std::shared_ptr<::aidl::android::aidl::tests::INamedCallback> _aidl_return;
@@ -918,7 +930,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 45 /*FillOutStructuredParcelable*/): {
+ case (FIRST_CALL_TRANSACTION + 46 /*FillOutStructuredParcelable*/): {
::aidl::android::aidl::tests::StructuredParcelable in_parcel;
_aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_parcel);
@@ -935,7 +947,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 46 /*GetOldNameInterface*/): {
+ case (FIRST_CALL_TRANSACTION + 47 /*GetOldNameInterface*/): {
std::shared_ptr<::aidl::android::aidl::tests::IOldName> _aidl_return;
::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetOldNameInterface(&_aidl_return);
@@ -949,7 +961,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 47 /*GetNewNameInterface*/): {
+ case (FIRST_CALL_TRANSACTION + 48 /*GetNewNameInterface*/): {
std::shared_ptr<::aidl::android::aidl::tests::INewName> _aidl_return;
::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetNewNameInterface(&_aidl_return);
@@ -963,7 +975,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 48 /*GetCppJavaTests*/): {
+ case (FIRST_CALL_TRANSACTION + 49 /*GetCppJavaTests*/): {
::ndk::SpAIBinder _aidl_return;
::ndk::ScopedAStatus _aidl_status = _aidl_impl->GetCppJavaTests(&_aidl_return);
@@ -977,7 +989,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
break;
}
- case (FIRST_CALL_TRANSACTION + 49 /*getBackendType*/): {
+ case (FIRST_CALL_TRANSACTION + 50 /*getBackendType*/): {
::aidl::android::aidl::tests::BackendType _aidl_return;
::ndk::ScopedAStatus _aidl_status = _aidl_impl->getBackendType(&_aidl_return);
@@ -997,6 +1009,7 @@ static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code
static AIBinder_Class* _g_aidl_clazz = ::ndk::ICInterface::defineClass(ITestService::descriptor, _aidl_onTransact);
+#pragma clang diagnostic pop
BpTestService::BpTestService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {}
BpTestService::~BpTestService() {}
@@ -1041,6 +1054,41 @@ BpTestService::~BpTestService() {}
_aidl_status_return:
return _aidl_status;
}
+::ndk::ScopedAStatus BpTestService::Deprecated() {
+ binder_status_t _aidl_ret_status = STATUS_OK;
+ ::ndk::ScopedAStatus _aidl_status;
+ ::ndk::ScopedAParcel _aidl_in;
+ ::ndk::ScopedAParcel _aidl_out;
+
+ _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR());
+ AParcel_markSensitive(_aidl_in.get());
+ if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+ _aidl_ret_status = AIBinder_transact(
+ asBinder().get(),
+ (FIRST_CALL_TRANSACTION + 1 /*Deprecated*/),
+ _aidl_in.getR(),
+ _aidl_out.getR(),
+ FLAG_CLEAR_BUF
+ #ifdef BINDER_STABILITY_SUPPORT
+ | FLAG_PRIVATE_LOCAL
+ #endif // BINDER_STABILITY_SUPPORT
+ );
+ if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && ITestService::getDefaultImpl()) {
+ _aidl_status = ITestService::getDefaultImpl()->Deprecated();
+ goto _aidl_status_return;
+ }
+ if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+ _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR());
+ if (_aidl_ret_status != STATUS_OK) goto _aidl_error;
+
+ if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return;
+ _aidl_error:
+ _aidl_status.set(AStatus_fromStatus(_aidl_ret_status));
+ _aidl_status_return:
+ return _aidl_status;
+}
::ndk::ScopedAStatus BpTestService::TestOneway() {
binder_status_t _aidl_ret_status = STATUS_OK;
::ndk::ScopedAStatus _aidl_status;
@@ -1053,7 +1101,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 1 /*TestOneway*/),
+ (FIRST_CALL_TRANSACTION + 2 /*TestOneway*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_ONEWAY | FLAG_CLEAR_BUF
@@ -1087,7 +1135,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 2 /*RepeatBoolean*/),
+ (FIRST_CALL_TRANSACTION + 3 /*RepeatBoolean*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1128,7 +1176,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 3 /*RepeatByte*/),
+ (FIRST_CALL_TRANSACTION + 4 /*RepeatByte*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1169,7 +1217,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 4 /*RepeatChar*/),
+ (FIRST_CALL_TRANSACTION + 5 /*RepeatChar*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1210,7 +1258,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 5 /*RepeatInt*/),
+ (FIRST_CALL_TRANSACTION + 6 /*RepeatInt*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1251,7 +1299,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 6 /*RepeatLong*/),
+ (FIRST_CALL_TRANSACTION + 7 /*RepeatLong*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1292,7 +1340,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 7 /*RepeatFloat*/),
+ (FIRST_CALL_TRANSACTION + 8 /*RepeatFloat*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1333,7 +1381,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 8 /*RepeatDouble*/),
+ (FIRST_CALL_TRANSACTION + 9 /*RepeatDouble*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1374,7 +1422,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 9 /*RepeatString*/),
+ (FIRST_CALL_TRANSACTION + 10 /*RepeatString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1415,7 +1463,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 10 /*RepeatByteEnum*/),
+ (FIRST_CALL_TRANSACTION + 11 /*RepeatByteEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1456,7 +1504,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 11 /*RepeatIntEnum*/),
+ (FIRST_CALL_TRANSACTION + 12 /*RepeatIntEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1497,7 +1545,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 12 /*RepeatLongEnum*/),
+ (FIRST_CALL_TRANSACTION + 13 /*RepeatLongEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1541,7 +1589,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 13 /*ReverseBoolean*/),
+ (FIRST_CALL_TRANSACTION + 14 /*ReverseBoolean*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1588,7 +1636,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 14 /*ReverseByte*/),
+ (FIRST_CALL_TRANSACTION + 15 /*ReverseByte*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1635,7 +1683,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 15 /*ReverseChar*/),
+ (FIRST_CALL_TRANSACTION + 16 /*ReverseChar*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1682,7 +1730,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 16 /*ReverseInt*/),
+ (FIRST_CALL_TRANSACTION + 17 /*ReverseInt*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1729,7 +1777,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 17 /*ReverseLong*/),
+ (FIRST_CALL_TRANSACTION + 18 /*ReverseLong*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1776,7 +1824,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 18 /*ReverseFloat*/),
+ (FIRST_CALL_TRANSACTION + 19 /*ReverseFloat*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1823,7 +1871,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 19 /*ReverseDouble*/),
+ (FIRST_CALL_TRANSACTION + 20 /*ReverseDouble*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1870,7 +1918,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 20 /*ReverseString*/),
+ (FIRST_CALL_TRANSACTION + 21 /*ReverseString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1917,7 +1965,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 21 /*ReverseByteEnum*/),
+ (FIRST_CALL_TRANSACTION + 22 /*ReverseByteEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -1964,7 +2012,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 22 /*ReverseIntEnum*/),
+ (FIRST_CALL_TRANSACTION + 23 /*ReverseIntEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2011,7 +2059,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 23 /*ReverseLongEnum*/),
+ (FIRST_CALL_TRANSACTION + 24 /*ReverseLongEnum*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2055,7 +2103,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 24 /*GetOtherTestService*/),
+ (FIRST_CALL_TRANSACTION + 25 /*GetOtherTestService*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2099,7 +2147,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 25 /*VerifyName*/),
+ (FIRST_CALL_TRANSACTION + 26 /*VerifyName*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2140,7 +2188,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 26 /*ReverseStringList*/),
+ (FIRST_CALL_TRANSACTION + 27 /*ReverseStringList*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2184,7 +2232,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 27 /*RepeatParcelFileDescriptor*/),
+ (FIRST_CALL_TRANSACTION + 28 /*RepeatParcelFileDescriptor*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2228,7 +2276,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 28 /*ReverseParcelFileDescriptorArray*/),
+ (FIRST_CALL_TRANSACTION + 29 /*ReverseParcelFileDescriptorArray*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2272,7 +2320,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 29 /*ThrowServiceException*/),
+ (FIRST_CALL_TRANSACTION + 30 /*ThrowServiceException*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2310,7 +2358,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 30 /*RepeatNullableIntArray*/),
+ (FIRST_CALL_TRANSACTION + 31 /*RepeatNullableIntArray*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2351,7 +2399,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 31 /*RepeatNullableByteEnumArray*/),
+ (FIRST_CALL_TRANSACTION + 32 /*RepeatNullableByteEnumArray*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2392,7 +2440,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 32 /*RepeatNullableIntEnumArray*/),
+ (FIRST_CALL_TRANSACTION + 33 /*RepeatNullableIntEnumArray*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2433,7 +2481,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 33 /*RepeatNullableLongEnumArray*/),
+ (FIRST_CALL_TRANSACTION + 34 /*RepeatNullableLongEnumArray*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2474,7 +2522,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 34 /*RepeatNullableString*/),
+ (FIRST_CALL_TRANSACTION + 35 /*RepeatNullableString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2515,7 +2563,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 35 /*RepeatNullableStringList*/),
+ (FIRST_CALL_TRANSACTION + 36 /*RepeatNullableStringList*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2556,7 +2604,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 36 /*RepeatNullableParcelable*/),
+ (FIRST_CALL_TRANSACTION + 37 /*RepeatNullableParcelable*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2597,7 +2645,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 37 /*TakesAnIBinder*/),
+ (FIRST_CALL_TRANSACTION + 38 /*TakesAnIBinder*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2635,7 +2683,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 38 /*TakesANullableIBinder*/),
+ (FIRST_CALL_TRANSACTION + 39 /*TakesANullableIBinder*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2673,7 +2721,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 39 /*RepeatUtf8CppString*/),
+ (FIRST_CALL_TRANSACTION + 40 /*RepeatUtf8CppString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2714,7 +2762,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 40 /*RepeatNullableUtf8CppString*/),
+ (FIRST_CALL_TRANSACTION + 41 /*RepeatNullableUtf8CppString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2758,7 +2806,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 41 /*ReverseUtf8CppString*/),
+ (FIRST_CALL_TRANSACTION + 42 /*ReverseUtf8CppString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2805,7 +2853,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 42 /*ReverseNullableUtf8CppString*/),
+ (FIRST_CALL_TRANSACTION + 43 /*ReverseNullableUtf8CppString*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2849,7 +2897,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 43 /*ReverseUtf8CppStringList*/),
+ (FIRST_CALL_TRANSACTION + 44 /*ReverseUtf8CppStringList*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2893,7 +2941,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 44 /*GetCallback*/),
+ (FIRST_CALL_TRANSACTION + 45 /*GetCallback*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2934,7 +2982,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 45 /*FillOutStructuredParcelable*/),
+ (FIRST_CALL_TRANSACTION + 46 /*FillOutStructuredParcelable*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -2972,7 +3020,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 46 /*GetOldNameInterface*/),
+ (FIRST_CALL_TRANSACTION + 47 /*GetOldNameInterface*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -3010,7 +3058,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 47 /*GetNewNameInterface*/),
+ (FIRST_CALL_TRANSACTION + 48 /*GetNewNameInterface*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -3048,7 +3096,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 48 /*GetCppJavaTests*/),
+ (FIRST_CALL_TRANSACTION + 49 /*GetCppJavaTests*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -3086,7 +3134,7 @@ BpTestService::~BpTestService() {}
_aidl_ret_status = AIBinder_transact(
asBinder().get(),
- (FIRST_CALL_TRANSACTION + 49 /*getBackendType*/),
+ (FIRST_CALL_TRANSACTION + 50 /*getBackendType*/),
_aidl_in.getR(),
_aidl_out.getR(),
FLAG_CLEAR_BUF
@@ -3170,6 +3218,11 @@ std::shared_ptr<ITestService> ITestService::default_impl = nullptr;
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
return _aidl_status;
}
+::ndk::ScopedAStatus ITestServiceDefault::Deprecated() {
+ ::ndk::ScopedAStatus _aidl_status;
+ _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
+ return _aidl_status;
+}
::ndk::ScopedAStatus ITestServiceDefault::TestOneway() {
::ndk::ScopedAStatus _aidl_status;
_aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION));
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
new file mode 100644
index 00000000..0b6f0423
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecated.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BnDeprecated : public ::ndk::BnCInterface<IDeprecated> {
+public:
+ BnDeprecated();
+ virtual ~BnDeprecated();
+protected:
+ ::ndk::SpAIBinder createBinder() override;
+private:
+};
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
new file mode 100644
index 00000000..e85bbc8e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedEnum.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) enums do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
new file mode 100644
index 00000000..42911089
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BnDeprecatedParcelable.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) defined_types do not have bn classes
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
new file mode 100644
index 00000000..ee9626d5
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecated.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "aidl/android/aidl/tests/IDeprecated.h"
+
+#include <android/binder_ibinder.h>
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) BpDeprecated : public ::ndk::BpCInterface<IDeprecated> {
+public:
+ explicit BpDeprecated(const ::ndk::SpAIBinder& binder);
+ virtual ~BpDeprecated();
+
+};
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
new file mode 100644
index 00000000..74a2c6d0
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedEnum.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) enums do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
new file mode 100644
index 00000000..e8a0db3b
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpDeprecatedParcelable.h
@@ -0,0 +1 @@
+#error TODO(b/111362593) defined_types do not have bp classes
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpTestService.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpTestService.h
index 44d9c733..30b0fa0e 100644
--- a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpTestService.h
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/BpTestService.h
@@ -14,6 +14,7 @@ public:
virtual ~BpTestService();
::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+ ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
::ndk::ScopedAStatus TestOneway() override;
::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
new file mode 100644
index 00000000..052e5db7
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedEnum.h
@@ -0,0 +1,52 @@
+#pragma once
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif // BINDER_STABILITY_SUPPORT
+#include <array>
+#include <android/binder_enums.h>
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+enum class __attribute__((deprecated("test"))) DeprecatedEnum : int32_t {
+ A = 0,
+ B = 1,
+ C = 2,
+};
+
+static inline std::string toString(DeprecatedEnum val) __attribute__((deprecated("test")));
+static inline std::string toString(DeprecatedEnum val) {
+ switch(val) {
+ case DeprecatedEnum::A:
+ return "A";
+ case DeprecatedEnum::B:
+ return "B";
+ case DeprecatedEnum::C:
+ return "C";
+ default:
+ return std::to_string(static_cast<int32_t>(val));
+ }
+}
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
+namespace ndk {
+namespace internal {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wc++17-extensions"
+template <>
+constexpr inline std::array<aidl::android::aidl::tests::DeprecatedEnum, 3> __attribute__((deprecated("test"))) enum_values<aidl::android::aidl::tests::DeprecatedEnum> = {
+ aidl::android::aidl::tests::DeprecatedEnum::A,
+ aidl::android::aidl::tests::DeprecatedEnum::B,
+ aidl::android::aidl::tests::DeprecatedEnum::C,
+};
+#pragma clang diagnostic pop
+} // namespace internal
+} // namespace android
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
new file mode 100644
index 00000000..52719bca
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/DeprecatedParcelable.h
@@ -0,0 +1,56 @@
+#pragma once
+#include <android/binder_interface_utils.h>
+#include <android/binder_parcelable_utils.h>
+#include <android/binder_to_string.h>
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif // BINDER_STABILITY_SUPPORT
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) DeprecatedParcelable {
+public:
+ typedef std::false_type fixed_size;
+ static const char* descriptor;
+
+
+ binder_status_t readFromParcel(const AParcel* parcel);
+ binder_status_t writeToParcel(AParcel* parcel) const;
+
+ inline bool operator!=(const DeprecatedParcelable&) const {
+ return std::tie() != std::tie();
+ }
+ inline bool operator<(const DeprecatedParcelable&) const {
+ return std::tie() < std::tie();
+ }
+ inline bool operator<=(const DeprecatedParcelable&) const {
+ return std::tie() <= std::tie();
+ }
+ inline bool operator==(const DeprecatedParcelable&) const {
+ return std::tie() == std::tie();
+ }
+ inline bool operator>(const DeprecatedParcelable&) const {
+ return std::tie() > std::tie();
+ }
+ inline bool operator>=(const DeprecatedParcelable&) const {
+ return std::tie() >= std::tie();
+ }
+
+ static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_LOCAL;
+ inline std::string toString() const {
+ std::ostringstream os;
+ os << "DeprecatedParcelable{";
+ os << "}";
+ return os.str();
+ }
+};
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/IDeprecated.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
new file mode 100644
index 00000000..80d5589f
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/IDeprecated.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <android/binder_interface_utils.h>
+
+#include <cstdint>
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+#ifdef BINDER_STABILITY_SUPPORT
+#include <android/binder_stability.h>
+#endif // BINDER_STABILITY_SUPPORT
+
+namespace aidl {
+namespace android {
+namespace aidl {
+namespace tests {
+class __attribute__((deprecated("test"))) IDeprecated : public ::ndk::ICInterface {
+public:
+ static const char* descriptor;
+ IDeprecated();
+ virtual ~IDeprecated();
+
+
+ static std::shared_ptr<IDeprecated> fromBinder(const ::ndk::SpAIBinder& binder);
+ static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<IDeprecated>& instance);
+ static binder_status_t readFromParcel(const AParcel* parcel, std::shared_ptr<IDeprecated>* instance);
+ static bool setDefaultImpl(const std::shared_ptr<IDeprecated>& impl);
+ static const std::shared_ptr<IDeprecated>& getDefaultImpl();
+private:
+ static std::shared_ptr<IDeprecated> default_impl;
+};
+class __attribute__((deprecated("test"))) IDeprecatedDefault : public IDeprecated {
+public:
+ ::ndk::SpAIBinder asBinder() override;
+ bool isRemote() override;
+};
+} // namespace tests
+} // namespace aidl
+} // namespace android
+} // namespace aidl
diff --git a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/ITestService.h b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/ITestService.h
index fb413d81..62f8132e 100644
--- a/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/ITestService.h
+++ b/tests/golden_output/aidl-test-interface-ndk_platform-source/gen/include/aidl/android/aidl/tests/ITestService.h
@@ -106,55 +106,56 @@ public:
enum : int32_t { A56 = 1 };
enum : int32_t { A57 = 1 };
static constexpr uint32_t TRANSACTION_UnimplementedMethod = FIRST_CALL_TRANSACTION + 0;
- static constexpr uint32_t TRANSACTION_TestOneway = FIRST_CALL_TRANSACTION + 1;
- static constexpr uint32_t TRANSACTION_RepeatBoolean = FIRST_CALL_TRANSACTION + 2;
- static constexpr uint32_t TRANSACTION_RepeatByte = FIRST_CALL_TRANSACTION + 3;
- static constexpr uint32_t TRANSACTION_RepeatChar = FIRST_CALL_TRANSACTION + 4;
- static constexpr uint32_t TRANSACTION_RepeatInt = FIRST_CALL_TRANSACTION + 5;
- static constexpr uint32_t TRANSACTION_RepeatLong = FIRST_CALL_TRANSACTION + 6;
- static constexpr uint32_t TRANSACTION_RepeatFloat = FIRST_CALL_TRANSACTION + 7;
- static constexpr uint32_t TRANSACTION_RepeatDouble = FIRST_CALL_TRANSACTION + 8;
- static constexpr uint32_t TRANSACTION_RepeatString = FIRST_CALL_TRANSACTION + 9;
- static constexpr uint32_t TRANSACTION_RepeatByteEnum = FIRST_CALL_TRANSACTION + 10;
- static constexpr uint32_t TRANSACTION_RepeatIntEnum = FIRST_CALL_TRANSACTION + 11;
- static constexpr uint32_t TRANSACTION_RepeatLongEnum = FIRST_CALL_TRANSACTION + 12;
- static constexpr uint32_t TRANSACTION_ReverseBoolean = FIRST_CALL_TRANSACTION + 13;
- static constexpr uint32_t TRANSACTION_ReverseByte = FIRST_CALL_TRANSACTION + 14;
- static constexpr uint32_t TRANSACTION_ReverseChar = FIRST_CALL_TRANSACTION + 15;
- static constexpr uint32_t TRANSACTION_ReverseInt = FIRST_CALL_TRANSACTION + 16;
- static constexpr uint32_t TRANSACTION_ReverseLong = FIRST_CALL_TRANSACTION + 17;
- static constexpr uint32_t TRANSACTION_ReverseFloat = FIRST_CALL_TRANSACTION + 18;
- static constexpr uint32_t TRANSACTION_ReverseDouble = FIRST_CALL_TRANSACTION + 19;
- static constexpr uint32_t TRANSACTION_ReverseString = FIRST_CALL_TRANSACTION + 20;
- static constexpr uint32_t TRANSACTION_ReverseByteEnum = FIRST_CALL_TRANSACTION + 21;
- static constexpr uint32_t TRANSACTION_ReverseIntEnum = FIRST_CALL_TRANSACTION + 22;
- static constexpr uint32_t TRANSACTION_ReverseLongEnum = FIRST_CALL_TRANSACTION + 23;
- static constexpr uint32_t TRANSACTION_GetOtherTestService = FIRST_CALL_TRANSACTION + 24;
- static constexpr uint32_t TRANSACTION_VerifyName = FIRST_CALL_TRANSACTION + 25;
- static constexpr uint32_t TRANSACTION_ReverseStringList = FIRST_CALL_TRANSACTION + 26;
- static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = FIRST_CALL_TRANSACTION + 27;
- static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = FIRST_CALL_TRANSACTION + 28;
- static constexpr uint32_t TRANSACTION_ThrowServiceException = FIRST_CALL_TRANSACTION + 29;
- static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = FIRST_CALL_TRANSACTION + 30;
- static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = FIRST_CALL_TRANSACTION + 31;
- static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = FIRST_CALL_TRANSACTION + 32;
- static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = FIRST_CALL_TRANSACTION + 33;
- static constexpr uint32_t TRANSACTION_RepeatNullableString = FIRST_CALL_TRANSACTION + 34;
- static constexpr uint32_t TRANSACTION_RepeatNullableStringList = FIRST_CALL_TRANSACTION + 35;
- static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = FIRST_CALL_TRANSACTION + 36;
- static constexpr uint32_t TRANSACTION_TakesAnIBinder = FIRST_CALL_TRANSACTION + 37;
- static constexpr uint32_t TRANSACTION_TakesANullableIBinder = FIRST_CALL_TRANSACTION + 38;
- static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = FIRST_CALL_TRANSACTION + 39;
- static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = FIRST_CALL_TRANSACTION + 40;
- static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = FIRST_CALL_TRANSACTION + 41;
- static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = FIRST_CALL_TRANSACTION + 42;
- static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = FIRST_CALL_TRANSACTION + 43;
- static constexpr uint32_t TRANSACTION_GetCallback = FIRST_CALL_TRANSACTION + 44;
- static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = FIRST_CALL_TRANSACTION + 45;
- static constexpr uint32_t TRANSACTION_GetOldNameInterface = FIRST_CALL_TRANSACTION + 46;
- static constexpr uint32_t TRANSACTION_GetNewNameInterface = FIRST_CALL_TRANSACTION + 47;
- static constexpr uint32_t TRANSACTION_GetCppJavaTests = FIRST_CALL_TRANSACTION + 48;
- static constexpr uint32_t TRANSACTION_getBackendType = FIRST_CALL_TRANSACTION + 49;
+ static constexpr uint32_t TRANSACTION_Deprecated = FIRST_CALL_TRANSACTION + 1;
+ static constexpr uint32_t TRANSACTION_TestOneway = FIRST_CALL_TRANSACTION + 2;
+ static constexpr uint32_t TRANSACTION_RepeatBoolean = FIRST_CALL_TRANSACTION + 3;
+ static constexpr uint32_t TRANSACTION_RepeatByte = FIRST_CALL_TRANSACTION + 4;
+ static constexpr uint32_t TRANSACTION_RepeatChar = FIRST_CALL_TRANSACTION + 5;
+ static constexpr uint32_t TRANSACTION_RepeatInt = FIRST_CALL_TRANSACTION + 6;
+ static constexpr uint32_t TRANSACTION_RepeatLong = FIRST_CALL_TRANSACTION + 7;
+ static constexpr uint32_t TRANSACTION_RepeatFloat = FIRST_CALL_TRANSACTION + 8;
+ static constexpr uint32_t TRANSACTION_RepeatDouble = FIRST_CALL_TRANSACTION + 9;
+ static constexpr uint32_t TRANSACTION_RepeatString = FIRST_CALL_TRANSACTION + 10;
+ static constexpr uint32_t TRANSACTION_RepeatByteEnum = FIRST_CALL_TRANSACTION + 11;
+ static constexpr uint32_t TRANSACTION_RepeatIntEnum = FIRST_CALL_TRANSACTION + 12;
+ static constexpr uint32_t TRANSACTION_RepeatLongEnum = FIRST_CALL_TRANSACTION + 13;
+ static constexpr uint32_t TRANSACTION_ReverseBoolean = FIRST_CALL_TRANSACTION + 14;
+ static constexpr uint32_t TRANSACTION_ReverseByte = FIRST_CALL_TRANSACTION + 15;
+ static constexpr uint32_t TRANSACTION_ReverseChar = FIRST_CALL_TRANSACTION + 16;
+ static constexpr uint32_t TRANSACTION_ReverseInt = FIRST_CALL_TRANSACTION + 17;
+ static constexpr uint32_t TRANSACTION_ReverseLong = FIRST_CALL_TRANSACTION + 18;
+ static constexpr uint32_t TRANSACTION_ReverseFloat = FIRST_CALL_TRANSACTION + 19;
+ static constexpr uint32_t TRANSACTION_ReverseDouble = FIRST_CALL_TRANSACTION + 20;
+ static constexpr uint32_t TRANSACTION_ReverseString = FIRST_CALL_TRANSACTION + 21;
+ static constexpr uint32_t TRANSACTION_ReverseByteEnum = FIRST_CALL_TRANSACTION + 22;
+ static constexpr uint32_t TRANSACTION_ReverseIntEnum = FIRST_CALL_TRANSACTION + 23;
+ static constexpr uint32_t TRANSACTION_ReverseLongEnum = FIRST_CALL_TRANSACTION + 24;
+ static constexpr uint32_t TRANSACTION_GetOtherTestService = FIRST_CALL_TRANSACTION + 25;
+ static constexpr uint32_t TRANSACTION_VerifyName = FIRST_CALL_TRANSACTION + 26;
+ static constexpr uint32_t TRANSACTION_ReverseStringList = FIRST_CALL_TRANSACTION + 27;
+ static constexpr uint32_t TRANSACTION_RepeatParcelFileDescriptor = FIRST_CALL_TRANSACTION + 28;
+ static constexpr uint32_t TRANSACTION_ReverseParcelFileDescriptorArray = FIRST_CALL_TRANSACTION + 29;
+ static constexpr uint32_t TRANSACTION_ThrowServiceException = FIRST_CALL_TRANSACTION + 30;
+ static constexpr uint32_t TRANSACTION_RepeatNullableIntArray = FIRST_CALL_TRANSACTION + 31;
+ static constexpr uint32_t TRANSACTION_RepeatNullableByteEnumArray = FIRST_CALL_TRANSACTION + 32;
+ static constexpr uint32_t TRANSACTION_RepeatNullableIntEnumArray = FIRST_CALL_TRANSACTION + 33;
+ static constexpr uint32_t TRANSACTION_RepeatNullableLongEnumArray = FIRST_CALL_TRANSACTION + 34;
+ static constexpr uint32_t TRANSACTION_RepeatNullableString = FIRST_CALL_TRANSACTION + 35;
+ static constexpr uint32_t TRANSACTION_RepeatNullableStringList = FIRST_CALL_TRANSACTION + 36;
+ static constexpr uint32_t TRANSACTION_RepeatNullableParcelable = FIRST_CALL_TRANSACTION + 37;
+ static constexpr uint32_t TRANSACTION_TakesAnIBinder = FIRST_CALL_TRANSACTION + 38;
+ static constexpr uint32_t TRANSACTION_TakesANullableIBinder = FIRST_CALL_TRANSACTION + 39;
+ static constexpr uint32_t TRANSACTION_RepeatUtf8CppString = FIRST_CALL_TRANSACTION + 40;
+ static constexpr uint32_t TRANSACTION_RepeatNullableUtf8CppString = FIRST_CALL_TRANSACTION + 41;
+ static constexpr uint32_t TRANSACTION_ReverseUtf8CppString = FIRST_CALL_TRANSACTION + 42;
+ static constexpr uint32_t TRANSACTION_ReverseNullableUtf8CppString = FIRST_CALL_TRANSACTION + 43;
+ static constexpr uint32_t TRANSACTION_ReverseUtf8CppStringList = FIRST_CALL_TRANSACTION + 44;
+ static constexpr uint32_t TRANSACTION_GetCallback = FIRST_CALL_TRANSACTION + 45;
+ static constexpr uint32_t TRANSACTION_FillOutStructuredParcelable = FIRST_CALL_TRANSACTION + 46;
+ static constexpr uint32_t TRANSACTION_GetOldNameInterface = FIRST_CALL_TRANSACTION + 47;
+ static constexpr uint32_t TRANSACTION_GetNewNameInterface = FIRST_CALL_TRANSACTION + 48;
+ static constexpr uint32_t TRANSACTION_GetCppJavaTests = FIRST_CALL_TRANSACTION + 49;
+ static constexpr uint32_t TRANSACTION_getBackendType = FIRST_CALL_TRANSACTION + 50;
static std::shared_ptr<ITestService> fromBinder(const ::ndk::SpAIBinder& binder);
static binder_status_t writeToParcel(AParcel* parcel, const std::shared_ptr<ITestService>& instance);
@@ -162,6 +163,7 @@ public:
static bool setDefaultImpl(const std::shared_ptr<ITestService>& impl);
static const std::shared_ptr<ITestService>& getDefaultImpl();
virtual ::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) = 0;
+ virtual ::ndk::ScopedAStatus Deprecated() __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"))) = 0;
virtual ::ndk::ScopedAStatus TestOneway() = 0;
virtual ::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) = 0;
virtual ::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) = 0;
@@ -217,6 +219,7 @@ private:
class ITestServiceDefault : public ITestService {
public:
::ndk::ScopedAStatus UnimplementedMethod(int32_t in_arg, int32_t* _aidl_return) override;
+ ::ndk::ScopedAStatus Deprecated() override __attribute__((deprecated("to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens")));
::ndk::ScopedAStatus TestOneway() override;
::ndk::ScopedAStatus RepeatBoolean(bool in_token, bool* _aidl_return) override;
::ndk::ScopedAStatus RepeatByte(int8_t in_token, int8_t* _aidl_return) override;
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
new file mode 100644
index 00000000..0d45d7da
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs
@@ -0,0 +1,8 @@
+#![allow(non_upper_case_globals)]
+use binder::declare_binder_enum;
+declare_binder_enum! { DeprecatedEnum : i32 {
+ A = 0,
+ B = 1,
+ C = 2,
+} }
+pub(crate) mod mangled { pub use super::DeprecatedEnum as _7_android_4_aidl_5_tests_14_DeprecatedEnum; }
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
new file mode 100644
index 00000000..388f093e
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedEnum.rs : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedEnum.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
new file mode 100644
index 00000000..18ba875d
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs
@@ -0,0 +1,55 @@
+#[derive(Debug)]
+#[deprecated = "test"]
+pub struct DeprecatedParcelable {
+}
+pub(crate) mod mangled { pub use super::DeprecatedParcelable as _7_android_4_aidl_5_tests_20_DeprecatedParcelable; }
+impl Default for DeprecatedParcelable {
+ fn default() -> Self {
+ Self {
+ }
+ }
+}
+impl binder::parcel::Serialize for DeprecatedParcelable {
+ fn serialize(&self, parcel: &mut binder::parcel::Parcel) -> binder::Result<()> {
+ <Self as binder::parcel::SerializeOption>::serialize_option(Some(self), parcel)
+ }
+}
+impl binder::parcel::SerializeArray for DeprecatedParcelable {}
+impl binder::parcel::SerializeOption for DeprecatedParcelable {
+ fn serialize_option(this: Option<&Self>, parcel: &mut binder::parcel::Parcel) -> binder::Result<()> {
+ let this = if let Some(this) = this {
+ parcel.write(&1i32)?;
+ this
+ } else {
+ return parcel.write(&0i32);
+ };
+ parcel.sized_write(|subparcel| {
+ Ok(())
+ })
+ }
+}
+impl binder::parcel::Deserialize for DeprecatedParcelable {
+ fn deserialize(parcel: &binder::parcel::Parcel) -> binder::Result<Self> {
+ <Self as binder::parcel::DeserializeOption>::deserialize_option(parcel)
+ .transpose()
+ .unwrap_or(Err(binder::StatusCode::UNEXPECTED_NULL))
+ }
+}
+impl binder::parcel::DeserializeArray for DeprecatedParcelable {}
+impl binder::parcel::DeserializeOption for DeprecatedParcelable {
+ fn deserialize_option(parcel: &binder::parcel::Parcel) -> binder::Result<Option<Self>> {
+ let status: i32 = parcel.read()?;
+ if status == 0 { return Ok(None); }
+ let start_pos = parcel.get_data_position();
+ let parcelable_size: i32 = parcel.read()?;
+ if parcelable_size < 0 { return Err(binder::StatusCode::BAD_VALUE); }
+ if start_pos.checked_add(parcelable_size).is_none() {
+ return Err(binder::StatusCode::BAD_VALUE);
+ }
+ let mut result = Self::default();
+ unsafe {
+ parcel.set_data_position(start_pos + parcelable_size)?;
+ }
+ Ok(Some(result))
+ }
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
new file mode 100644
index 00000000..a2578525
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/DeprecatedParcelable.rs : \
+ system/tools/aidl/tests/android/aidl/tests/DeprecatedParcelable.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
new file mode 100644
index 00000000..59206545
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs
@@ -0,0 +1,40 @@
+#![allow(non_upper_case_globals)]
+#![allow(non_snake_case)]
+#[allow(unused_imports)] use binder::IBinderInternal;
+use binder::declare_binder_interface;
+declare_binder_interface! {
+ IDeprecated["android.aidl.tests.IDeprecated"] {
+ native: BnDeprecated(on_transact),
+ proxy: BpDeprecated {
+ },
+ }
+}
+#[deprecated = "test"]
+pub trait IDeprecated: binder::Interface + Send {
+ fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.IDeprecated" }
+ fn getDefaultImpl() -> IDeprecatedDefaultRef where Self: Sized {
+ DEFAULT_IMPL.lock().unwrap().clone()
+ }
+ fn setDefaultImpl(d: IDeprecatedDefaultRef) -> IDeprecatedDefaultRef where Self: Sized {
+ std::mem::replace(&mut *DEFAULT_IMPL.lock().unwrap(), d)
+ }
+}
+pub trait IDeprecatedDefault: Send + Sync {
+}
+pub mod transactions {
+}
+pub type IDeprecatedDefaultRef = Option<std::sync::Arc<dyn IDeprecatedDefault>>;
+use lazy_static::lazy_static;
+lazy_static! {
+ static ref DEFAULT_IMPL: std::sync::Mutex<IDeprecatedDefaultRef> = std::sync::Mutex::new(None);
+}
+pub(crate) mod mangled { pub use super::IDeprecated as _7_android_4_aidl_5_tests_11_IDeprecated; }
+impl IDeprecated for BpDeprecated {
+}
+impl IDeprecated for binder::Binder<BnDeprecated> {
+}
+fn on_transact(_aidl_service: &dyn IDeprecated, _aidl_code: binder::TransactionCode, _aidl_data: &binder::parcel::Parcel, _aidl_reply: &mut binder::parcel::Parcel) -> binder::Result<()> {
+ match _aidl_code {
+ _ => Err(binder::StatusCode::UNKNOWN_TRANSACTION)
+ }
+}
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
new file mode 100644
index 00000000..dc966187
--- /dev/null
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs.d
@@ -0,0 +1,2 @@
+out/soong/.intermediates/system/tools/aidl/aidl-test-interface-rust-source/gen/android/aidl/tests/IDeprecated.rs : \
+ system/tools/aidl/tests/android/aidl/tests/IDeprecated.aidl
diff --git a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
index ed3e9d9a..2e34dbae 100644
--- a/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
+++ b/tests/golden_output/aidl-test-interface-rust-source/gen/android/aidl/tests/ITestService.rs
@@ -12,6 +12,8 @@ declare_binder_interface! {
pub trait ITestService: binder::Interface + Send {
fn get_descriptor() -> &'static str where Self: Sized { "android.aidl.tests.ITestService" }
fn UnimplementedMethod(&self, _arg_arg: i32) -> binder::public_api::Result<i32>;
+ #[deprecated = "to make sure we have something in system/tools/aidl which does a compile check of deprecated and make sure this is reflected in goldens"]
+ fn Deprecated(&self) -> binder::public_api::Result<()>;
fn TestOneway(&self) -> binder::public_api::Result<()>;
fn RepeatBoolean(&self, _arg_token: bool) -> binder::public_api::Result<bool>;
fn RepeatByte(&self, _arg_token: i8) -> binder::public_api::Result<i8>;
@@ -72,6 +74,9 @@ pub trait ITestServiceDefault: Send + Sync {
fn UnimplementedMethod(&self, _arg_arg: i32) -> binder::public_api::Result<i32> {
Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
}
+ fn Deprecated(&self) -> binder::public_api::Result<()> {
+ Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
+ }
fn TestOneway(&self) -> binder::public_api::Result<()> {
Err(binder::StatusCode::UNKNOWN_TRANSACTION.into())
}
@@ -222,55 +227,56 @@ pub trait ITestServiceDefault: Send + Sync {
}
pub mod transactions {
pub const UnimplementedMethod: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 0;
- pub const TestOneway: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 1;
- pub const RepeatBoolean: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 2;
- pub const RepeatByte: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 3;
- pub const RepeatChar: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 4;
- pub const RepeatInt: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 5;
- pub const RepeatLong: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 6;
- pub const RepeatFloat: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 7;
- pub const RepeatDouble: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 8;
- pub const RepeatString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 9;
- pub const RepeatByteEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 10;
- pub const RepeatIntEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 11;
- pub const RepeatLongEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 12;
- pub const ReverseBoolean: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 13;
- pub const ReverseByte: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 14;
- pub const ReverseChar: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 15;
- pub const ReverseInt: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 16;
- pub const ReverseLong: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 17;
- pub const ReverseFloat: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 18;
- pub const ReverseDouble: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 19;
- pub const ReverseString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 20;
- pub const ReverseByteEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 21;
- pub const ReverseIntEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 22;
- pub const ReverseLongEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 23;
- pub const GetOtherTestService: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 24;
- pub const VerifyName: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 25;
- pub const ReverseStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 26;
- pub const RepeatParcelFileDescriptor: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 27;
- pub const ReverseParcelFileDescriptorArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 28;
- pub const ThrowServiceException: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 29;
- pub const RepeatNullableIntArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 30;
- pub const RepeatNullableByteEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 31;
- pub const RepeatNullableIntEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 32;
- pub const RepeatNullableLongEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 33;
- pub const RepeatNullableString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 34;
- pub const RepeatNullableStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 35;
- pub const RepeatNullableParcelable: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 36;
- pub const TakesAnIBinder: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 37;
- pub const TakesANullableIBinder: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 38;
- pub const RepeatUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 39;
- pub const RepeatNullableUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 40;
- pub const ReverseUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 41;
- pub const ReverseNullableUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 42;
- pub const ReverseUtf8CppStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 43;
- pub const GetCallback: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 44;
- pub const FillOutStructuredParcelable: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 45;
- pub const GetOldNameInterface: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 46;
- pub const GetNewNameInterface: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 47;
- pub const GetCppJavaTests: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 48;
- pub const getBackendType: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 49;
+ pub const Deprecated: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 1;
+ pub const TestOneway: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 2;
+ pub const RepeatBoolean: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 3;
+ pub const RepeatByte: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 4;
+ pub const RepeatChar: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 5;
+ pub const RepeatInt: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 6;
+ pub const RepeatLong: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 7;
+ pub const RepeatFloat: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 8;
+ pub const RepeatDouble: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 9;
+ pub const RepeatString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 10;
+ pub const RepeatByteEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 11;
+ pub const RepeatIntEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 12;
+ pub const RepeatLongEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 13;
+ pub const ReverseBoolean: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 14;
+ pub const ReverseByte: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 15;
+ pub const ReverseChar: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 16;
+ pub const ReverseInt: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 17;
+ pub const ReverseLong: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 18;
+ pub const ReverseFloat: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 19;
+ pub const ReverseDouble: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 20;
+ pub const ReverseString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 21;
+ pub const ReverseByteEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 22;
+ pub const ReverseIntEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 23;
+ pub const ReverseLongEnum: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 24;
+ pub const GetOtherTestService: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 25;
+ pub const VerifyName: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 26;
+ pub const ReverseStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 27;
+ pub const RepeatParcelFileDescriptor: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 28;
+ pub const ReverseParcelFileDescriptorArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 29;
+ pub const ThrowServiceException: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 30;
+ pub const RepeatNullableIntArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 31;
+ pub const RepeatNullableByteEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 32;
+ pub const RepeatNullableIntEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 33;
+ pub const RepeatNullableLongEnumArray: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 34;
+ pub const RepeatNullableString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 35;
+ pub const RepeatNullableStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 36;
+ pub const RepeatNullableParcelable: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 37;
+ pub const TakesAnIBinder: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 38;
+ pub const TakesANullableIBinder: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 39;
+ pub const RepeatUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 40;
+ pub const RepeatNullableUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 41;
+ pub const ReverseUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 42;
+ pub const ReverseNullableUtf8CppString: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 43;
+ pub const ReverseUtf8CppStringList: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 44;
+ pub const GetCallback: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 45;
+ pub const FillOutStructuredParcelable: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 46;
+ pub const GetOldNameInterface: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 47;
+ pub const GetNewNameInterface: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 48;
+ pub const GetCppJavaTests: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 49;
+ pub const getBackendType: binder::TransactionCode = binder::FIRST_CALL_TRANSACTION + 50;
}
pub type ITestServiceDefaultRef = Option<std::sync::Arc<dyn ITestServiceDefault>>;
use lazy_static::lazy_static;
@@ -370,6 +376,21 @@ impl ITestService for BpTestService {
let _aidl_return: i32 = _aidl_reply.read()?;
Ok(_aidl_return)
}
+ fn Deprecated(&self) -> binder::public_api::Result<()> {
+ let _aidl_reply = self.binder.transact(transactions::Deprecated, binder::FLAG_CLEAR_BUF | binder::FLAG_PRIVATE_LOCAL, |_aidl_data| {
+ _aidl_data.mark_sensitive();
+ Ok(())
+ });
+ if let Err(binder::StatusCode::UNKNOWN_TRANSACTION) = _aidl_reply {
+ if let Some(_aidl_default_impl) = <Self as ITestService>::getDefaultImpl() {
+ return _aidl_default_impl.Deprecated();
+ }
+ }
+ let _aidl_reply = _aidl_reply?;
+ let _aidl_status: binder::Status = _aidl_reply.read()?;
+ if !_aidl_status.is_ok() { return Err(_aidl_status); }
+ Ok(())
+ }
fn TestOneway(&self) -> binder::public_api::Result<()> {
let _aidl_reply = self.binder.transact(transactions::TestOneway, binder::FLAG_ONEWAY | binder::FLAG_CLEAR_BUF | binder::FLAG_PRIVATE_LOCAL, |_aidl_data| {
_aidl_data.mark_sensitive();
@@ -1226,6 +1247,7 @@ impl ITestService for BpTestService {
}
impl ITestService for binder::Binder<BnTestService> {
fn UnimplementedMethod(&self, _arg_arg: i32) -> binder::public_api::Result<i32> { self.0.UnimplementedMethod(_arg_arg) }
+ fn Deprecated(&self) -> binder::public_api::Result<()> { self.0.Deprecated() }
fn TestOneway(&self) -> binder::public_api::Result<()> { self.0.TestOneway() }
fn RepeatBoolean(&self, _arg_token: bool) -> binder::public_api::Result<bool> { self.0.RepeatBoolean(_arg_token) }
fn RepeatByte(&self, _arg_token: i8) -> binder::public_api::Result<i8> { self.0.RepeatByte(_arg_token) }
@@ -1290,6 +1312,16 @@ fn on_transact(_aidl_service: &dyn ITestService, _aidl_code: binder::Transaction
}
Ok(())
}
+ transactions::Deprecated => {
+ let _aidl_return = _aidl_service.Deprecated();
+ match &_aidl_return {
+ Ok(_aidl_return) => {
+ _aidl_reply.write(&binder::Status::from(binder::StatusCode::OK))?;
+ }
+ Err(_aidl_status) => _aidl_reply.write(_aidl_status)?
+ }
+ Ok(())
+ }
transactions::TestOneway => {
let _aidl_return = _aidl_service.TestOneway();
Ok(())
diff --git a/tests/java/src/android/aidl/service/TestServiceServer.java b/tests/java/src/android/aidl/service/TestServiceServer.java
index 3a9724be..06ef6cc6 100644
--- a/tests/java/src/android/aidl/service/TestServiceServer.java
+++ b/tests/java/src/android/aidl/service/TestServiceServer.java
@@ -106,6 +106,8 @@ public class TestServiceServer extends ITestService.Stub {
throw new RemoteException();
}
@Override
+ public void Deprecated() throws RemoteException {}
+ @Override
public boolean RepeatBoolean(boolean token) throws RemoteException {
return token;
}
diff --git a/tests/rust/test_service.rs b/tests/rust/test_service.rs
index 22ff5e7f..90197755 100644
--- a/tests/rust/test_service.rs
+++ b/tests/rust/test_service.rs
@@ -129,6 +129,10 @@ impl ITestService::ITestService for TestService {
Err(binder::StatusCode::UNKNOWN_ERROR.into())
}
+ fn Deprecated(&self) -> binder::Result<()> {
+ Ok(())
+ }
+
impl_repeat_reverse! {RepeatBoolean, ReverseBoolean, bool}
impl_repeat_reverse! {RepeatChar, ReverseChar, u16}
impl_repeat_reverse! {RepeatInt, ReverseInt, i32}