com.pax.dal
Interface IPhoneManager
-
public interface IPhoneManager
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interfaceIPhoneManager.IVSimAndESimListenerVSim和ESim服务监听器VSim and ESim service listener
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method and Description voidenableAirplaneMode(boolean enable)设置是否开启飞行模式。Sets whether the airplane mode is enabled.voidenableVoLteMode(boolean enable)打开或者关闭当前使用卡的VoLte模式。Enable or disable the VoLte mode of the currently used card.java.util.List<OperatorInfo>getCellNetworkScanResults(int subId)扫描当前网络并返回结果。该接口会阻塞线程,不能在主线程调用,会耗时几分钟。Scan the current network and return the results.This interface blocks the thread and cannot be called on the main thread, which can take several minutes.booleangetDataRoamingEnabled(int subId)获取数据漫游状态。Gets the data roaming state.intgetDefaultDataSubscriptionId()获取默认数据流量卡的Subscription Id。Gets the Subscription Id for the default data traffic card.intgetPreferredNetworkType()获取网络优先模式。Get network preferred mode.java.lang.String[]getSIMInfo()获取主SIM卡相关信息。Get primary SIM related information.java.lang.String[]getSIMInfoWithSlotId(int slotId)通过卡槽号获取SIM相关信息。Get SIM information from the card slot number.int[]getSubId(int slotId)通过卡槽获取SIM卡索引Obtaining SIM card index through a slotjava.lang.StringgetSubscriberId(int subId)通过subId获取IMSI。Get IMSI by subId.java.lang.StringgetUiccMode()获取当前使用的模式。Get the mode currently in use.voidgetVSimAndESimServiceState(IPhoneManager.IVSimAndESimListener listener)获取卡服务状态。Get the card service state.booleanisAirplaneModeEnable()判断飞行模式是否开启。Check whether the airplane mode is enabled.booleanisDualSim()获取是否支持双SIM卡。Get whether dual SIM cards are supported.booleanisSimCardLock(int subId)获取SIM卡锁的状态。Get the status of SIM card lock.booleanisSimPresent(int slotId)获取对应卡槽是否插入SIM卡。Obtain whether a SIM card is inserted into the corresponding slot.booleanisVSimDataInUse()Deprecated.获取VSIM状态。Get VSIM status.voidlistenPhoneState(android.telephony.PhoneStateListener stateListener, int events, int subId)通过PhoneStateListener获取SIM卡状态,必须在Activity的主线程调用Obtaining the status of SIM card through PhoneStateListener must be called by the main thread of Activity.voidsetDataRoamingEnabled(int subId, boolean enable)设置数据漫游。Set up the data roaming.voidsetDefaultDataSubId(int subId)设置哪张卡来使用数据流量set which card to use data trafficvoidsetNetworkSelectionModeAutomatic(int subId)设置网络选择模式为自动。Set the network selection mode to automatic.booleansetNetworkSelectionModeManual(int subId, OperatorInfo operator)设置网络运营商。Set up a network operator.booleansetPreferredNetworkType(int networkType)设置网络优选模式。Set network preferred mode.voidsetUiccMode(java.lang.String mode)设置要使用的模式,重启后生效。Set the mode to use, restart to take effect.voidturnOffVSimAndESimService(IPhoneManager.IVSimAndESimListener listener)关闭卡数据服务。Turn off the card data service.voidturnOffVSimData()Deprecated.关闭VSIM。Turn off VSIM.voidturnOnVSimAndESimService(IPhoneManager.IVSimAndESimListener listener)打开卡数据服务。Turn on the card data service.voidturnOnVSimData()Deprecated.打开VSIM。Turn on VSIM.voidupdatePlmn(int phoneId, java.lang.String operation, java.lang.String plmn)对SIM卡进行操作:禁用plmn或者解除plmn禁用,重启生效。Perform operations on the SIM card: Disable PLMN or enable PLMN,Reboot has taken effect.voidupdateShareProfile(java.lang.String shareProfilePath)更新种子卡资源文件,设置后重启生效。Update share profile and restart to take effect.
-
-
-
Method Detail
-
getSubId
int[] getSubId(int slotId) throws PhoneDevException
通过卡槽获取SIM卡索引Obtaining SIM card index through a slot- Parameters:
slotId-0或10 or 1- Returns:
- SIM卡索引SIM card index
- Throws:
PhoneDevException
-
listenPhoneState
void listenPhoneState(android.telephony.PhoneStateListener stateListener, int events, int subId) throws PhoneDevException
通过PhoneStateListener获取SIM卡状态,必须在Activity的主线程调用Obtaining the status of SIM card through PhoneStateListener must be called by the main thread of Activity.- Parameters:
stateListener-PhoneStateListenerPhoneStateListenerevents-参考PhoneStateListenerrefer toPhoneStateListenersubId-SIM卡索引,通过getSubId获取SIM card index,through call getSubId- Throws:
PhoneDevException
-
setDefaultDataSubId
void setDefaultDataSubId(int subId) throws PhoneDevException
设置哪张卡来使用数据流量set which card to use data traffic- Parameters:
subId-SIM卡索引,通过getSubId获取SIM card index,through call getSubId- Throws:
PhoneDevException
-
setPreferredNetworkType
boolean setPreferredNetworkType(int networkType) throws PhoneDevException
设置网络优选模式。Set network preferred mode.- Parameters:
networkType-模式。- 1:4G/3G/2G 自动选择
- 2:3G/2G 自动选择
- 3:2G
- 4:2G(CDMA only)
- 5:2G(GSM only)
- 6:4G only
Mode.- 1:4G/3G/2G automatic selection
- 2:3G/2G automatic selection
- 3:2G
- 4:2G(CDMA only)
- 5:2G(GSM only)
- 6:4G only
- Returns:
- 设置结果。true:成功;false:失败。Result. true:success; false:failure.
- Throws:
PhoneDevException- Since:
- V3.08.00
-
isAirplaneModeEnable
boolean isAirplaneModeEnable() throws PhoneDevException
判断飞行模式是否开启。Check whether the airplane mode is enabled.- Returns:
- true:开启; false:关闭。True: open; False: closed.
- Throws:
PhoneDevException- Since:
- V3.17.00
-
enableAirplaneMode
void enableAirplaneMode(boolean enable) throws PhoneDevException
设置是否开启飞行模式。Sets whether the airplane mode is enabled.- Parameters:
enable-true:开启; false:关闭。True: open; False: closed.- Throws:
PhoneDevException- Since:
- V3.17.00
-
getCellNetworkScanResults
java.util.List<OperatorInfo> getCellNetworkScanResults(int subId) throws PhoneDevException
扫描当前网络并返回结果。该接口会阻塞线程,不能在主线程调用,会耗时几分钟。Scan the current network and return the results.This interface blocks the thread and cannot be called on the main thread, which can take several minutes.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card indexes. Get it bygetSubId(int).- Returns:
OperatorInfo- Throws:
PhoneDevException- Since:
- V3.20.00
-
getDataRoamingEnabled
boolean getDataRoamingEnabled(int subId) throws PhoneDevException
获取数据漫游状态。Gets the data roaming state.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card indexes. Get it bygetSubId(int).- Returns:
- true:成功 ;false:失败 。true:Success; false:Failure.
- Throws:
PhoneDevException- Since:
- V3.20.00
-
setDataRoamingEnabled
void setDataRoamingEnabled(int subId, boolean enable) throws PhoneDevException
设置数据漫游。Set up the data roaming.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card indexes. Get it bygetSubId(int).enable-true:开启 ;false:关闭 。true:Open; false:Close.- Throws:
PhoneDevException- Since:
- V3.20.00
-
setNetworkSelectionModeManual
boolean setNetworkSelectionModeManual(int subId, OperatorInfo operator) throws PhoneDevException
设置网络运营商。Set up a network operator.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card indexes. Get it bygetSubId(int).operator-OperatorInfo- Returns:
- true:成功 ;false:失败 。true:Success; false:Failure.
- Throws:
PhoneDevException- Since:
- V3.20.00
-
isSimCardLock
boolean isSimCardLock(int subId) throws PhoneDevException
获取SIM卡锁的状态。Get the status of SIM card lock.- Parameters:
subId-SIM卡索引。通过{getSubId(int)}获取。SIM card index. It is obtained through {getSubId(int)}.- Returns:
- True:已锁;False:没有锁。True: locked; False: no lock.
- Throws:
PhoneDevException- Since:
- V3.20.00
-
isDualSim
boolean isDualSim() throws PhoneDevException
获取是否支持双SIM卡。Get whether dual SIM cards are supported.- Returns:
- True:支持;False:不支持。True: supported; False: not supported.
- Throws:
PhoneDevException- Since:
- V3.22.00
-
isVSimDataInUse
@Deprecated boolean isVSimDataInUse() throws PhoneDevException
Deprecated.获取VSIM状态。Get VSIM status.- Returns:
- True:开启;False:关闭。True: on; False: off.
- Throws:
PhoneDevException- Since:
- V3.27.00
-
turnOnVSimData
@Deprecated void turnOnVSimData() throws PhoneDevException
Deprecated.打开VSIM。Turn on VSIM.- Throws:
PhoneDevException- Since:
- V3.27.00
-
turnOffVSimData
@Deprecated void turnOffVSimData() throws PhoneDevException
Deprecated.关闭VSIM。Turn off VSIM.- Throws:
PhoneDevException- Since:
- V3.27.00
-
getSIMInfo
java.lang.String[] getSIMInfo() throws PhoneDevException
获取主SIM卡相关信息。Get primary SIM related information.- Returns:
- simInfo[0]:DeviceId
simInfo[1]:IMEI
simInfo[2]:ICCID
simInfo[3]:SIM operator name
simInfo[4]:Network operator namesimInfo[0]:DeviceId
simInfo[1]:IMEI
simInfo[2]:ICCID
simInfo[3]:SIM operator name
simInfo[4]:Network operator name - Throws:
PhoneDevException- Since:
- V3.29.00
-
getSIMInfoWithSlotId
java.lang.String[] getSIMInfoWithSlotId(int slotId) throws PhoneDevException
通过卡槽号获取SIM相关信息。Get SIM information from the card slot number.- Parameters:
slotId-0或10 or 1- Returns:
- simInfo[0]:DeviceId
simInfo[1]:IMEI
simInfo[2]:ICCID
simInfo[3]:SIM operator name
simInfo[4]:Network operator namesimInfo[0]:DeviceId
simInfo[1]:IMEI
simInfo[2]:ICCID
simInfo[3]:SIM operator name
simInfo[4]:Network operator name - Throws:
PhoneDevException- Since:
- V3.32.00
-
setNetworkSelectionModeAutomatic
void setNetworkSelectionModeAutomatic(int subId) throws PhoneDevException
设置网络选择模式为自动。Set the network selection mode to automatic.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card indexes. Get it bygetSubId(int).- Throws:
PhoneDevException- Since:
- V3.32.00
-
getPreferredNetworkType
int getPreferredNetworkType() throws PhoneDevException
获取网络优先模式。Get network preferred mode.- Returns:
- 首选网络类型network preferred mode
- Throws:
PhoneDevException- Since:
- V3.33.00
-
updateShareProfile
void updateShareProfile(java.lang.String shareProfilePath) throws PhoneDevException
更新种子卡资源文件,设置后重启生效。Update share profile and restart to take effect.- Parameters:
shareProfilePath-文件路径,不能为空,文件必须存在。The file path, cannot be empty. The file must exist.- Throws:
PhoneDevException- Since:
- V3.33.00
-
turnOnVSimAndESimService
void turnOnVSimAndESimService(IPhoneManager.IVSimAndESimListener listener) throws PhoneDevException
打开卡数据服务。Turn on the card data service.- Parameters:
listener-IPhoneManager.IVSimAndESimListener- Throws:
PhoneDevException- Since:
- V3.33.00
-
turnOffVSimAndESimService
void turnOffVSimAndESimService(IPhoneManager.IVSimAndESimListener listener) throws PhoneDevException
关闭卡数据服务。Turn off the card data service.- Parameters:
listener-IPhoneManager.IVSimAndESimListener- Throws:
PhoneDevException- Since:
- V3.33.00
-
getUiccMode
java.lang.String getUiccMode() throws PhoneDevException
获取当前使用的模式。Get the mode currently in use.- Throws:
PhoneDevException- Since:
- V3.33.00
-
setUiccMode
void setUiccMode(java.lang.String mode) throws PhoneDevException
设置要使用的模式,重启后生效。Set the mode to use, restart to take effect.- Parameters:
mode-- "ESIM"
- "GSMA_ESIM"
- "ESIM"
- "GSMA_ESIM"
- Throws:
PhoneDevException- Since:
- V3.33.00
-
getVSimAndESimServiceState
void getVSimAndESimServiceState(IPhoneManager.IVSimAndESimListener listener) throws PhoneDevException
获取卡服务状态。Get the card service state.- Parameters:
listener-IPhoneManager.IVSimAndESimListener- Throws:
PhoneDevException- Since:
- V3.33.00
-
enableVoLteMode
void enableVoLteMode(boolean enable) throws PhoneDevException
打开或者关闭当前使用卡的VoLte模式。Enable or disable the VoLte mode of the currently used card.- Parameters:
enable-true:打开VoLte false:关闭VoLtetrue: enable, false: disable- Throws:
PhoneDevException- Since:
- V3.34.00
-
getSubscriberId
java.lang.String getSubscriberId(int subId) throws PhoneDevException
通过subId获取IMSI。Get IMSI by subId.- Parameters:
subId-SIM卡索引。通过getSubId(int)获取。SIM card index. Get it bygetSubId(int).- Returns:
- IMSI(International Mobile Subscriber Identity)IMSI(International Mobile Subscriber Identity)
- Throws:
PhoneDevException- Since:
- V4.07.00
-
getDefaultDataSubscriptionId
int getDefaultDataSubscriptionId() throws PhoneDevException
获取默认数据流量卡的Subscription Id。Gets the Subscription Id for the default data traffic card.- Returns:
- 默认数据流量卡的Subscription IdSubscription Id of the default data traffic card
- Throws:
PhoneDevException- Since:
- V4.14.00
-
isSimPresent
boolean isSimPresent(int slotId) throws PhoneDevException
获取对应卡槽是否插入SIM卡。Obtain whether a SIM card is inserted into the corresponding slot.- Parameters:
slotId-0或1。0 or 1.- Returns:
- true-存在, false-未插入true- exists, false- not inserted
- Throws:
PhoneDevException- Since:
- V4.14.00
-
updatePlmn
void updatePlmn(int phoneId, java.lang.String operation, java.lang.String plmn) throws PhoneDevException
对SIM卡进行操作:禁用plmn或者解除plmn禁用,重启生效。Perform operations on the SIM card: Disable PLMN or enable PLMN,Reboot has taken effect.- Parameters:
phoneId-卡槽号,一般是0或者1The slot number is usually 0 or 1.operation-只允许2个值:"1"表示禁用,"0"表示解除禁用Only two values are allowed: "1" indicates disable, and "0" indicates enable.plmn-想要禁用或者解除禁用的plmn,plmn长度为5位或者6位,每一位的取值范围:0~9To disable or re-enable a PLMN, the PLMN length should be 5 or 6 digits. Each digit's value range is from 0 to 9.- Throws:
PhoneDevException- Since:
- V4.18.00
-
-