yavsc/src/PostIt/PostIt.Android/PlatformBootstrap.cs
Paul Schneider ad92744a94
Some checks failed
Forgejo Release / release (push) Has been cancelled
Dotnet build and test / build (push) Successful in 21m51s
feat(android): share podcast playback and foreground broadcasting
Add native Camera2 capture, MPEG-TS segmentation and foreground service with notification stop. Reuse shared authenticated uploads and replay finalization, add capture regression tests and document platform limitations. Update Avalonia to 12.1.4.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-19 22:18:22 +01:00

32 lines
1.2 KiB
C#

using PostIt.Services;
using PostIt.Android.Services;
namespace PostIt.Android;
/// <summary>
/// One-shot platform bootstrap. Called from
/// <see cref="MainActivity.OnCreate"/> so that the shared OIDC login
/// path sees the Android-specific redirect URI and a working
/// <c>IBrowser</c> (Chrome Custom Tabs) without referencing Android
/// APIs from the shared library.
/// </summary>
internal static class PlatformBootstrap
{
internal static void InitPlatform()
{
Platform.CreateBrowser = () =>
{
var activity = MainActivity.Current;
return activity is null ? null : new AndroidSystemBrowser(activity);
};
Platform.TryGetCurrentLocationAsync = AndroidCurrentLocationProvider.TryGetCurrentLocationAsync;
Platform.CreateVideoSurface = player => new AndroidVideoSurface(player);
if (System.OperatingSystem.IsAndroidVersionAtLeast(26))
{
Platform.GetPodcastCaptureDevices = AndroidPodcastCapture.GetDevices;
Platform.RequestPodcastPermissionsAsync = AndroidPodcastCapture.RequestPermissionsAsync;
Platform.CreatePodcastCaptureAsync = AndroidPodcastCapture.StartAsync;
}
}
}