Skip to content

Comments

[fix] Sleep Timer#30

Merged
Steve-Mr merged 6 commits intomainfrom
dev
Sep 7, 2025
Merged

[fix] Sleep Timer#30
Steve-Mr merged 6 commits intomainfrom
dev

Conversation

@Steve-Mr
Copy link
Owner

@Steve-Mr Steve-Mr commented Sep 6, 2025

  1. Add back sleep timer notification channel
  2. The BROADCAST_ACTION_MUTE is now handled by the ForegroundService instead of the MuteMediaReceiver
  3. Upgrade Dependency

Steve-Mr added 5 commits July 26, 2025 11:28
This commit updates the Android Gradle Plugin and Gradle Wrapper versions:

- **Android Gradle Plugin:** Upgraded from version `8.9.3` to `8.11.1`.
- **Gradle Wrapper:** Updated `distributionUrl` from `gradle-8.11.1-bin.zip` to `gradle-8.13-bin.zip`.
This commit updates the Android SDK versions in `app/build.gradle`:
- `compileSdk` is changed from 35 to 36.
- `targetSdk` is changed from 35 to 36.
This commit updates various dependencies to their latest versions:

- **Kotlin:**
    - `org.jetbrains.kotlin.android` plugin to `2.2.0`
    - `org.jetbrains.kotlin.plugin.compose` plugin to `2.2.0`
- **Dagger Hilt:**
    - `com.google.dagger.hilt.android` plugin to `2.57`
    - `com.google.dagger:hilt-android` to `2.57`
    - `com.google.dagger:hilt-compiler` to `2.57`
- **AndroidX Lifecycle:**
    - All `androidx.lifecycle` artifacts to `2.9.2`
- **AndroidX Compose:**
    - `androidx.compose:compose-bom` to `2025.07.00`
    - `androidx.compose.material3:material3` to `1.4.0-alpha18`
- **AndroidX Databinding:**
    - `androidx.databinding:databinding-runtime` to `8.11.1`
This commit updates various dependencies to their latest versions:

- **Kotlin:**
    - `org.jetbrains.kotlin.android` plugin to `2.2.0`
    - `org.jetbrains.kotlin.plugin.compose` plugin to `2.2.0`
- **Dagger Hilt:**
    - `com.google.dagger.hilt.android` plugin to `2.57`
    - `com.google.dagger:hilt-android` to `2.57`
    - `com.google.dagger:hilt-compiler` to `2.57`
- **AndroidX Lifecycle:**
    - All `androidx.lifecycle` artifacts to `2.9.2`
- **AndroidX Compose:**
    - `androidx.compose:compose-bom` to `2025.07.00`
    - `androidx.compose.material3:material3` to `1.4.0-alpha18`
- **AndroidX Databinding:**
    - `androidx.databinding:databinding-runtime` to `8.11.1`
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @Steve-Mr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on restoring a critical notification channel for the sleep timer functionality and performing a comprehensive update of the project's dependencies. These changes aim to improve user experience by ensuring proper notification delivery and enhance application stability and performance by leveraging the latest library versions.

Highlights

  • Sleep Timer Notification: Re-enabled the dedicated notification channel for the sleep timer feature, ensuring users receive relevant alerts and the functionality is properly integrated with Android's notification system.
  • Dependency Upgrades: Performed a comprehensive update of various project dependencies and SDK versions to their latest stable releases, including Android SDK, Compose BOM, Material3, Lifecycle components, Hilt, WorkManager, and testing libraries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds back the sleep timer notification channel and upgrades several dependencies, including the Android Gradle Plugin, Kotlin, and various AndroidX libraries. The changes are straightforward and look good. I've added one suggestion to use a more modern, type-safe API for retrieving a system service, which will improve code quality.

// Register the channel with the system
val notificationManager: NotificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
getSystemService(NOTIFICATION_SERVICE) as NotificationManager

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better type safety and to avoid casting, it's recommended to use the typed getSystemService(Class<T>) method. This removes the need for as NotificationManager. You can then also simplify the variable declaration on the previous line by removing the explicit type and letting it be inferred, combining the declaration and assignment.

Suggested change
getSystemService(NOTIFICATION_SERVICE) as NotificationManager
getSystemService(NotificationManager::class.java)

This commit refactors the media muting functionality:

- The `BROADCAST_ACTION_MUTE` is now handled by the `ForegroundService` instead of the `MuteMediaReceiver`.
- A new action `ACTION_MUTE_MEDIA` is defined in `ForegroundService` for this purpose.
- The `MuteMediaReceiver` now sends an intent to `ForegroundService` when `BROADCAST_ACTION_MUTE` is received.
- The `ForegroundService` handles the audio focus request and volume reduction.
- The PendingIntent for muting media in the notification now targets the `ForegroundService` using `PendingIntent.getService`.
- The `versionName` in `app/build.gradle` has been updated to `2025.09.07`.
@Steve-Mr Steve-Mr merged commit 45d196e into main Sep 7, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant