Repository navigation
[Essentials] Standalone Tizen Essentials package on the public MAUI DI facade bridge - #8
Conversation
Ports the dotnet/maui net11.0 Tizen Essentials implementations into a standalone `Maui.Tizen.Essentials` package that targets .NET 11+ and consumes the neutral (non platform specific) MAUI packages. The net11.0 branch of dotnet/maui hard-disables its in-box Tizen target frameworks, so a Tizen backend must now ship separately. * Converts every MAUI partial implementation fragment into an independently named public class under `Microsoft.Maui.Platforms.Tizen.Essentials` implementing the public Essentials contract. * Adds `AddTizenEssentials(MauiAppBuilder)` / `(IServiceCollection)` using singleton `TryAdd` registrations, so applications can override any individual service. * Relies on the .NET 11 Essentials DI-to-static-facade bridge (dotnet/maui#36657) instead of `SetDefault` reflection, and on the dispatcher/MainThread bridge instead of a private MainThread hook. `MainThread.tizen.cs` is deliberately not ported. * Implements screenshot for real through the neutral `IScreenshot` and `IViewScreenshot` contracts using `Tizen.NUI.Capture` plus `Tizen.Multimedia.Util` encoders, replacing the upstream stub whose members all threw. * Classifies unsupported capabilities explicitly by Tizen device profile. Nothing returns a success-shaped fallback. * Adds 193 host-side tests covering DI registration, facade and MainThread ownership, permission privilege mapping, unsupported capability classification, and the ported translation logic. * Documents implemented/partial/unsupported services, and the MAUI internal-API gaps found while porting, in `docs/tizen-essentials-service-coverage.md`, asserted by tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reconciles the standalone Essentials implementation with the foundation scaffold's project contract, and resolves the package-baseline blocker this branch was carrying. Adopted from the foundation, unchanged: * `net11.0-tizen11.0` as the single shipping TFM, with the `MAUITIZEN0001` workload gate left intact. `src/Maui.Tizen.Essentials` still cannot be restored or built until Samsung publishes `samsung.net.sdk.tizen.manifest-11.0.100`, and no neutral fallback was added to make it look otherwise. * `global.json`, `Directory.Build.props`, `Directory.Build.targets`, `nuget.config` and central package management. * MAUI pinned to `11.0.0-preview.7.26418.3` from the dotnet11 public feed. This is the first public package set containing PR #36657, which removes the blocker recorded on this branch: the newest package on nuget.org (`preview.7.26406.9`) predates it. Changed here: * `src/Maui.Tizen.Essentials` sets `EnableDefaultCompileItems=true` and compiles the reworked implementation, per the process described in `eng/targets/TizenPackage.props`. The raw imported `*.tizen.cs` fragments it supersedes are removed; they are `partial` halves of `Microsoft.Maui.Essentials` types and could never compile from here. History and `PROVENANCE.md` still record them. * Adds `src/Maui.Tizen.Essentials.HostVerification`: a non-packable `net11.0` harness that compiles the same sources against the Tizen.NET package, so the workload gate does not also make the port unverifiable. It is explicitly not a neutral fallback for the shipping package and produces nothing publishable. * Wires both new projects into the workload-free CI lane, which now runs 193 Essentials tests alongside the existing repository invariants. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Both merge conflicts (`Maui.Tizen.slnx`, `eng/build-workload-free.sh`) were additive project lists and are resolved by keeping both sides. The slice introduced a stronger verification idea than this branch had: type-checking platform sources against the real `Samsung.Tizen.Ref.API15` reference assemblies. Adopting it for Essentials immediately found a correctness bug. * Adds `tests/Maui.Tizen.Essentials.RefPackCompile`, mirroring `tests/Maui.Tizen.Core.RefPackCompile`: compile-only, unpackable, compiles the Essentials sources against the API15 surface that `net11.0-tizen11.0` will bind to. * `TizenGeocoding` is reclassified `Unsupported`. `Tizen.Maps` (`MapService`) was deprecated in TizenFX API11 and is **absent from API15** - the reference pack ships no `Tizen.Maps.dll` - and Tizen has no replacement geocoding service. Both operations now throw with an explicit reason rather than returning an empty sequence, which a caller cannot distinguish from a genuine "no match". `MapServiceToken` deliberately still does not throw: the .NET 11 Essentials DI bridge reads and writes it during `MauiApp` initialization, so throwing would turn a `ConfigureEssentials` line into a startup crash. The token is accepted and never used. This is exactly what the two-lane split is for. The implementation assembly lane alone still compiled the old `Tizen.Maps` code happily and would have shipped a binding to an assembly the target platform no longer has. * Bumps the host verification harness from Tizen.NET 11.0.0.x (API11) to 13.0.0.x (API13), the closest published implementation package to the API15 target, and switches screenshot capture to `Window.Default` (`Window.Instance` is deprecated at API12 and would fail CI under TreatWarningsAsErrors). Verified: `eng/build-workload-free.sh` green from a clean tree with CI semantics, 195 Essentials tests passing alongside the slice's lanes. The `MAUITIZEN0001` workload gate on `src/Maui.Tizen.Essentials` is untouched. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Rebased onto Adopted the slice's API15 lane — and it found a bugThe slice's
This is precisely what the two-lane split buys. The implementation-assembly lane alone (Tizen.NET) still compiled the old Two other API-version findings
Host verification bumped from Tizen.NET 11.0.0.x (API11) to 13.0.0.x (API13) — the closest published implementation package to the API15 target, narrowing the gap between the two lanes. Verification
|
…policy Ten further review findings. All were real; several were things that looked correct while doing nothing. Blazor package graph (verified against the feed, not assumed) Microsoft.AspNetCore.Components.WebView was pinned to MAUI's version stamp 11.0.0-preview.7.26418.3. That version does not exist for that package - it is an ASP.NET Core package on its own version line - so NuGet silently substituted 11.0.0-rc.1.26378.118 (NU1603) and then failed with NU1109 downgrades across the graph. That substitution is where the "actual dependency is rc.1" report came from; it was NuGet's fallback, not a declared dependency. Microsoft.AspNetCore.Components.WebView.Maui 11.0.0-preview.7.26418.3 declares Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Components.WebView and Microsoft.JSInterop at exactly 11.0.0-preview.7.26381.103 - which also matches the SDK build pinned in global.json, so the whole graph stays on one ASP.NET Core build. Pinned there. RC1 would have silently upgraded past what MAUI asked for. Package source mapping now lists the prerelease patterns under BOTH sources. NuGet restores only from sources declaring the longest matching pattern, so Microsoft.AspNetCore.* under dotnet11 alone would have made every ASP.NET Core package resolvable only from that feed (NU1100 for anything it lacks). Added eng/tests/PackageGraphProbe: a net11.0 project whose only purpose is to make restore prove these pins resolve. Necessary because the real consumers are Tizen projects, and they cannot restore at all - the workload gate fires before Restore - so a broken pin would otherwise stay invisible until Samsung ships. Verified it reproduces the original NU1603/NU1109 failure. CI workload probe could never succeed (#5) `dotnet workload install tizen --skip-manifest-update` cannot work on a clean runner: the Samsung manifest is third-party and side-loaded, so the workload ID is not discoverable through public workload search, and --skip-manifest-update guarantees failure because the manifest is exactly what is missing. A probe that can never succeed would keep reporting "blocked" for weeks after the gate lifts. Replaced with a feed probe for an 11.0.100-band manifest package, checking both ID spellings. Installation, when it happens, goes through Samsung's supported path. Dead configuration removed (#6, #10) - <Compile Update="**/*.Tizen.cs" /> had no metadata, so it changed nothing, and EnableDefaultCompileItems=false meant there were no items to update anyway. It read as meaningful configuration while being unreachable. - ValidateBaselineConsistency did substring matching on JSON inside MSBuild. Parsed validation already exists in the workload-free script and the invariant tests, which is where it belongs. Orphan imported projects (#7) GraphicsTester.Skia.Tizen.csproj was imported because its filename contains "Tizen", but it cannot load here: its TFM is $(_MauiDotNetTfm)-tizen (a dotnet/maui property that does not exist here, so the TFM evaluates to the malformed "-tizen") and both ProjectReferences point at projects never imported. Parked as .csproj.orphan - file and history intact, invisible to project discovery - with samples/README.md documenting every orphan asset directory and an invariant test asserting every .csproj is in the solution. Analyzers and warnings (#8, #14) - Added Microsoft.CodeAnalysis.PublicApiAnalyzers (PrivateAssets=all) so the PublicAPI baselines are enforced rather than inert text. - Removed the Microsoft.SourceLink.GitHub pin; the SDK has bundled it since .NET 8. - Suppressed CS1591 in TizenPackage.props: the inherited sources are not uniformly documented, so the first project to start compiling would otherwise fail on hundreds of missing-comment errors under warnings-as-errors. Documentation is its own workstream, not a blocker for the first handler. Licensing (#9) git-filter-repo is vendored and load-bearing, so unlike the referenced-only Samsung packages it IS redistributed. Added its upstream, version, MIT licence text and a verification command to THIRD-PARTY-NOTICES.md. CI hygiene (#11, #12) - `dotnet test --no-build` is skipped when a preceding build failed; running it against missing output buries the actual first failure in cascading noise. - Added a scheduled dependency-audit workflow. The strict policy stays (audit at `low`, warnings as errors - this ships to devices where patching is slow), but a newly published advisory now files an issue weekly instead of ambushing whoever opens the next unrelated PR. Suppression process documented, with a required justification and re-review date. Naming and provenance (#13) Replaced 'samsung.net.sdk.tizen.manifest-11.0.100' with the actual band contract Samsung.NET.Sdk.Tizen.Manifest-11.0.100-preview.7, recording both ID spellings (NuGet IDs are case-insensitive) and the probe results for each. Documented that tizen11.0/API15 comes from Samsung workload PR #310 - verified, not assumed. Also recorded that enabling Build.Tasks raises real SkiaSharp native-asset packaging questions, flagged as an open decision rather than papered over. Tests: 28 -> 33 invariants, plus the package graph probe wired into the required lane. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Merges the current `redth-tizen-core-vertical-slice` head (4eb9163, past the requested 21cc2a7), which also carries the latest foundation. The single conflict (`Maui.Tizen.slnx`) was an additive project list. The slice's `eng/targets/TizenPackage.props` now adds Microsoft.CodeAnalysis.PublicApiAnalyzers to every Tizen package project and feeds it the `PublicAPI/**` baselines. `src/Maui.Tizen.Essentials` is the only such project with `EnableDefaultCompileItems=true`, so it was the only one where that enforcement had teeth - and its baselines were still the raw dotnet/maui import, describing an API surface this assembly does not have. Nobody could see this, because the project cannot build without the Samsung workload. It would have detonated on the day the workload shipped: 622 RS0016 (undeclared symbols) and 2628 RS0017 (stale baseline entries). Fixed by making the surface enforceable today: * `tests/Maui.Tizen.Essentials.RefPackCompile` now runs the PublicAPI analyzer against the same baseline files. It compiles the identical sources against the same API15 surface with no workload, so it is the only place the baseline can actually be checked right now. Verified by negative test: adding an undeclared public constant fails the build with RS0016 under CI semantics. * Regenerated `PublicAPI.Unshipped.txt` (308 entries) to describe the real surface. Every declaration is in `Microsoft.Maui.Platforms.Tizen` `.Essentials` or the single `Microsoft.Maui.Hosting` extensions class; nothing leaks into a `Microsoft.Maui.*` namespace this package does not own. `PublicAPI.Shipped.txt` is empty because nothing has shipped. Also fixes a real API defect the analyzer surfaced (RS0026): `TizenTextToSpeech.SpeakAsync(string, string, float?, CancellationToken)` overloaded `ITextToSpeech.SpeakAsync(string, SpeechOptions?, CancellationToken)` with a second optional-parameter overload, making `SpeakAsync(text, null)` ambiguous between a null SpeechOptions and a null language. Renamed to `SpeakWithVoiceAsync`, which also reads better next to `GetSupportedVoiceLanguagesAsync`. Finally, moves the Essentials test invocation inside the `BUILD_OK` guard in `eng/build-workload-free.sh`. The merge had left it outside, where a preceding build failure would run it anyway and bury the real error. Verified: `eng/build-workload-free.sh` green from a clean tree under CI semantics - both Essentials lanes, both core lanes, the package graph probe, workload detection regressions, and 195 Essentials tests. `MAUITIZEN0001` still gates `src/Maui.Tizen.Essentials`. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
`check` only inspects an exit code, which is demonstrably insufficient evidence for this assembly. Test discovery walks assembly-level attributes across the loaded closure, and Tizen.NUI's [XmlnsDefinition] constructor P/Invokes and throws off-device. On the xunit v2 runner that aborted discovery part way through a class and silently dropped the rest while still reporting success - it hid 4 tests before it was caught. xunit v3 handles it today, but "the runner exited 0" is not proof that the tests actually ran, and the failure is invisible by construction. The lane now parses the runner summary and fails if fewer than 195 tests execute. Verified both directions: passes at the real count, and fails with "test discovery regressed" when the floor is raised above it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The previous commit's count assertion scraped the runner's console summary. It passed locally and failed on the CI runner with "could not parse a test total from the runner summary", because console rendering is not a stable contract across platforms and terminals. Replaced with `eng/assert-test-count.py`, which reads the runner's JUnit report. It counts `<testcase>` elements rather than trusting the summary attribute, so a report whose header disagrees with its body cannot pass, and it fails when the report is missing entirely - the case that would otherwise let a runner that never started look green. Verified all three paths: passes at the real count, fails with "test discovery regressed" when the floor is raised, and fails with "no test report" when the file is absent. Full lane green from a clean tree, exit code 0. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Merged the current core head The merge exposed a landmine
Invisible today, because the project can't build without the workload. It would have detonated the day the workload shipped: 622 RS0016 (undeclared symbols) and 2628 RS0017 (stale entries). Fixed by making the surface enforceable now: Proven live, not assumed: adding an undeclared public constant fails the build with Real API defect the analyzer caught (RS0026)
Test-count assertion, and a self-inflicted CI failure worth recording
My first attempt scraped the runner's console summary. It passed locally and failed on CI — console rendering isn't a stable contract. Replaced with Also moved the Essentials test invocation inside the VerificationCI The host-verification / MTP lane is unchanged and still flagged for review — it remains |
…tripwire Merges the final `redth-tizen-core-vertical-slice` head, which upgrades the MAUI development package baseline to 11.0.0-preview.7.26426.4 and brings foundation 1b4960f along with it. No conflicts. Re-verified the blocking `Microsoft.Maui.Media.Locale` API gap against the newer packages rather than assuming it carried forward: the constructor is still `internal` in 26426.4, so `TizenTextToSpeech.GetLocalesAsync` must keep throwing. Replaced that manual re-check with a test. `MauiLocaleStillExposesNoPublicConstructor` asserts the gap is still open, so the moment a public constructor appears the suite fails and its message says exactly what to do: implement GetLocalesAsync properly, drop the GetSupportedVoiceLanguagesAsync workaround from the coverage matrix, and delete the test. That inverts the maintenance burden. Today someone has to remember to re-probe this on every MAUI bump, and forgetting means the workaround silently outlives the problem it works around. Test count 195 -> 196, so the CI floor is raised to match - which is the direction that assertion is meant to move. Verified: `eng/build-workload-free.sh` green from a clean tree under CI semantics against the new packages, including both Essentials lanes, both core lanes, the package graph probe and workload detection regressions. The Essentials ref-pack lane still builds clean with the PublicAPI analyzer enforcing the regenerated baseline. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Merged core final head Re-verified the Locale gap rather than assuming it carried forwardThe blocking Rather than leave that as something a human has to remember to re-probe on every MAUI bump, it is now pinned by a test: It asserts the gap is still open. When it fails, that is good news — the message says exactly what to do: implement This inverts the maintenance burden. Today, forgetting to re-check means the workaround silently outlives the problem it works around; now the suite tells us the moment the upstream fix lands. Test count 195 → 196, so the CI floor is raised to match — the direction that assertion is designed to move. Verification on the new package set
Standing by for review feedback and for the upstream Locale work to land. |
…tive lifetimes MERGE BLOCKER - permission map no longer reports Granted for gated capabilities. Every built-in Permissions.* type previously mapped to either a privilege list or an EMPTY list, and an empty list meant Granted. So Bluetooth, Calendar, Media, Photos, Phone, PostNotifications, Sensors, Sms and Speech - all of which Tizen genuinely gates - reported Granted without checking anything. Mappings are now one of three explicit kinds: Requires Tizen gates it; privacy privileges also need runtime consent Ungated Tizen genuinely requires no privilege (Battery alone) Unsupported no Tizen equivalent; checking or requesting throws Collapsing the last two into "empty list" is exactly what produced the bug, so they are now distinct types rather than distinct comments. Privileges were read from the privilege annotations in the TizenFX API13 XML documentation rather than from memory. That also caught a second defect: Camera and Microphone were marked isRuntime: false, so resolution skipped PrivacyPrivilegeManager entirely and returned Granted for a capability the user may have denied. A test now asserts every privilege in Tizen's documented privacy set carries isRuntime: true. Permissions.Maps drops http://tizen.org/privilege/mapservice: with Tizen.Maps removed at API15 it gates nothing, so requiring applications to declare it was asking for permission for a dead capability. CORRECTNESS * AddTizenEssentials(MauiAppBuilder) now calls ConfigureEssentials(), which installs MAUI's Essentials initializer. MauiApp.CreateBuilder(useDefaults: true) installs it through the INTERNAL UseEssentials(); nothing installs it when defaults are skipped, so registering services alone left Battery.Default resolving a lazy platform default while DI held the real Tizen service - two live instances and a silently wrong static API. Facade identity is now asserted under useDefaults true AND false. * The facade bridge test no longer declares its expected set by hand. That was a tautology - same author on both sides - and would have passed if MAUI bridged nothing. It now decodes the IL of MAUI's own bridge methods and collects the contracts they actually resolve. * Screenshot: Size2D, Size and PixelBuffer are native handles and were all leaked; they are now disposed. RGBX/BGRX are opaque padding formats, not alpha - BGRX maps to Bgrx8888 and RGBX is converted to opaque RGBA rather than letting driver padding become transparency. Capture.Finished is the only completion signal, so the wait is now bounded instead of hanging and leaking the handle forever when it never arrives. * Connectivity.ConnectionProfiles is queried synchronously per read from ConnectionManager's per-transport state. It was populated only by the refresh started when the first ConnectivityChanged handler was added, so simply asking the question always returned empty. * Battery reads Tizen's own power source (None/Ac/Usb/Wireless) instead of inferring USB from the charging flag, and distinguishes Full and NotCharging from Discharging. * SecureStorage namespaces its aliases. The key manager alias space is shared with certificates and keys, so raw keys risked collision - and RemoveAll deleted every alias the application could see, destroying unrelated secrets. It now removes only aliases this API created. * Preferences escapes shared-name and key components before joining. With plain concatenation, ("a", "b~c") and ("a~b", "c") both produced "a~b~c", so two logical entries shared one physical entry and Clear("a") deleted the unrelated "a~b" store. Default-store keys stay unprefixed for compatibility with existing data. * Sensor Start/Stop are transactional. A throwing Start previously left DataUpdated attached, so the next Start double-subscribed and every reading was raised twice. Accelerometer is consolidated onto TizenSensorBase, which is where it should have been. * TTS initialization is serialized behind a semaphore and cached as one task. Concurrent callers each constructed a TtsClient; the loser's was overwritten and leaked with a live native handle. Prepare failures now dispose and reset so a retry works. Cancellation is re-checked after acquiring the speak lock and again before Play, so a call cancelled while queued cannot start speech. * Contacts.GetAllAsync requests runtime contact.read consent rather than only checking declaration, and materialises results before disposing the native cursor instead of handing back a lazy sequence over it. * Launcher CanOpenAsync/TryOpenAsync query matched application ids, so TryOpenAsync returns false instead of throwing when nothing handles the URI - which is the entire point of a Try method. Tests 196 -> 283; CI floor raised to match. PublicAPI baseline regenerated (0 entries outside this package's namespaces). Coverage matrix updated with the permission model and per-service notes. Verified: eng/build-workload-free.sh green from a clean tree under CI semantics, including both Essentials lanes with the PublicAPI analyzer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
All 14 review items implemented. Head 1 — Merge blocker: permission map (fixed, and it was worse than reported)Every Mappings are now one of three distinct types, not distinct comments:
Collapsing the last two into "empty list" is precisely what caused the bug. Privileges were read from the privilege annotations in the TizenFX API13 XML docs, not from memory. That surfaced a second defect nobody had flagged:
2 & 13 — DI bridge and the tautological test
The old facade test declared its expected set by hand — a tautology, same author both sides, and it would have passed if MAUI bridged nothing. It now decodes the IL of MAUI's own bridge methods and collects the contracts they actually resolve. 3–12 — correctness
14 — docs and countsCoverage matrix updated per service plus a new permission-model section. Tests 196 → 283, CI floor raised to match. PublicAPI baseline regenerated — 0 entries outside this package's namespaces, analyzer clean under CI semantics. Note on
|
Merges the current core head, which brings foundation's merge to main plus the PublicAPI opt-in rework. The one conflict (build-workload-free.sh project list) was additive. Fixes a provenance defect this branch introduced. When the earlier review required a PublicAPI baseline describing this assembly, I regenerated it in place over src/Maui.Tizen.Essentials/PublicAPI/net-tizen/. Those files are not ours to overwrite: they are the imported record of what upstream shipped for net-tizen, and eng/api-baselines/ reads them. 1,318 lines of that record were replaced with 326 lines describing a different assembly, and nothing failed, because the only consumer that would have noticed cannot run until the Samsung workload ships. Core had meanwhile established the right convention for exactly this problem (src/Maui.Tizen.Core/PublicAPI/slice/), so this now follows it: PublicAPI/net-tizen/ imported provenance, untouched, analyzer-detached PublicAPI/slice/ this assembly's real contract, analyzer-attached The net-tizen files are restored byte-identical to import commit 1b85b2d (verified by diff, not by inspection). The generated baseline moves to PublicAPI/slice/ with a README recording how it was produced and why the swap is needed. Also adopts core's new opt-in wiring: the automatic PublicAPI/** glob is gone, so src/Maui.Tizen.Essentials sets EnablePublicApiAnalyzer and attaches its slice baselines explicitly, as Maui.Tizen.Core does. Enforcement re-verified by negative test on the new path - an undeclared public constant still fails with RS0016 under CI semantics. Adds a test pinning the geocoding contract precisely: the two operations Tizen cannot perform throw, and construction, token access and disposal do not. Those all run during MauiApp startup and teardown, so a throw from any of them would turn an unsupported capability into an application that cannot start. Tests 283 -> 284; CI floor raised to match. Verified: eng/build-workload-free.sh green from a clean tree under CI semantics, including core's new PublicApiOptIn and PackReadme probes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests 283 -> 284 after the geocoding contract test, and the baseline reference follows the move to PublicAPI/slice/. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ready for final review — head
|
| Path | Role |
|---|---|
PublicAPI/net-tizen/ |
imported provenance — untouched, analyzer-detached |
PublicAPI/slice/ |
this assembly's real contract — analyzer-attached |
net-tizen is restored byte-identical to import commit 1b85b2d, verified by diff, not by inspection. The generated baseline moved to slice/ with a README recording how it was produced.
Also adopted core's new opt-in wiring (the automatic PublicAPI/** glob is gone): EnablePublicApiAnalyzer plus explicit AdditionalFiles, matching Maui.Tizen.Core. Enforcement re-verified by negative test on the new path — an undeclared public constant still fails with RS0016 under CI semantics.
Geocoding contract pinned precisely
Per the "unsupported / non-throwing" requirement, there's now a test asserting the exact boundary: the two operations Tizen cannot perform throw, and construction, token get/set and disposal do not. Those all run during MauiApp startup and teardown, so a throw from any of them would turn an unsupported capability into an app that cannot start.
Verification
| Lane | Result |
|---|---|
Maui.Tizen.Essentials.RefPackCompile (API15 + PublicAPI analyzer) |
✅ clean, CI semantics |
Maui.Tizen.Essentials.Tests (host lane) |
✅ 284/284 |
eng/build-workload-free.sh, clean tree |
✅ green, incl. core's new PublicApiOptIn + PackReadme probes |
CI Build and test (no Tizen workload) |
✅ log confirms both Essentials lanes and ran at least 284 tests |
MAUITIZEN0001 still gates src/Maui.Tizen.Essentials; no neutral TFM added.
⚠️ This is not the final rebase
The upstream Locale fix has not shipped. I checked the dnceng dotnet11 feed directly: the newest Microsoft.Maui.Essentials is still 11.0.0-preview.7.26426.4, and I re-probed the package — Locale's constructor remains internal. ITextToSpeech.GetLocalesAsync therefore still throws, with GetSupportedVoiceLanguagesAsync / SpeakWithVoiceAsync as the workaround.
The MauiLocaleStillExposesNoPublicConstructor tripwire is armed and passing, so the moment that package lands the suite fails and states the exact follow-up. Ping me when it's published and I'll do the final rebase.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f10f5376-08fd-4221-8332-7c3b3865f0b2
…nds (#37857) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Description of Change `Microsoft.Maui.Media.Locale` only had an **internal** constructor. That makes it impossible for a text-to-speech backend that lives outside of this repo to implement `ITextToSpeech`: it cannot return anything from `GetLocalesAsync()`, and it cannot construct a `Locale` to hand back through `SpeechOptions.Locale`. This is a concrete blocker today — [Redth/Maui.Tizen#8](Redth/Maui.Tizen#8) has to mark locale enumeration as unsupported (`GetLocalesAsync` returns an empty list) purely because of this, even though the Tizen `TtsClient.GetSupportedVoices()` API returns everything needed. Reproduction from an assembly that does **not** have `InternalsVisibleTo` access to `Microsoft.Maui.Essentials`: ``` error CS1729: 'Locale' does not contain a constructor that takes 4 arguments ``` #### What changed 1. **`Locale` gains a public constructor** (`public Locale(string? language, string? country, string? name, string? id)`). This is the smallest additive change that unblocks the scenario — no builder, no factory, no new type. 2. **`null` is normalized to `string.Empty`.** `PublicAPI.Shipped.txt` already declares all four properties as non-nullable (`string!`), but the in-box platform backends pass `null` for `Country`/`Name`/`Id`. Now that arbitrary callers can construct a `Locale`, the declared contract is actually enforced, so consumers can rely on the properties never being `null`. Values are otherwise stored verbatim — they are **not** parsed, validated, trimmed, or case normalized, because their meaning is defined by whichever engine produced them. 3. **Immutability, reference equality, and `ToString()` are unchanged.** No `Equals`/`GetHashCode`/`ToString` overrides were added, so existing behavior is preserved exactly; there is a test that pins this. 4. **Platform voice-selection guards tightened.** Because a caller can now build a locale that only carries a `Language` (or only an `Id`), the `!= null` checks in the platform implementations were changed to `string.IsNullOrEmpty` so that a partially-populated locale falls back the same way an absent one does today. Platform-produced locales always populated these fields, so in-box behavior is unchanged. - This also fixes a latent `NullReferenceException` on Tizen, where `options?.Locale.Language` dereferenced a null `Locale`. 5. **Culture semantics documented.** The XML docs now state that `Language` is BCP-47 on iOS/Windows and ISO 639 on Android, that `Country` is ISO 3166 / UN M.49 on Android and unused (empty) on iOS/Windows because the region is already carried in `Language`, that `Id` is engine-specific and that platforms fall back to `Language`/`Country` when it is empty, and that `null` normalizes to `string.Empty`. ### Issues Fixed Unblocks out-of-tree `ITextToSpeech` backends, e.g. [Redth/Maui.Tizen#8](Redth/Maui.Tizen#8). ### Testing Added `src/Essentials/test/ExternalBackendTests` (`Microsoft.Maui.Essentials.ExternalBackend.UnitTests`). This assembly deliberately has **no** `InternalsVisibleTo` grant from `Microsoft.Maui.Essentials`, so it can only use the public surface — it is the regression guard for exactly the scenario this PR unblocks. It contains a stand-in external backend that implements `ITextToSpeech`, and covers: - the constructor being reachable from outside Essentials; - `null` and `""` normalizing to `string.Empty`; - values not being trimmed or case normalized; - an external backend returning `Locale`s from `GetLocalesAsync()`, including a language-only locale; - round-tripping a `Locale` through `SpeechOptions` into `SpeakAsync`. The project is registered in `eng/helix.proj`, `eng/cake/dotnet.cake`, `Microsoft.Maui.sln`, and both solution filters, so it runs alongside the other unit test assemblies. Verified locally on macOS: - `Essentials.ExternalBackend.UnitTests` — 6/6 passed (and confirmed to fail to compile with `CS1729` before the change). - `Essentials.UnitTests` — 513/513 passed. - `Essentials.csproj` builds clean (including the `PublicAPI` analyzers) for `net11.0`, `netstandard2.0`, `netstandard2.1`, `net11.0-ios`, `net11.0-maccatalyst`, and `net11.0-android`. `PublicAPI.Unshipped.txt` entries were added for all seven TFM folders (`net`, `net-android`, `net-ios`, `net-maccatalyst`, `net-tizen`, `net-windows`, `netstandard`). ### Reviewer notes **The `null` → `string.Empty` normalization is an observable change.** `PublicAPI.Shipped.txt` already declared all four properties as non-nullable `string!`, but the in-box backends passed literal `null` for `Country`/`Name`/`Id`, so the runtime value contradicted the annotation. This change aligns runtime with the declared contract. External consumers who defensively null-check `Locale.Country` will now see `""` instead of `null`. **Platform voice-selection guards were audited for the newly-reachable inputs.** Because a caller can now construct a `Locale` carrying only some fields, every platform guard was reviewed: - **Windows** — `GetSpeakParametersSSMLProsody` resolved the language with `options?.Locale?.Language ?? SpeechSynthesizer.DefaultVoice.Language`. Normalization defeats that `??` (`""` is not `null`), so the default-voice fallback stopped firing and the SSML was emitted as `xml:lang=''`. Fixed with an `IsNullOrWhiteSpace` check. Verified against a standalone harness: the previous expression emits `xml:lang=''` for `new Locale(null, …)` and `new Locale("", …)`, while the new one falls back to `DefaultVoice.Language` for null/empty/whitespace and preserves a real language unchanged. - **iOS** — an unrecognized `Id` makes `AVSpeechSynthesisVoice.FromIdentifier` return `null`; sitting in the true branch of a ternary with no coalesce, that skipped `Language` entirely and set `Voice = null`. Now a single coalescing chain: identifier → language → current language, matching the intent the existing comment already described. (The original `?:`/`??` precedence was correct; this is a separate fall-through gap.) - **Android / Tizen** — guards switched to `IsNullOrWhiteSpace`. The Tizen change also fixes a latent `NullReferenceException`: `options?.Locale.Language` threw whenever `options != null && options.Locale == null`. - **macOS** — `.macos.cs` is **not compiled for any shipping TFM** (its `ItemGroup` in `Essentials.csproj` is commented out and there is no `net-macos` PublicAPI folder), so it is neither type-checked nor CI-verified. Its guard was kept faithful to the original reset semantics: assigning `null` returns `NSSpeechSynthesizer` to the system default, and since the synthesizer is a cached instance, skipping the assignment would let a previous utterance's voice leak into a call that asked for no specific voice. **Known coverage gap.** `GetSpeakParametersSSMLProsody` is `static` and trivially unit-testable, but it compiles only for the Windows TFM, while `Essentials.UnitTests` targets `$(_MauiDotNetTfm)` (`net11.0`). There is therefore no in-repo home for a regression test on the Windows fix without adding a Windows-targeted unit test project. Flagging rather than silently skipping; happy to add that project if reviewers want it. **Equality/`ToString()` are deliberately left unspecified.** An earlier revision asserted reference equality and the compiler-default `ToString()`. Those assertions were removed, along with the matching sentence in the XML docs, so that a future conversion of `Locale` to a `record` or an `IEquatable<Locale>` implementation is not pre-emptively blocked. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f10f5376-08fd-4221-8332-7c3b3865f0b2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f10f5376-08fd-4221-8332-7c3b3865f0b2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f10f5376-08fd-4221-8332-7c3b3865f0b2
|
Exact-head code/security re-review requested for This own-scope head fixes multi-file Share payloads, Email attachments, geo |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f10f5376-08fd-4221-8332-7c3b3865f0b2
|
Exact-head code/security re-review requested for This own-scope head makes path-only Share/Email attachments resolve MIME without invoking the unavailable neutral implementation, and writes single-file Share Path as a scalar while retaining enumerable Path for MultiShare. Validation: 347/347 Essentials tests, API15 reference-pack compile, and the complete workload-free lane passed. Final Core rebase and packaged Locale adoption remain held separately. |
Integrate the finalized Core, Waves A/B/C, validation infrastructure, and Controls composition path while preserving the reviewed Essentials implementation. Register Essentials through the production Controls startup path, replace neutral services, and share source/API15 closure checks with locked mutations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Close the reviewed build, API15, storage, dispatcher, callback, sensor, screenshot, AppControl, permission, and lifecycle blockers. Record the pinned MAUI FileResult and passkey response construction gaps as compile-backed release blockers, and expand locked mutation coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Synchronize the test commit queue instead of relying on a fixed number of scheduler yields, eliminating the exact CI race without changing production behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Serialize screenshot terminal outcomes, clipboard secondary-selection transitions, callback generations, sensor cache handoff, permission requests, TTS rate mapping, and secure deletion semantics. Harden the locked mutation runner and expand production coordinator fault coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Normalize only API15's documented empty secure-repository sentinel and bind every native event subscription to its own captured generation delegate. Extend native-faithful coverage and locked mutations without changing external release blockers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Keep the hosted convention proof on the publicly restorable Samsung API15 reference pack and rely on native-faithful unit coverage for the documented empty-alias sentinel. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Give each clipboard native relay its exact DataSelected delegate and move device display state updates behind generation-validated commits. Add retained-callback tests and locked mutations while preserving secure storage and external release gates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7a37339a-ace9-487d-b025-3262b9d414d9
Stacked on #2 (
redth-tizen-foundation-import). Independent of #5 — it touches nohandler or core code, only
src/Maui.Tizen.Essentials, a workload-free verificationharness, tests, and the minimum project wiring needed to run them.
What this does
Reworks the raw imported dotnet/maui
*.tizen.csEssentials fragments into a package thatcan actually ship out-of-tree, following the process
eng/targets/TizenPackage.propsdescribes:
EnableDefaultCompileItemsis flipped on for this one project and its sourcesare made to compile.
The fragments could never have compiled from here. They were
partialhalves ofMicrosoft.Maui.Essentialstypes, and C# cannot complete a partial type across an assemblyboundary. Each one is now an independently named
public sealedclass inMicrosoft.Maui.Platforms.Tizen.Essentialsimplementing the corresponding public contract —BatteryImplementationbecomesTizenBattery : IBattery, and so on.Integration model
AddTizenEssentials(MauiAppBuilder)registers every service as aTryAddsingleton, so anapplication can replace any individual implementation. That registration is the entire
integration surface:
facades during
MauiAppinitialization ([Extensibility] Essentials: Bridge DI implementations to static facades dotnet/maui#36657). This package therefore doesno
SetDefaultreflection. A test asserts the shipped assembly contains no reference toSetDefault/SetCurrentand no field-reflection entry points.MainThread.tizen.csis deliberately not ported. MAUI bridgesMainThreadfrom the registeredIDispatcherfor platform backends that are not in-box,so the Tizen dispatcher from the core work stays the single source of truth. A test
asserts the assembly never references
EcoreMainloop.TizenGeocodingis registered once and exposed as bothIGeocodingandIPlatformGeocodingresolving to the same instance, so a token forwarded by the bridge toIPlatformGeocodingis visible toIGeocodingconsumers.Screenshot
The upstream Tizen
Screenshotwas a stub whose every member threw. It is now a realimplementation over
Tizen.NUI.Captureplus theTizen.Multimedia.UtilPNG/JPEG encoders,exposed through the neutral
IScreenshotandIViewScreenshotcontracts.IPlatformScreenshotis intentionally not implemented: outside an in-box platform buildthat interface declares no members, so it carries no Tizen-typed contract. Tizen-typed
overloads live on
TizenScreenshotExtensionsinstead.Unsupported capabilities
Classified explicitly, per Tizen device profile, in
docs/tizen-essentials-service-coverage.md.Nothing returns a success-shaped fallback — no empty collections, no
null, no completedTaskstanding in for a capability the platform does not have.IClipboard,IAppActions,IPasskeys,IWebAuthenticatorandIAppleSignInAuthenticatorthrowFeatureNotSupportedExceptionnaming the capability and the reason. The matrix is assertedby tests against the real DI registrations, so it cannot drift.
Package baseline
Resolves the blocker this branch was carrying. The newest
Microsoft.Maui.*on nuget.org,11.0.0-preview.7.26406.9, was built 2026-08-06 and predates #36657 (merged 2026-08-18).The foundation's pin to
11.0.0-preview.7.26418.3on the dotnet11 public feed does containit, and this branch now builds against that.
Verification
src/Maui.Tizen.Essentials.HostVerificationeng/build-workload-free.sh(CI semantics, clean tree)src/Maui.Tizen.Essentialsbuilds fornet11.0-tizen11.0MAUITIZEN0001,samsung.net.sdk.tizen.manifest-11.0.100unpublishedThe blocked rows are external gates and are reported, not worked around. The workload gate
still fires exactly as
Directory.Build.targetsintends.src/Maui.Tizen.Essentials.HostVerificationexists so that gate does not also make theport unverifiable: it compiles the same sources against plain
net11.0plus the Tizen.NETpackage. It is not a neutral fallback — it is never packable, never published, and is
not a
ProjectReferencetarget for any Tizen project. If that distinction should be drawndifferently, this is the piece to push back on.
MAUI public API gaps found
Full table in the coverage doc. The one that blocks functionality:
Microsoft.Maui.Media.Localehas only aninternalconstructor.ITextToSpeechrequires returning
IEnumerable<Locale>andSpeechOptions.Localerequires being givenone, so no out-of-tree backend can participate in the locale half of the TTS contract.
GetLocalesAsyncthrows with an explicit reason;TizenTextToSpeech.GetSupportedVoiceLanguagesAsync()andSpeakAsync(text, language, rate, ct)expose the same capability. Worth an upstreamissue.
Non-blocking, each worked around:
FileMimeTypes,PlacemarkExtensions.GetEscapedAddress,AccelerometerQueue,DeviceDisplay.BaseLogicalDpiandUtils.ParseVersionare allinternal;Permissions.BasePlatformPermissionand the nestedPermissions.*types arepublicbutpartialper in-box platform; the Tizen members ofApplicationModel.Platformcannot be added from outside.Notes for review
*.tizen.csfragments undersrc/Maui.Tizen.Essentialsare deleted. They aresuperseded, unbuildable as-is, and preserved in history and
PROVENANCE.md.tests/Maui.Tizen.Essentials.Testsuses xunit v3, not the repo's v2 stack. Not apreference: the v2 runner enumerates assembly-level attributes across the loaded closure,
and
Tizen.NUI's[XmlnsDefinition]constructor P/Invokes and throws off-device. Thataborts discovery mid-class and silently drops the remaining tests while still reporting
success — it hid 4 tests before this was caught. The reasoning is recorded in
Directory.Packages.props.Maui.Tizen.slnx, packageversions in
Directory.Packages.props, and the two new projects ineng/build-workload-free.sh.Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com