Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Casanowow Life for love
VLC-Android
Commits
73845dd1
Commit
73845dd1
authored
Mar 30, 2018
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent crash on Oreo when app is in background
parent
e2aa54c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
...oid/src/org/videolan/vlc/RemoteControlClientReceiver.java
+8
-1
No files found.
vlc-android/src/org/videolan/vlc/RemoteControlClientReceiver.java
View file @
73845dd1
...
...
@@ -44,13 +44,20 @@ public class RemoteControlClientReceiver extends MediaButtonReceiver {
@Override
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
final
String
action
=
intent
.
getAction
();
if
(
action
==
null
)
return
;
final
KeyEvent
event
=
intent
.
getParcelableExtra
(
Intent
.
EXTRA_KEY_EVENT
);
if
(
event
!=
null
&&
action
.
equalsIgnoreCase
(
Intent
.
ACTION_MEDIA_BUTTON
))
{
if
(
event
.
getKeyCode
()
!=
KeyEvent
.
KEYCODE_HEADSETHOOK
&&
event
.
getKeyCode
()
!=
KeyEvent
.
KEYCODE_MEDIA_PLAY_PAUSE
)
{
super
.
onReceive
(
context
,
intent
);
if
(!
AndroidUtil
.
isOOrLater
||
VLCApplication
.
isForeground
())
super
.
onReceive
(
context
,
intent
);
else
if
(
event
.
getAction
()
==
KeyEvent
.
ACTION_DOWN
&&
event
.
getKeyCode
()
==
KeyEvent
.
KEYCODE_MEDIA_PLAY
)
{
intent
=
new
Intent
(
context
,
PlaybackService
.
class
);
intent
.
setAction
(
Constants
.
ACTION_REMOTE_PLAYPAUSE
);
Util
.
startService
(
context
,
intent
);
}
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment