I am trying to use Java reflection to access CallManager and detect the call state which I always get the call idle. Please help me on this. Btw I use the following code to access CallManager:
try{
class classCallManager = class.forname("com.android.internal.telephony.CallManager");
Method methodGetInstance = classCallManager .getDeclaredMethod("getInstance");
methodGetInstance.setAccessible(true);
Object objectCallManager = methodGetInstance.invoke(null);
Method methodGetActiveFgCallState = classCallManager.getDeclaredMethod("getActiveFgCallState");
}catch (Exception e) {}