I have a simple test case to check if an outgoing call is initiated by pressing a button or not.
public void testCalling(){
IntentFilter callFilter = new IntentFilter();
callFilter.addAction(Intent.ACTION_CALL);
callFilter.addCategory(Intent.CATEGORY_DEFAULT);
callFilter.addDataScheme("tel:");
ActivityMonitor mMonitor = new ActivityMonitor(callFilter, null, false);
getInstrumentation().addMonitor(mMonitor);
mSolo.clickOnText("CALL");
assertTrue(0 < mMonitor.getHits());
sendKeys(KeyEvent.KEYCODE_ENDCALL);
}
Although the call is Intent (an outgoing call is being made), my ActivityMonitor cannot register it. Stack trace
05-28 17:11:09.183: I/ActivityManager(71): Starting activity: Intent { act=android.intent.action.CALL dat=tel:+xxxxxxx cmp=com.android.phone/.OutgoingCallBroadcaster }
Please, help
The only other resource I could find was this discussion, which ended without any solution in the Android development team.
source
share