Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a homescreen widget #144

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ object AudioServiceBackgroundIntent {
* Build a pending intent for the given [context] emulating a key-press of the given [keyEvent] to the AudioService.
*/
private fun getIntent(context: Context, keyEvent: KeyEvent): PendingIntent {
val intent = Intent(context, com.ryanheise.audioservice.AudioService::class.java)
val intent = Intent(context, com.ryanheise.audioservice.MediaButtonReceiver::class.java)
nt4f04uNd marked this conversation as resolved.
Show resolved Hide resolved
intent.action = Intent.ACTION_MEDIA_BUTTON
intent.putExtra(Intent.EXTRA_KEY_EVENT, keyEvent)
var flags = PendingIntent.FLAG_UPDATE_CURRENT
Expand All @@ -272,11 +272,7 @@ object AudioServiceBackgroundIntent {
} else {
intent.type = keyEvent.toString()
}
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
PendingIntent.getForegroundService(context, 0, intent, flags)
} else {
PendingIntent.getService(context, 0, intent, flags)
}
return PendingIntent.getBroadcast(context, 0, intent, flags)
}

/**
Expand Down