[Android] Get telephony manager with service context
Geoffrey Métais
git at videolan.org
Wed Mar 7 15:22:55 CET 2018
vlc-android | branch: 3.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 7 15:14:06 2018 +0100| [ea6b9f604afbc9aaf270e46b040652f66c767fa7] | committer: Geoffrey Métais
Get telephony manager with service context
(cherry picked from commit 33eb5c6ccf91da9f445030aebbeb459798826e5c)
> https://code.videolan.org/videolan/vlc-android/commit/ea6b9f604afbc9aaf270e46b040652f66c767fa7
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index fa58444d9..768cd18a8 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -434,7 +434,7 @@ public class PlaybackService extends MediaBrowserServiceCompat{
final int state = intent.getIntExtra("state", 0);
// skip all headsets events if there is a call
- final TelephonyManager telManager = (TelephonyManager) VLCApplication.getAppContext().getSystemService(Context.TELEPHONY_SERVICE);
+ final TelephonyManager telManager = (TelephonyManager) PlaybackService.this.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
if (telManager != null && telManager.getCallState() != TelephonyManager.CALL_STATE_IDLE) return;
/*
More information about the Android
mailing list