UAStateReceiver.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:CSipSimple 作者:
/**
 * Broadcast to android system that we currently have a phone call. This may
 * be managed by other sip apps that want to keep track of incoming calls
 * for example.
 * 
 * @param state The state of the call
 * @param number The corresponding remote number
 */
private void broadCastAndroidCallState(String state, String number) {
    // Android normalized event
    if(!Compatibility.isCompatible(19)) {
        // Not allowed to do that from kitkat
        Intent intent = new Intent(ACTION_PHONE_STATE_CHANGED);
        intent.putExtra(TelephonyManager.EXTRA_STATE, state);
        if (number != null) {
            intent.putExtra(TelephonyManager.EXTRA_INCOMING_NUMBER, number);
        }
        intent.putExtra(pjService.service.getString(R.string.app_name), true);
        pjService.service.sendBroadcast(intent, android.Manifest.permission.READ_PHONE_STATE);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号