Generic Intent to Get Call Data on Demand
The Voice Client exposed the following intent com.zebra.wfc.voice.GET_INFO to get the specific category of call-data count from the Voice Client on-demand basis. Any third-party applications need to follow the following-mentioned steps to get the count from the Voice Client.
Intent i= new Intent("com.zebra.wfc.voice.GET_INFO"); i.putExtra("call_type", "MISSED"); //Same can be done for other call_type as well sendBroadcast(i);
Register and Listen to the Following Broadcast
IntentFilter call_info= new IntentFilter();
call_info.addAction("com.zebra.wfc.voice.CALL_INFO");
registerReceiver(mReceiver,call_info);
public void onReceive(Context context, Intent intent) {
String action= intent.getAction();
if(action.equals("com.zebra.wfc.voice.CALL_INFO")) {
if (intent.hasExtra("MISSED")) { //Same can be done for other call_type as well
count = intent.getIntExtra("MISSED", 0);
Log.d("Call data:- "+count)
} // ERROR handling
if(intent.hasExtra("ERROR")){
String error= "ERROR: " + intent.getStringExtra("ERROR");
Log.d(TAG,error);
}
}
}
The above example shows that after following the above steps, any 3rd party application can trigger an intent to receive a specific call count from Voice Client.