| #include "aidl/android/aidl/tests/nested/DeeplyNested.h" |
| |
| #include <android/binder_parcel_utils.h> |
| |
| namespace aidl { |
| namespace android { |
| namespace aidl { |
| namespace tests { |
| namespace nested { |
| const char* DeeplyNested::descriptor = "android.aidl.tests.nested.DeeplyNested"; |
| |
| binder_status_t DeeplyNested::readFromParcel(const AParcel* _aidl_parcel) { |
| int32_t _aidl_parcelable_size; |
| int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| binder_status_t _aidl_ret_status = AParcel_readInt32(_aidl_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(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| binder_status_t DeeplyNested::writeToParcel(AParcel* _aidl_parcel) const { |
| binder_status_t _aidl_ret_status; |
| size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos); |
| AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos); |
| return _aidl_ret_status; |
| } |
| |
| } // namespace nested |
| } // namespace tests |
| } // namespace aidl |
| } // namespace android |
| } // namespace aidl |
| namespace aidl { |
| namespace android { |
| namespace aidl { |
| namespace tests { |
| namespace nested { |
| const char* DeeplyNested::A::descriptor = "android.aidl.tests.nested.DeeplyNested.A"; |
| |
| binder_status_t DeeplyNested::A::readFromParcel(const AParcel* _aidl_parcel) { |
| int32_t _aidl_parcelable_size; |
| int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| binder_status_t _aidl_ret_status = AParcel_readInt32(_aidl_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; |
| |
| if (AParcel_getDataPosition(_aidl_parcel) - _aidl_start_pos >= _aidl_parcelable_size) { |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| _aidl_ret_status = ::ndk::AParcel_readData(_aidl_parcel, &e); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| binder_status_t DeeplyNested::A::writeToParcel(AParcel* _aidl_parcel) const { |
| binder_status_t _aidl_ret_status; |
| size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeData(_aidl_parcel, e); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos); |
| AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos); |
| return _aidl_ret_status; |
| } |
| |
| } // namespace nested |
| } // namespace tests |
| } // namespace aidl |
| } // namespace android |
| } // namespace aidl |
| namespace aidl { |
| namespace android { |
| namespace aidl { |
| namespace tests { |
| namespace nested { |
| const char* DeeplyNested::B::descriptor = "android.aidl.tests.nested.DeeplyNested.B"; |
| |
| binder_status_t DeeplyNested::B::readFromParcel(const AParcel* _aidl_parcel) { |
| int32_t _aidl_parcelable_size; |
| int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| binder_status_t _aidl_ret_status = AParcel_readInt32(_aidl_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(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| binder_status_t DeeplyNested::B::writeToParcel(AParcel* _aidl_parcel) const { |
| binder_status_t _aidl_ret_status; |
| size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos); |
| AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos); |
| return _aidl_ret_status; |
| } |
| |
| } // namespace nested |
| } // namespace tests |
| } // namespace aidl |
| } // namespace android |
| } // namespace aidl |
| namespace aidl { |
| namespace android { |
| namespace aidl { |
| namespace tests { |
| namespace nested { |
| const char* DeeplyNested::B::C::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C"; |
| |
| binder_status_t DeeplyNested::B::C::readFromParcel(const AParcel* _aidl_parcel) { |
| int32_t _aidl_parcelable_size; |
| int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| binder_status_t _aidl_ret_status = AParcel_readInt32(_aidl_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(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| binder_status_t DeeplyNested::B::C::writeToParcel(AParcel* _aidl_parcel) const { |
| binder_status_t _aidl_ret_status; |
| size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos); |
| AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos); |
| return _aidl_ret_status; |
| } |
| |
| } // namespace nested |
| } // namespace tests |
| } // namespace aidl |
| } // namespace android |
| } // namespace aidl |
| namespace aidl { |
| namespace android { |
| namespace aidl { |
| namespace tests { |
| namespace nested { |
| const char* DeeplyNested::B::C::D::descriptor = "android.aidl.tests.nested.DeeplyNested.B.C.D"; |
| |
| binder_status_t DeeplyNested::B::C::D::readFromParcel(const AParcel* _aidl_parcel) { |
| int32_t _aidl_parcelable_size; |
| int32_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| binder_status_t _aidl_ret_status = AParcel_readInt32(_aidl_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(_aidl_parcel, _aidl_start_pos + _aidl_parcelable_size); |
| return _aidl_ret_status; |
| } |
| binder_status_t DeeplyNested::B::C::D::writeToParcel(AParcel* _aidl_parcel) const { |
| binder_status_t _aidl_ret_status; |
| size_t _aidl_start_pos = AParcel_getDataPosition(_aidl_parcel); |
| _aidl_ret_status = AParcel_writeInt32(_aidl_parcel, 0); |
| if (_aidl_ret_status != STATUS_OK) return _aidl_ret_status; |
| |
| size_t _aidl_end_pos = AParcel_getDataPosition(_aidl_parcel); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_start_pos); |
| AParcel_writeInt32(_aidl_parcel, _aidl_end_pos - _aidl_start_pos); |
| AParcel_setDataPosition(_aidl_parcel, _aidl_end_pos); |
| return _aidl_ret_status; |
| } |
| |
| } // namespace nested |
| } // namespace tests |
| } // namespace aidl |
| } // namespace android |
| } // namespace aidl |