Skip to content

[AI Task] Remove Log.Info from Sensor.cs property accessors#7594

Open
JoonghyunCho wants to merge 1 commit into
mainfrom
ai-task/issue-7573
Open

[AI Task] Remove Log.Info from Sensor.cs property accessors#7594
JoonghyunCho wants to merge 1 commit into
mainfrom
ai-task/issue-7573

Conversation

@JoonghyunCho
Copy link
Copy Markdown
Member

Summary

Remove diagnostic Log.Info calls from Sensor.cs property getters/setters and convert simple accessors to expression-bodied form. Avoids per-access string allocations and dlog syscalls on hot-path property reads (e.g., Timestamp, IsSensing, Interval).

Changes

  • src/Tizen.Sensor/Tizen.Sensor/Sensor.cs
    • 19 Log.Info calls removed from property accessors (Name, Vendor, MinValue, MaxValue, Resolution, MinInterval, FifoCount, MaxBatchCount, Interval, MaxBatchLatency, PausePolicy, TimeSpan, Timestamp, IsSensing).
    • Read-only properties converted to expression-bodied form.
    • Log.Info in Start()/Stop() and all Log.Error paths are preserved.

Mode

Refactoring

Verification

  • Build: passed (dotnet build src/Tizen.Sensor/Tizen.Sensor.csproj, 0 errors; pre-existing CS1570 warning in BatchSensor.cs unrelated).
  • Tests: N/A (no unit tests target this module's property accessors; behavior preservation verified by inspection — values returned and side effects on backing fields are unchanged).
  • Benchmark: skipped (no sdb device available in this environment). Manual benchmark recommended; expected gains are reduced Gen0 allocations and dlog syscalls in property-read hot paths.

API Compatibility

  • Public API signatures unchanged.
  • Behavior unchanged (return values and field mutations identical).
  • Binary and source compatibility preserved.

Fixes #7573

Convert read-only properties to expression-bodied form and remove
diagnostic Log.Info calls from getters/setters. Keeps Log.Info calls
in state-change methods (Start/Stop) and all Log.Error paths intact.

19 Log.Info calls removed; ~94 lines reduced. Public API preserved.
@JoonghyunCho
Copy link
Copy Markdown
Member Author

⚠️ Benchmark skipped: No sdb device available in the AI agent environment, so the on-device benchmark could not be run. Manual benchmark verification is recommended on a connected Tizen target. Expected gains: reduced Gen0 allocations and dlog syscalls in property-read hot paths.

@github-actions github-actions Bot added the API14 Platform : Tizen 11.0 / TFM: net8.0-tizen11.0 label Apr 27, 2026
@JoonghyunCho
Copy link
Copy Markdown
Member Author

🤖 [AI Review]

Reviewed — no findings.

Scope checked:

  • All 19 Log.Info removals are confined to property accessors (Name, Vendor, MinValue, MaxValue, Resolution, MinInterval, FifoCount, MaxBatchCount, Interval, MaxBatchLatency, PausePolicy, TimeSpan, Timestamp, IsSensing); no Log.Error calls removed.
  • Lifecycle logs in Start() / Stop() (lines 417, 436, 448, 459) are preserved as stated in the PR description.
  • Setter side effects retained in original order — Interval still calls SetInterval(), MaxBatchLatency still calls SetMaxBatchLatency(), PausePolicy still calls SetAttribute(SensorAttribute.PausePolicy, (int)_pausePolicy), TimeSpan setter still casts value.Ticks to ulong.
  • Public API surface unchanged: no signatures added/modified/removed; existing <summary>, <value>, <since_tizen>, <exception> XML doc tags untouched.
  • Expression-bodied conversions are mechanically equivalent to the original get { return _field; } form for the read-only properties; Timestamp getter return type (ulong) and TimeSpan getter (Int64)_timestamp cast preserved verbatim.

No 🔴 critical issues, no 🟡 suggestions to flag.


Automated review — final merge decision rests with human reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AI Refactoring] Sensor.cs 프로퍼티 게터/세터 Log.Info 제거 → 불필요한 문자열 할당 최소화

1 participant