From b6b3c107f9e65b60386ccc83211802f705515a6f Mon Sep 17 00:00:00 2001
From: Evan Debenham <Evan@ShatteredPixel.com>
Date: Wed, 13 Nov 2019 18:53:40 -0500
Subject: [PATCH] v0.8.0: removed android call state listener functionality
 (was buggy)

---
 .../android/AndroidGame.java                  | 27 +------------------
 1 file changed, 1 insertion(+), 26 deletions(-)

diff --git a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java
index 04cbe92f6..379ab5efc 100644
--- a/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java
+++ b/android/src/main/java/com/shatteredpixel/shatteredpixeldungeon/android/AndroidGame.java
@@ -21,14 +21,11 @@
 
 package com.shatteredpixel.shatteredpixeldungeon.android;
 
-import android.app.Activity;
 import android.content.pm.ActivityInfo;
 import android.content.pm.PackageManager;
 import android.opengl.GLSurfaceView;
 import android.os.Build;
 import android.os.Bundle;
-import android.telephony.PhoneStateListener;
-import android.telephony.TelephonyManager;
 
 import com.badlogic.gdx.Files;
 import com.badlogic.gdx.backends.android.AndroidApplication;
@@ -36,7 +33,6 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
 import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
 import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
 import com.watabou.noosa.Game;
-import com.watabou.noosa.audio.Music;
 import com.watabou.utils.FileUtils;
 
 public class AndroidGame extends AndroidApplication {
@@ -95,28 +91,7 @@ public class AndroidGame extends AndroidApplication {
 		initialize(new ShatteredPixelDungeon(support), config);
 		
 		view = (GLSurfaceView)graphics.getView();
-		
-		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
-			TelephonyManager mgr =
-					(TelephonyManager) instance.getSystemService(Activity.TELEPHONY_SERVICE);
-			mgr.listen(new PhoneStateListener(){
-				
-				@Override
-				public void onCallStateChanged(int state, String incomingNumber)
-				{
-					if( state == TelephonyManager.CALL_STATE_RINGING ) {
-						Music.INSTANCE.pause();
-						
-					} else if( state == TelephonyManager.CALL_STATE_IDLE ) {
-						if (!Game.instance.isPaused()) {
-							Music.INSTANCE.resume();
-						}
-					}
-					
-					super.onCallStateChanged(state, incomingNumber);
-				}
-			}, PhoneStateListener.LISTEN_CALL_STATE);
-		}
+
 	}
 	
 	@Override