Due to the design of Android, PhoneCallReceiver have to be a BroadcastReceiver. It can’t be a reciever registered with one app because the receiver may be run without our app being run, so we’d have to register in manifest. But I want the heavy lifting to be done by a library class(which we will be creating below)- I just want to derive from something and override a few functions. So ideally we have something like:
public abstract class PhonecallReceiver extends BroadcastReceiver {
protected void onIncomingCallStarted(Context ctx, String number, Date start);
protected void onOutgoingCallStarted(Context ctx, String number, Date start);