Skip to content

Refactoring Libraryimport/phase 4#7562

Open
JoonghyunCho wants to merge 2 commits intoSamsung:mainfrom
JoonghyunCho:libraryimport/phase-4
Open

Refactoring Libraryimport/phase 4#7562
JoonghyunCho wants to merge 2 commits intoSamsung:mainfrom
JoonghyunCho:libraryimport/phase-4

Conversation

@JoonghyunCho
Copy link
Copy Markdown
Member

Summary

Migrate DllImport to LibraryImport (source-generated P/Invoke) for all Network modules.

This is Phase 4 of 4 in a staged LibraryImport migration. Network modules converted cleanly with no SafeHandle or delegate callback issues encountered in Phase 3.

Modules Changed (27 files)

  • Tizen.Network: Bluetooth (Bluetooth, Glib, Libc), Connection (Connection, Glib), IoTConnectivity (Client, Common, Server), Nfc (Nfc, Glib, Libc), Nsd, Smartcard (Smartcard, Glib, Libc), Stc, WiFi, WiFiDirect

Changes

  • Safely mapped [DllImport] to [LibraryImport] and updated method signatures to static partial.
  • Added partial keyword to all enclosing class declarations for source generator compatibility.
  • Mapped string params with StringMarshalling = StringMarshalling.Utf8 only where strictly needed.
  • Enforced safe boolean returns/parameters via [MarshalAs(UnmanagedType.U1)].
  • Removed 397 redundant StringMarshalling.Utf8 attributes from methods without string parameters — the original conversion script had applied this attribute indiscriminately to all methods.

What is NOT included

  • No exclusions. All Network module methods were successfully converted to LibraryImport.
  • Delegate bool MarshalAs improvements — extracted for an independent PR.

Build Verification

All 9 modified modules successfully compiled with 0 errors.

Jay Cho added 2 commits April 10, 2026 10:42
- Migrate DllImport to LibraryImport for all 9 Network modules
- Add partial keyword to all containing classes for source generator
- Add [MarshalAs(UnmanagedType.U1)] for bool parameters
- Add StringMarshalling.Utf8 only where string params exist
- Remove 397 redundant StringMarshalling.Utf8 from methods without string params
- All 9 projects build successfully with 0 errors

Modules: Bluetooth, Connection, IoTConnectivity, Nfc, Nsd, Smartcard, Stc, WiFi, WiFiDirect
- Revert DllImport-only files with incorrect MarshalAs(U1) bool (Bluetooth, WiFi)
- Remove delegate bool MarshalAs changes from 8 mixed files
- Revert Stc and WiFi modules (no actual LibraryImport conversion)
@github-actions github-actions bot added the API14 Platform : Tizen 11.0 / TFM: net8.0-tizen11.0 label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API14 Platform : Tizen 11.0 / TFM: net8.0-tizen11.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant