Android Open Source - Interception Call Detect Service






From Project

Back to project page Interception.

License

The source code is released under:

# The Code Project Open License (CPOL) 1.02 ###Preamble This License governs Your use of the Work. This License is intended to allow developers to use the Source Code and Executable Files provided a...

If you think the Android project Interception listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.bitgriff.androidcalls;
//w ww . j  a  v a  2 s. co m
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;

/**
 * Call detect service. 
 * This service is needed, because MainActivity can lost it's focus,
 * and calls will not be detected.
 * 
 * @author Moskvichev Andrey V.
 *
 */
public class CallDetectService extends Service {
  private CallHelper callHelper;
    private Context ctx;
 
    public CallDetectService() {
    }

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    callHelper = new CallHelper(this);
    
    int res = super.onStartCommand(intent, flags, startId);
    callHelper.start();

    return res;
  }
  
    @Override
  public void onDestroy() {
    super.onDestroy();
    
    callHelper.stop();
  }

  @Override
    public IBinder onBind(Intent intent) {
    // not supporting binding
      return null;
    }
}




Java Source Code List

com.bitgriff.androidcalls.Block.java
com.bitgriff.androidcalls.BuildConfig.java
com.bitgriff.androidcalls.BuildConfig.java
com.bitgriff.androidcalls.CallDetectService.java
com.bitgriff.androidcalls.CallHelper.java
com.bitgriff.androidcalls.MainActivity.java
com.sparsa.write2file.write2file.java