Skip to content

Commit

Permalink
Fix unmute volume being completely broken (oops)
Browse files Browse the repository at this point in the history
  • Loading branch information
sommd committed May 13, 2021
1 parent 25990e3 commit f75085c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/xyz/sommd/automute/utils/AudioManager.kt
Expand Up @@ -67,11 +67,11 @@ fun AudioManager.unmute(
adjustStreamVolume(stream, AudioManager.ADJUST_UNMUTE, flags)

val volume = getVolume(stream)
if (getStreamVolume(stream) == 0) {
if (volume == 0f) {
log { "Unmuted to 0, setting to default volume" }

setVolume(defaultVolume, stream, show)
} else if (getStreamVolume(stream) > volume) {
} else if (volume > maximumVolume) {
log { "Unmuted above maximum, setting to maximum volume" }

setVolume(maximumVolume, stream, show)
Expand Down

0 comments on commit f75085c

Please sign in to comment.