решение Java, это не проблема:Как программно отклонить (повесить) входящий звонок на Android в Delphi?
public boolean killCall(Context context) {
try {
// Get the boring old TelephonyManager
TelephonyManager telephonyManager =
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
// Get the getITelephony() method
Class classTelephony = Class.forName(telephonyManager.getClass().getName());
Method methodGetITelephony = classTelephony.getDeclaredMethod("getITelephony");
// Ignore that the method is supposed to be private
methodGetITelephony.setAccessible(true);
// Invoke getITelephony() to get the ITelephony interface
Object telephonyInterface = methodGetITelephony.invoke(telephonyManager);
// Get the endCall method from ITelephony
Class telephonyInterfaceClass =
Class.forName(telephonyInterface.getClass().getName());
Method methodEndCall = telephonyInterfaceClass.getDeclaredMethod("endCall");
// Invoke endCall()
methodEndCall.invoke(telephonyInterface);
} catch (Exception ex) { // Many things can go wrong with reflection calls
Log.d(TAG,"PhoneStateReceiver **" + ex.toString());
return false;
}
return true;
}
Но как сделать такое же решение в Delphi?
К сожалению, я не нашёл ни одного руководства, чтобы решить эту проблему.
Прошу прощения, но почему вы не используете код Java? –
@PedroLobito Потому что он делает свое развитие в Delphi, а не в Java? –
Мне нужно это в одном приложении, которое написано (и должно быть) в Delphi. –