Commit Graph
256 Commits
Author SHA1 Message Date
Michatec 0e736db75c feat: optimize station image retrieval for IPC
- Update `ImageHelper.getStationImageAsByteArray` to support downsampling and JPEG compression for IPC transmission.
- Add `SIZE_STATION_IMAGE_API` constant for consistent image scaling.
- Refactor `PlayerService` to use downsampled images when fetching via `Binder` API.
- Improve thread safety in `PlayerService` station image lookup by consolidating I/O operations and avoiding main-thread access when possible.
2026-11-15 17:34:40 +01:00
Michatec c3d351f646 refactor: remove AIDL custom permission requirement
- Remove `com.michatec.radio.permission.CONTROL_RADIO_API` definition and usage.
- Update `RadioApiService` to remove the permission constraint and add `tools:ignore="ExportedService"`.
- Remove corresponding documentation and usage in `AIDL_API.md`.
2026-11-15 17:20:10 +01:00
Michatec 4d1b2ed365 refactor: remove protectionLevel from CONTROL_RADIO_API permission
Remove the redundant `android:protectionLevel="normal"` attribute from the custom AIDL permission declaration in the manifest.
2026-11-15 17:09:26 +01:00
Michatec 02c088fd6b refactor: optimize thread management in PlayerService image fetching
- Remove `runBlocking(Main)` from `getCurrentStationImage` to avoid blocking the main thread.
- Update `getStationImageByUuid` to use `Dispatchers.IO` for file operations.
- Add check to perform image loading on the main thread if already called from the main looper.
2026-11-15 16:50:03 +01:00
Michatec 66b6e58631 fix: switch runBlocking context to Main for image retrieval in PlayerService
- Change `runBlocking` dispatcher from `IO` to `Main` in `getCurrentStationImage` and `getStationImageByUuid` to ensure safe access to player state and service context.
2026-11-15 16:35:56 +01:00
Michatec d744b777ec fix: offload image retrieval to Dispatchers.IO in PlayerService
- Replace `runBlocking(Main)` with `runBlocking(Dispatchers.IO)` in `getCurrentStationImage` and `getStationImageByUuid` to prevent potential UI thread blocking during file I/O.
2026-11-15 16:24:23 +01:00
Michatec cecb97f5a1 refactor: remove unused Uri import in RadioApiService 2026-11-15 16:08:31 +01:00
Michatec b565a0ff58 feat: migrate station image retrieval from URI to byte array
- Update AIDL interface methods `getCurrentStationImage` and `getStationImageByUuid` to return `byte[]` instead of `String`.
- Implement `ImageHelper.getStationImageAsByteArray` to handle the conversion of station image URIs to byte arrays.
- Refactor `PlayerService` and `RadioApiService` to support binary image data retrieval, removing redundant file/URI logic in the service wrapper.
2026-11-15 16:07:56 +01:00
Michatec 6c3b6ba21d fix: use runBlocking(Main) for thread dispatching in PlayerService binder methods
- Replace custom CountDownLatch and Handler synchronization with `runBlocking(Main)` in PlayerService binder methods (`isPlaying`, `getCurrentStationName`, `getCurrentMetadata`).
- Add intent query for `IRadioApi` to package visibility configuration in AIDL documentation.
2026-11-15 15:37:29 +01:00
Michatec 2619675118 feat: implement WebDAV cloud sync, AppFunctions, and Quick Settings tile
- Add `WebDavSyncHelper` and `CryptoHelper` to support encrypted WebDAV cloud backup and restore in settings.
- Implement `RadioAppFunctionService` and voice search intent handling for system and assistant integrations.
- Add `RadioTileService` to provide a Quick Settings tile for playback control and status.
- Expand `IRadioApi` AIDL interface to support fetching station cover image URIs.
2026-11-15 15:19:51 +01:00
Michatec 1a214d1683 feat: implement station stream health checking
- Add `StationHealthChecker` to asynchronously test station stream availability, response codes, and latency.
- Add long-click listener on the save button in `CollectionAdapter` to trigger health checks and display results via `Snackbar`.
- Add localized string resources for stream health check status UI messages.
- Update `provider_paths.xml` to include internal files and cache directory paths for FileProvider.
2026-11-05 18:12:39 +01:00
Michatec d69a8dfe77 fix: station UUID existence validation before playback 2026-10-31 23:53:43 +01:00
Michatec d80e5e2e17 fix: dispatch PlaybackController calls to main thread 2026-10-31 23:24:23 +01:00
Michatec ba1dd4e9eb fix: remove runBlocking(Main) from PlaybackController to prevent main thread deadlock 2026-10-31 23:09:36 +01:00
Michatec 0f6f774e73 feat: implement intent-based playback control for PlayerService
- Add handling for `PLAY` and `PLAY_STATION` actions in `PlayerService.onStartCommand`.
- Update `RadioApiService` to trigger playback via intents when `playbackController` is not yet initialized.
- Add `startPlayerService` helper method in `RadioApiService` to encapsulate service starting logic.
2026-10-31 22:42:41 +01:00
Michatec e315c7a037 test: include Android resources in unit tests
- Set `isIncludeAndroidResources` to `true` within `testOptions` in `app/build.gradle.kts`.
2026-10-31 22:35:52 +01:00
Michatec a9a228bba2 refactor: remove artificial delay when starting playback in RadioApiService
- Remove 500ms delay when calling `play()` and `playStationByUuid()`.
- Remove unused `Handler`, `Looper`, and `Keys` imports.
- Reorder helper imports for consistency.
2026-10-31 22:25:05 +01:00
Michatec 91c33d4abf fix: delay playback initiation and use playbackController directly
- Add a 500ms delay using `Handler` before triggering playback actions to ensure controller availability.
- Remove `EXTRA_STATION_UUID` from the `PlayerService` start intent.
- Transition to calling `playbackController.play()` and `playbackController.playStationByUuid(uuid)` directly.
2026-10-31 22:08:03 +01:00
Michatec aec4fadf18 refactor: remove intent-based play commands from PlayerService
- Remove `EXTRA_PLAY_COMMAND`, `PLAY_COMMAND_PLAY`, and `PLAY_COMMAND_PLAY_STATION` constants from `Keys.kt`.
- Remove manual play command handling in `PlayerService.onStartCommand`.
- Simplify `PlayerService` start intents in `RadioApiService` by removing unnecessary play command extras.
2026-10-31 21:57:22 +01:00
Michatec 04a1aa3dde feat: implement command-based playback triggering in PlayerService
- Add `EXTRA_PLAY_COMMAND`, `PLAY_COMMAND_PLAY`, and `PLAY_COMMAND_PLAY_STATION` constants to `Keys.kt`.
- Update `PlayerService.onStartCommand` to process playback commands from intent extras.
- Modify `RadioApiService` to pass playback commands when starting `PlayerService`.
2026-10-31 21:43:48 +01:00
Michatec f2d926d8ba fix: use media title for current track metadata
- Update `PlayerService` to return the media title instead of artist in `getCurrentMetadata`.
- Refactor `RemoteControlServer` to retrieve `currentTrack` directly from media metadata instead of loading from metadata history.
2026-10-31 21:22:29 +01:00
Michatec 008ac4bc34 fix: prevent station name from being added to metadata history
- Skip adding metadata to the history list if the metadata string matches the current station name.
- Move `currentMediaItem` retrieval earlier in the processing logic to facilitate the station name comparison.
2026-10-31 21:07:47 +01:00
Michatec 33ff113989 feat: implement metadata history tracking and UI updates
- Add `updateMetadata` function to `LayoutHolder` to handle metadata persistence in `metadataHistory` and update UI views.
- Implement `onMediaMetadataChanged` in `PlayerFragment` to trigger metadata updates from the media controller.
- Integrate history management logic to save unique metadata entries and enforce maximum history size via `PreferencesHelper`.
2026-10-31 21:01:56 +01:00
Michatec eed4b097b8 fix: improve station name retrieval for media metadata updates
- Update `PlayerService.kt` to fetch the station name from the collection using `mediaId` via `CollectionHelper`.
- Fall back to the existing artist metadata if the retrieved station name is empty.
2026-10-31 20:42:39 +01:00
Michatec 34aa8cde03 feat: update media metadata dynamically during playback
- Update the current `MediaItem` in `PlayerService.kt` when new metadata is received.
- Set the original station name as the artist and the new metadata string as the title and display title.
- Replace the current media item in the player to ensure UI components reflect the updated metadata.
2026-10-31 20:34:22 +01:00
Michatec 0125e97307 fix: execute PlaybackController methods on the main thread
- Wrap all overridden methods in `RadioApiService.PlaybackController` with `runBlocking(Main)`.
- Ensure player operations and media metadata retrievals in `PlayerService` execute safely on the main thread.
2026-10-31 19:57:42 +01:00
Michatec 143484a37f feat: add AIDL API service and refactor Shizuku power management
- Introduce the `IRadioApi` AIDL interface and `RadioApiService` to support external IPC playback control and station metadata retrieval.
- Connect `PlayerService` to `RadioApiService` using an internal `PlaybackController` callback interface.
- Extract background battery optimization logic from `Shizuku` into a dedicated `RadioPowerManager` class featuring atomic backup, restoration, and rollback capabilities.
- Update `ShizukuFragment` to execute power optimization tasks asynchronously via Kotlin coroutines.
- Enable AIDL feature support in Gradle, add documentation in `API_DOC.md`, and include `junit` and `mockito-core` test dependencies.
2026-10-31 19:35:16 +01:00
Michatec f1810dcd20 feat: add Shizuku integration for background playback optimization
- Implement `Shizuku` helper and `ShizukuFragment` using Jetpack Compose to manage system permissions and Doze mode battery optimization whitelisting.
- Add Shizuku API and provider dependencies, manifest provider configuration, vector icon, and localized strings.
- Add Shizuku preference entry to `SettingsFragment` and navigation graph.
- Update QR code verification logic to show a toast message on Android TV instead of hiding the preference.
2026-10-29 19:48:21 +01:00
Michatec 8640368a50 refactor: cleanup constants and simplify preference logic
- Remove unused `ACTION_REMOTE_SERVER_ERROR` and `ACTION_REMOTE_AUTH_FAILED` constants from `Keys.kt`.
- Simplify `constantTimeEquals` implementation in `SettingsFragment.kt`.
- Refactor `preferenceEnableEditingStreamUri` enablement logic to use a concise boolean expression.
2026-10-24 19:43:13 +02:00
Michatec 575af5f53a refactor: replace LocalBroadcastManager with AppEventBus for internal communication 2026-10-22 14:47:52 +02:00
Michatec 36b108f1d6 Merge remote-tracking branch 'origin/main' 2026-09-30 09:31:29 +02:00
Michatec 65045c4387 docs: update pairing documentation and adjust settings UI layout
- Rename "server app" to "Radio app" in pairing documentation.
- Simplify security warning in documentation.
- Fix grammar (short-lived).
- Unconditionally add QR verification preference to the Remote Control settings category.
2026-09-30 09:31:10 +02:00
Michachatz a46f227a33 Enable hardware acceleration in AndroidManifest.xml 2026-09-30 07:24:57 +02:00
Michatec 75e839d5cc feat: implement QR code pairing for remote control
- Add `QrCaptureActivity` to support scanning QR codes for authentication.
- Implement `PairingManager` to handle short-lived pairing sessions.
- Expose new API endpoints for pairing start, status polling, and QR image generation.
- Add UI modal to the web interface for pairing code input and QR code display.
- Increase Gradle JVM heap size to 4096m.
- Include necessary permissions and dependencies for barcode scanning.
2026-09-29 19:38:39 +02:00
Michatec 6f59fd95a9 refactor(layout): rename loading_layout ID to loadingLayout in activity_main.xml 2026-09-29 17:08:59 +02:00
Michatec 8298a1cae8 refactor: import Collection in RemoteControlServer 2026-09-29 16:41:45 +02:00
Michatec 21b5bdacb0 refactor: move web assets into css and js subdirectories 2026-09-17 15:55:10 +02:00
Michatec 8056299177 feat(web): add web streaming support and refactor frontend modules
- Implement `/api/stream` endpoint to provide the current station's audio URI.
- Refactor the frontend into modular `api.js`, `ui.js`, and `script.js` files.
- Add a "Listen on Web" feature to play radio streams directly in the browser.
- Update the backend to serve and whitelist new JavaScript assets.
- Add multi-language translations for the web streaming toggle.
2026-09-17 15:50:32 +02:00
Michatec 642018b965 chore: convert launcher and banner icons from PNG to WebP 2026-09-17 14:11:11 +02:00
Michatec 5e66fc35d3 chore: downgrade Java compatibility to v21 and update packaging excludes 2026-09-17 14:05:27 +02:00
Michatec 0b4f85c9b3 chore: update java-jdk to v25 and exclude native-image resources 2026-09-17 13:52:55 +02:00
Michatec bf02145c79 chore: simplify license resource exclusions using wildcard 2026-09-17 13:38:31 +02:00
Michachatz a305caf376 Fix exclude path for LICENSE.base64.txt 2026-09-17 13:19:39 +02:00
Michachatz d0f713d4bf Remove exclusion for LICENSE.base64.txt 2026-09-17 13:10:39 +02:00
Michachatz 10c9759587 Remove exclusion for LICENSE.webbit.txt 2026-09-17 13:03:43 +02:00
Michachatz 2e7c7d72cf Exclude LICENSE.jbzip2.txt from packaging resources 2026-09-17 12:56:03 +02:00
Michatec 98754f9782 refactor(ui): optimize theme calculation and handle cast session termination
- Wrap color scheme calculation in `remember` to prevent unnecessary recomputations in `AppTheme`.
- Add a `SessionManagerListener` to `CustomCastControllerDialogFragment` to automatically dismiss the dialog when a cast session ends or is suspended.
- Clean up imports in `CustomCastControllerDialogFragment`.
2026-09-16 19:03:47 +02:00
Michatec 45dafe486d feat(ui): migrate cast dialogs to Compose and refactor app theme logic
- Migrate `CustomCastChooserDialogFragment` and `CustomCastControllerDialogFragment` from View-based to Jetpack Compose.
- Create `CastComposables.kt` containing new Compose UI for Cast device selection and volume control.
- Remove legacy XML layouts `dialog_cast_chooser.xml`, `dialog_cast_connected.xml`, and `item_cast_device.xml`.
- Refactor `AppTheme.kt` to simplify color scheme logic and wrap content in a `Surface`.
- Add `ic_shader_24dp.xml` and update the shader effect preference icon in `SettingsFragment`.
- Adjust `windowLightStatusBar` and `windowLightNavigationBar` in night theme styles.
2026-09-16 18:45:36 +02:00
Michatec 7345c3e52f feat: add shader effect toggle in settings
- Add `PREF_SHADER_EFFECT` key and helper method to `PreferencesHelper`.
- Implement visibility and animation logic in `LayoutHolder` based on the shader effect preference.
- Add "Shader Effect" switch preference to `SettingsFragment`.
- Update `PlayerFragment` to refresh views when the shader effect setting changes.
- Add localized strings for the new setting in multiple languages.
2026-09-16 18:01:36 +02:00
Michatec df498d8592 Bump version to 15.2 and update Java compatibility to version 21 2026-08-29 18:21:22 +03:00