Skip to content

[tizen_rpc_port] Update RpcPort to support TIDL protocol version 2#1070

Merged
JSUYA merged 5 commits into
flutter-tizen:masterfrom
pjh9216:support_v2
Jul 21, 2026
Merged

[tizen_rpc_port] Update RpcPort to support TIDL protocol version 2#1070
JSUYA merged 5 commits into
flutter-tizen:masterfrom
pjh9216:support_v2

Conversation

@pjh9216

@pjh9216 pjh9216 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Add low level Parcel primitives to support the TIDL protocol version 2 Dart generator under packages/tizen_rpc_port.

Implement the dataSize, reserve, and reader getter/setter properties in the Parcel class using Dart FFI to map them to the native C APIs:

  • rpc_port_parcel_get_reader
  • rpc_port_parcel_set_reader
  • rpc_port_parcel_get_data_size
  • rpc_port_parcel_set_data_size
  • rpc_port_parcel_reserve

Add low level Parcel primitives to support the Dart protocol version 2
generator under packages/tizen_rpc_port.

Implement the dataSize, reserve, and reader getter/setter properties
in the Parcel class using Dart FFI to map them to the native C APIs:
- rpc_port_parcel_get_reader
- rpc_port_parcel_set_reader
- rpc_port_parcel_get_data_size
- rpc_port_parcel_set_data_size
- rpc_port_parcel_reserve

Co-Authored-By: Gemini CLI <gemini-cli@google.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds properties and methods to the Parcel class in packages/tizen_rpc_port/lib/src/parcel.dart to manage reader position, data size, and capacity reservation, along with their corresponding FFI bindings. Feedback suggests adding non-negative validation checks (RangeError.checkNotNegative) to the reader and dataSize setters and the reserve method to prevent passing negative values to the native API. Additionally, it is recommended to use rpc_port_parcel_h instead of Pointer<Void> in the FFI signatures to improve type safety.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/tizen_rpc_port/lib/src/parcel.dart
Comment thread packages/tizen_rpc_port/lib/src/parcel.dart
Comment thread packages/tizen_rpc_port/lib/src/parcel.dart
Comment thread packages/tizen_rpc_port/lib/src/parcel.dart Outdated
@JSUYA
JSUYA self-requested a review July 16, 2026 00:32

@JSUYA JSUYA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check gemini's review comments. If you think they are invalid, please resolve them.

And

Please modify the format using Dart Formatter.

https://github.com/flutter-tizen/plugins/actions/runs/29460673863/job/87506437916?pr=1070

2026-07-16T00:35:55.7848891Z Running command: "dart format example/client/integration_test/tizen_rpc_port_test.dart example/client/lib/main.dart example/client/lib/message_client.dart example/client/test_driver/integration_test.dart example/server/integration_test/tizen_rpc_port_test.dart example/server/lib/main.dart example/server/lib/message_server.dart example/server/test_driver/integration_test.dart lib/src/parcel.dart lib/src/port.dart lib/src/proxy_base.dart lib/src/stub_base.dart lib/tizen_rpc_port.dart" in /home/runner/work/plugins/plugins/packages/tizen_rpc_port

}
}

final DynamicLibrary _libRpcPort = DynamicLibrary.open('librpc-port.so.1');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these APIs have a dependency on the Tizen version? Are they only used in Tizen 11?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It is dependent on tizen version. Since Tizen 10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these APIs public open ACR APIs?
If this API is changed in librpc-port.so in Tizen 11.0 or 10.1, platform compatibility cannot be guaranteed to users.
At the very least, there needs to be a way to verify that these APIs are managed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is internal API but It will not be changed to support backward compatibility.
The native APIs is already working in many apps using TIDL.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made sample app to test action. Working well. (https://github.sec.samsung.net/jh9216-park/ActionSampleAppDart)
Please review and merge it ASAP

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API is only compatible with version 10.0, and there are absolutely no guards prepared for cases where it is used with other APIs.

Furthermore, there are no related integration_tests, and there are no modifications whatsoever to the README, CHANGELOG, or pubspec.yaml related to the tizen_rpc_port deployment.

flutter-tizen includes plugin code in the app packaging. It may also be deployed with the minimum supported version set (general guideline).

Therefore, version compatibility should be maintained whenever possible, and measures must be taken to prevent crashes when a non-functional API is called.

Please add relevant guards and ensure that appropriate exception messages are handled in the event of an unsupported API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please see [tizen_rpc_port] Guard Parcel APIs for compatibility commit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check analyze and integration_test CI fails.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed check analyze issue. Please run CI test. I don't have permission

pjh9216 and others added 4 commits July 16, 2026 10:57
Add RangeError.checkNotNegative checks to Parcel setters and methods to
prevent negative values from being passed to native unsigned APIs.

Use rpc_port_parcel_h handle type instead of Pointer<Void> in the FFI
signatures to improve type safety and consistency.

Run dart format on all specified package files to adhere to formatting
standards.

Co-Authored-By: Gemini CLI <gemini-cli@google.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Run './tools/tools_runner.sh format' to properly format the package files
according to the tizen_rpc_port package's language standards.

This corrects indentation and layout in:
- message_client.dart
- message_server.dart
- parcel.dart
- proxy_base.dart
- stub_base.dart

Co-Authored-By: Gemini CLI <gemini-cli@google.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Safely load librpc-port.so.1 and its symbols dynamically to prevent
crashes on older Tizen versions. Throw an UnsupportedError when these
unsupported APIs (reader, dataSize, reserve) are invoked.

Add integration tests to verify the compatibility behavior. Update the
README with requirements, bump version to 0.1.7, and update CHANGELOG.

Co-Authored-By: Gemini CLI <gemini-cli@google.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
Run dart format to fix formatting violations in parcel.dart. This
re-wraps the FFI lookup lines in _ensureFunctionsLoaded.

Co-Authored-By: Gemini CLI <gemini-cli@google.com>
Signed-off-by: jh9216.park <jh9216.park@samsung.com>
@JSUYA
JSUYA merged commit 87c7951 into flutter-tizen:master Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants