unit uATTelephonyManager;
{$mode delphi}
interface
uses
Classes, SysUtils, And_jni, AndroidWidget,
Laz_And_Controls, uAndroidCommon;
type
{ jTelephonyManager }
jTelephonyManager=class(jCommon)
protected
const CClassPath:string='android/telephony/TelephonyManager';
protected
{Shared by *all* jTelephonyManager instances}
FjClass:jObject;static;
FInitialized:boolean;static;
//MethodId fields
jMethodId_getPhoneCount:jmethodID;static;
jMethodId_createForSubscriptionId:jmethodID;static;
jMethodId_getDeviceSoftwareVersion:jmethodID;static;
jMethodId_getDeviceId1:jmethodID;static;
jMethodId_getDeviceId2:jmethodID;static;
jMethodId_getCellLocation:jmethodID;static;
jMethodId_getNeighboringCellInfo:jmethodID;static;
jMethodId_getPhoneType:jmethodID;static;
jMethodId_getNetworkOperatorName:jmethodID;static;
jMethodId_getNetworkOperator:jmethodID;static;
jMethodId_isNetworkRoaming:jmethodID;static;
jMethodId_getNetworkCountryIso:jmethodID;static;
jMethodId_getNetworkType:jmethodID;static;
jMethodId_getDataNetworkType:jmethodID;static;
jMethodId_getVoiceNetworkType:jmethodID;static;
jMethodId_hasIccCard:jmethodID;static;
jMethodId_getSimState:jmethodID;static;
jMethodId_getSimOperator:jmethodID;static;
jMethodId_getSimOperatorName:jmethodID;static;
jMethodId_getSimCountryIso:jmethodID;static;
jMethodId_getSimSerialNumber:jmethodID;static;
jMethodId_getSubscriberId:jmethodID;static;
jMethodId_getGroupIdLevel1:jmethodID;static;
jMethodId_getLine1Number:jmethodID;static;
jMethodId_setLine1NumberForDisplay:jmethodID;static;
jMethodId_getVoiceMailNumber:jmethodID;static;
jMethodId_setVoiceMailNumber:jmethodID;static;
jMethodId_getVoiceMailAlphaTag:jmethodID;static;
jMethodId_getCallState:jmethodID;static;
jMethodId_getDataActivity:jmethodID;static;
jMethodId_getDataState:jmethodID;static;
jMethodId_listen:jmethodID;static;
jMethodId_isVoiceCapable:jmethodID;static;
jMethodId_isSmsCapable:jmethodID;static;
jMethodId_getAllCellInfo:jmethodID;static;
jMethodId_getMmsUserAgent:jmethodID;static;
jMethodId_getMmsUAProfUrl:jmethodID;static;
jMethodId_iccOpenLogicalChannel:jmethodID;static;
jMethodId_iccCloseLogicalChannel:jmethodID;static;
jMethodId_iccTransmitApduLogicalChannel:jmethodID;static;
jMethodId_iccTransmitApduBasicChannel:jmethodID;static;
jMethodId_iccExchangeSimIO:jmethodID;static;
jMethodId_sendEnvelopeWithStatus:jmethodID;static;
jMethodId_getIccAuthentication:jmethodID;static;
jMethodId_setPreferredNetworkTypeToGlobal:jmethodID;static;
jMethodId_hasCarrierPrivileges:jmethodID;static;
jMethodId_setOperatorBrandOverride:jmethodID;static;
jMethodId_canChangeDtmfToneLength:jmethodID;static;
jMethodId_isWorldPhone:jmethodID;static;
jMethodId_isTtyModeSupported:jmethodID;static;
jMethodId_isHearingAidCompatibilitySupported:jmethodID;static;
jMethodId_getVoicemailRingtoneUri:jmethodID;static;
jMethodId_isVoicemailVibrationEnabled:jmethodID;static;
protected
class function get_jClass:jobject;override;
class procedure get_jIDs;override;
public
constructor Create(AjObject:jObject=nil);overload;
class procedure Init;
public
//Procs
function getPhoneCount:jint;
function createForSubscriptionId(_subId:jint):jobject;
function getDeviceSoftwareVersion:String;
function getDeviceId:String;overload;
function getDeviceId(_slotId:jint):String;overload;
function getCellLocation:jobject;
function getNeighboringCellInfo:jobject;
function getPhoneType:jint;
function getNetworkOperatorName:String;
function getNetworkOperator:String;
function isNetworkRoaming:boolean;
function getNetworkCountryIso:String;
function getNetworkType:jint;
function getDataNetworkType:jint;
function getVoiceNetworkType:jint;
function hasIccCard:boolean;
function getSimState:jint;
function getSimOperator:String;
function getSimOperatorName:String;
function getSimCountryIso:String;
function getSimSerialNumber:String;
function getSubscriberId:String;
function getGroupIdLevel1:String;
function getLine1Number:String;
function setLine1NumberForDisplay(_alphaTag:String;_number:String):boolean;
function getVoiceMailNumber:String;
function setVoiceMailNumber(_alphaTag:String;_number:String):boolean;
function getVoiceMailAlphaTag:String;
function getCallState:jint;
function getDataActivity:jint;
function getDataState:jint;
procedure listen(_listener:jobject;_events:jint);
function isVoiceCapable:boolean;
function isSmsCapable:boolean;
function getAllCellInfo:jobject;
function getMmsUserAgent:String;
function getMmsUAProfUrl:String;
function iccOpenLogicalChannel(_AID:String):jobject;
function iccCloseLogicalChannel(_channel:jint):boolean;
function iccTransmitApduLogicalChannel(_channel:jint;_cla:jint;_instruction:jint;_p1:jint;_p2:jint;_p3:jint;_data:String):String;
function iccTransmitApduBasicChannel(_cla:jint;_instruction:jint;_p1:jint;_p2:jint;_p3:jint;_data:String):String;
function iccExchangeSimIO(_fileID:jint;_command:jint;_p1:jint;_p2:jint;_p3:jint;_filePath:String):jbyte;
function sendEnvelopeWithStatus(_content:String):String;
function getIccAuthentication(_appType:jint;_authType:jint;_data:String):String;
function setPreferredNetworkTypeToGlobal:boolean;
function hasCarrierPrivileges:boolean;
function setOperatorBrandOverride(_brand:String):boolean;
function canChangeDtmfToneLength:boolean;
function isWorldPhone:boolean;
function isTtyModeSupported:boolean;
function isHearingAidCompatibilitySupported:boolean;
function getVoicemailRingtoneUri(_accountHandle:jobject):jobject;
function isVoicemailVibrationEnabled(_accountHandle:jobject):boolean;
end;
implementation
{ jTelephonyManager }
constructor jTelephonyManager.Create(AjObject:jObject);
begin
inherited Create(AjObject);
end;
...
//code was removed to please the forum post limit :(