App does not record calls and save in app directory?

It was successfully recording and saving files in sd card yesterday but today I tried to change path and wanted to save file in app directory due to privacy and now it does not save files there. Directory has been created but no files. Also my service does not show recording started and recording stopped as it was showing the other day. Basically i have 2 problems here.
1- It does not record incoming and outgoing calls or atleast does not show it is recording and unable to save.
2- I am unable to debug it because i don’t know where to put breakpoint and where to check problem.

Here is my full code.

MainActivity (It has 3 textviews and a listview for getting files list):

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.io.IOException;

public class MainActivity extends AppCompatActivity {
TextView tvShow, tvShow2, tvShow3;
ListView lv;
ArrayAdapter adapter;
String path;
String pName;
String dataDir;
PackageManager pm;
PackageInfo pi;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    tvShow = (TextView) findViewById(R.id.tvShow);
    tvShow2 = (TextView) findViewById(R.id.tvShow2);
    tvShow3 = (TextView) findViewById(R.id.tvShow3);
    lv = (ListView) findViewById(R.id.lv);

    pm = getPackageManager();
    pName = getPackageName();

    try{
        pi = pm.getPackageInfo(pName, 0);
        dataDir = pi.applicationInfo.dataDir;
    }catch (PackageManager.NameNotFoundException e){
        Toast.makeText(this, " " + e, Toast.LENGTH_SHORT).show();
    }


    tvShow.setText(pName);
    tvShow2.setText("" + pi);
    tvShow3.setText("" + dataDir);

    path = dataDir + "/AudioRecorder/";

    File dir = new File(path);
    if(!dir.exists()){
        dir.mkdir();
    }
    final File[] filelist = dir.listFiles();
    String[] theNamesOfFiles = new String[filelist.length];
    for (int i = 0; i < theNamesOfFiles.length; i++) {
        theNamesOfFiles[i] = filelist[i].getName();
    }

    adapter = new ArrayAdapter<>(MainActivity.this, android.R.layout.simple_list_item_1, theNamesOfFiles);
    lv.setAdapter(adapter);

    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            String filepath = path + "/" + lv.getItemAtPosition(i);
            Intent it = new Intent(MainActivity.this, Player.class);
            it.putExtra("path", filepath);
            startActivity(it);
        }
    });
}

public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.main, menu);
    return true;
}


public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.setting) {
        startActivity(new Intent(MainActivity.this, Setting.class));
        return true;
    } else if (id == R.id.about) {

        Toast.makeText(this, "About Me", Toast.LENGTH_SHORT).show();
        return true;
    }

    return super.onOptionsItemSelected(item);
}
}

MyService (It is started by PhoneStateListerner class and it is supposed to record and save incoming and outgoing calls):

import android.app.Service;
import android.content.Intent;
import android.media.MediaRecorder;
import android.os.Environment;
import android.os.IBinder;
import android.widget.Toast;
import java.io.File;
import java.io.IOException;


public class MyService extends Service {
MediaRecorder mr;
boolean isRecording;

public MyService() {
}

@Override
public IBinder onBind(Intent intent) {
    // TODO: Return the communication channel to the service.
    throw new UnsupportedOperationException("Not yet implemented");
}

@Override
public void onCreate() {
    super.onCreate();
    mr = new MediaRecorder();
}

@Override
public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);

    startRecording();
}

@Override
public void onDestroy() {
    super.onDestroy();
    if (mr != null){
        isRecording = false;
        mr.release();
        Toast.makeText(this, "Recording Stopped", Toast.LENGTH_SHORT).show();
    }


}

public void startRecording() {

    mr.reset();
    mr.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
    mr.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
    mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    mr.setOutputFile(getFilename().toString());

    try {
        mr.prepare();
    } catch (IOException e) {
        e.printStackTrace();
    }
    try {
        mr.start();
        isRecording = true;
        Toast.makeText(this, "Recording Started", Toast.LENGTH_SHORT).show();

    } catch (Exception e) {
        e.printStackTrace();
    }

}


private String getFilename() {
    MainActivity ma = new MainActivity();
    String filepath = ma.dataDir;
    File file = new File(filepath, "AudioRecorder");


    if (!file.exists()) {
        file.mkdirs();
    }

    return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".amr");
}


}

PhoneListener (it listen to call states and start and stop MyService):

import android.content.Context;
import android.content.Intent;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.widget.Toast;


public class PhoneListener extends PhoneStateListener {
private Context c;
boolean wasRinging;

public PhoneListener(Context context){
    this.c = context;
}

public void onCallStateChanged(int state, String number) {

    switch (state) {
        case TelephonyManager.CALL_STATE_RINGING:
            wasRinging = true;
            Toast.makeText(c, "Call Ringing State from " + number, Toast.LENGTH_SHORT).show();
            break;
        case TelephonyManager.CALL_STATE_OFFHOOK:
            c.startService(new Intent(c, MyService.class));

            break;
        case TelephonyManager.CALL_STATE_IDLE:
            if (wasRinging){
                c.stopService(new Intent(c, MyService.class));

            }
    }
}
}

BroadcastReceiver (It is registered for two things. Outgoing calls and phone state):

import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;


public class Broad extends BroadcastReceiver {
String number;
TelephonyManager tm;

@Override
public void onReceive(Context context, Intent intent) {

    if (intent.getAction().equals(Intent.ACTION_NEW_OUTGOING_CALL)) {
        number = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER);

    }
        PhoneListener listener = new PhoneListener(context);
        tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        tm.listen(listener, PhoneStateListener.LISTEN_CALL_STATE);
}
}