Commit 33eb5c6c authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Get telephony manager with service context

parent ff9b3ddd
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment