Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
3f29418d
Commit
3f29418d
authored
Feb 27, 2012
by
Sébastien Toque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a crash if an activity is opened/closed/rotated too quickly
parent
106ef3d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
vlc-android/src/org/videolan/vlc/AudioServiceController.java
vlc-android/src/org/videolan/vlc/AudioServiceController.java
+7
-3
No files found.
vlc-android/src/org/videolan/vlc/AudioServiceController.java
View file @
3f29418d
...
...
@@ -117,6 +117,8 @@ public class AudioServiceController implements IAudioPlayerControl {
@Override
public
void
onServiceConnected
(
ComponentName
name
,
IBinder
service
)
{
if
(!
mIsBound
)
// Can happen if unbind is called quickly before this callback
return
;
Log
.
d
(
TAG
,
"Service Connected"
);
mAudioServiceBinder
=
IAudioService
.
Stub
.
asInterface
(
service
);
...
...
@@ -135,7 +137,8 @@ public class AudioServiceController implements IAudioPlayerControl {
}
else
{
// Register controller to the service
try
{
mAudioServiceBinder
.
addAudioCallback
(
mCallback
);
if
(
mAudioServiceBinder
!=
null
)
mAudioServiceBinder
.
addAudioCallback
(
mCallback
);
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"remote procedure call failed: addAudioCallback()"
);
}
...
...
@@ -150,13 +153,14 @@ public class AudioServiceController implements IAudioPlayerControl {
context
=
context
.
getApplicationContext
();
if
(
mIsBound
)
{
mIsBound
=
false
;
try
{
mAudioServiceBinder
.
removeAudioCallback
(
mCallback
);
if
(
mAudioServiceBinder
!=
null
)
mAudioServiceBinder
.
removeAudioCallback
(
mCallback
);
}
catch
(
RemoteException
e
)
{
Log
.
e
(
TAG
,
"remote procedure call failed: removeAudioCallback()"
);
}
context
.
unbindService
(
mAudioServiceConnection
);
mIsBound
=
false
;
mAudioServiceBinder
=
null
;
mAudioServiceConnection
=
null
;
}
...
...
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