public class SubscriptionController
extends ISub.Stub
Modifier and Type | Field and Description |
---|---|
protected CallManager |
mCM |
protected Context |
mContext |
protected Object |
mLock |
protected TelephonyManager |
mTelephonyManager |
protected static Phone[] |
sPhones |
Modifier | Constructor and Description |
---|---|
protected |
SubscriptionController(Context c) |
Modifier and Type | Method and Description |
---|---|
int |
addSubInfoRecord(String iccId,
int slotId)
Add a new SubInfoRecord to subinfo database if needed
|
void |
clearDefaultsForInactiveSubIds() |
int |
clearSubInfo() |
void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
int[] |
getActiveSubIdList() |
int |
getActiveSubInfoCount(String callingPackage)
Get the SUB count of active SUB(s)
|
int |
getActiveSubInfoCountMax() |
SubscriptionInfo |
getActiveSubscriptionInfo(int subId,
String callingPackage)
Get the active SubscriptionInfo with the subId key
|
SubscriptionInfo |
getActiveSubscriptionInfoForIccId(String iccId,
String callingPackage)
Get the active SubscriptionInfo associated with the iccId
|
SubscriptionInfo |
getActiveSubscriptionInfoForSimSlotIndex(int slotIdx,
String callingPackage)
Get the active SubscriptionInfo associated with the slotIdx
|
List<SubscriptionInfo> |
getActiveSubscriptionInfoList(String callingPackage)
Get the SubInfoRecord(s) of the currently inserted SIM(s)
|
int |
getAllSubInfoCount(String callingPackage)
Get the SUB count of all SUB(s) in SubscriptoinInfo database
|
List<SubscriptionInfo> |
getAllSubInfoList(String callingPackage) |
int |
getDefaultDataSubId() |
int |
getDefaultSmsSubId() |
int |
getDefaultSubId() |
int |
getDefaultVoiceSubId() |
static SubscriptionController |
getInstance() |
int |
getPhoneId(int subId) |
int |
getSimStateForSlotIdx(int slotIdx)
Get the SIM state for the slot idx
|
int |
getSlotId(int subId) |
int[] |
getSubId(int slotIdx)
Deprecated.
|
int |
getSubIdUsingPhoneId(int phoneId) |
int[] |
getSubIdUsingSlotId(int slotId) |
List<SubscriptionInfo> |
getSubInfoUsingSlotIdWithCheck(int slotId,
boolean needCheck,
String callingPackage) |
String |
getSubscriptionProperty(int subId,
String propKey,
String callingPackage)
Store properties associated with SubscriptionInfo in database
|
protected void |
init(Context c) |
static SubscriptionController |
init(Context c,
CommandsInterface[] ci) |
static SubscriptionController |
init(Phone phone) |
boolean |
isActiveSubId(int subId) |
void |
notifySubscriptionInfoChanged() |
int |
setDataRoaming(int roaming,
int subId)
Set data roaming by simInfo index
|
void |
setDefaultDataSubId(int subId) |
void |
setDefaultSmsSubId(int subId) |
void |
setDefaultVoiceSubId(int subId) |
int |
setDisplayName(String displayName,
int subId)
Set display name by simInfo index
|
int |
setDisplayNameUsingSrc(String displayName,
int subId,
long nameSource)
Set display name by simInfo index with name source
|
int |
setDisplayNumber(String number,
int subId)
Set phone number by subId
|
int |
setIconTint(int tint,
int subId)
Set SIM color tint by simInfo index
|
int |
setMccMnc(String mccMnc,
int subId)
Set MCC/MNC by subscription ID
|
boolean |
setPlmnSpn(int slotId,
boolean showPlmn,
String plmn,
boolean showSpn,
String spn)
Generate and set carrier text based on input parameters
|
void |
setSubscriptionProperty(int subId,
String propKey,
String propValue)
Store properties associated with SubscriptionInfo in database
|
void |
updatePhonesAvailability(Phone[] phones) |
protected final Object mLock
protected static Phone[] sPhones
protected Context mContext
protected TelephonyManager mTelephonyManager
protected CallManager mCM
protected SubscriptionController(Context c)
public static SubscriptionController init(Phone phone)
public static SubscriptionController init(Context c, CommandsInterface[] ci)
public static SubscriptionController getInstance()
protected void init(Context c)
public void notifySubscriptionInfoChanged()
public SubscriptionInfo getActiveSubscriptionInfo(int subId, String callingPackage)
subId
- The unique SubscriptionInfo key in databasecallingPackage
- The package making the IPC.public SubscriptionInfo getActiveSubscriptionInfoForIccId(String iccId, String callingPackage)
iccId
- the IccId of SIM cardcallingPackage
- The package making the IPC.public SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int slotIdx, String callingPackage)
slotIdx
- the slot which the subscription is insertedcallingPackage
- The package making the IPC.public List<SubscriptionInfo> getAllSubInfoList(String callingPackage)
callingPackage
- The package making the IPC.public List<SubscriptionInfo> getActiveSubscriptionInfoList(String callingPackage)
callingPackage
- The package making the IPC.public int getActiveSubInfoCount(String callingPackage)
callingPackage
- The package making the IPC.public int getAllSubInfoCount(String callingPackage)
callingPackage
- The package making the IPC.public int getActiveSubInfoCountMax()
public int addSubInfoRecord(String iccId, int slotId)
iccId
- the IccId of the SIM cardslotId
- the slot which the SIM is insertedpublic boolean setPlmnSpn(int slotId, boolean showPlmn, String plmn, boolean showSpn, String spn)
showPlmn
- flag to indicate if plmn should be included in carrier textplmn
- plmn to be included in carrier textshowSpn
- flag to indicate if spn should be included in carrier textspn
- spn to be included in carrier textpublic int setIconTint(int tint, int subId)
tint
- the tint color of the SIMsubId
- the unique SubInfoRecord index in databasepublic int setDisplayName(String displayName, int subId)
displayName
- the display name of SIM cardsubId
- the unique SubInfoRecord index in databasepublic int setDisplayNameUsingSrc(String displayName, int subId, long nameSource)
displayName
- the display name of SIM cardsubId
- the unique SubInfoRecord index in databasenameSource
- 0: NAME_SOURCE_DEFAULT_SOURCE, 1: NAME_SOURCE_SIM_SOURCE,
2: NAME_SOURCE_USER_INPUT, -1 NAME_SOURCE_UNDEFINEDpublic int setDisplayNumber(String number, int subId)
number
- the phone number of the SIMsubId
- the unique SubInfoRecord index in databasepublic int setDataRoaming(int roaming, int subId)
roaming
- 0:Don't allow data when roaming, 1:Allow data when roamingsubId
- the unique SubInfoRecord index in databasepublic int setMccMnc(String mccMnc, int subId)
mccMnc
- MCC/MNC associated with the subscriptionsubId
- the unique SubInfoRecord index in databasepublic int getSlotId(int subId)
@Deprecated public int[] getSubId(int slotIdx)
public int getPhoneId(int subId)
public int clearSubInfo()
public int getDefaultSubId()
public void setDefaultSmsSubId(int subId)
public int getDefaultSmsSubId()
public void setDefaultVoiceSubId(int subId)
public int getDefaultVoiceSubId()
public int getDefaultDataSubId()
public void setDefaultDataSubId(int subId)
public void clearDefaultsForInactiveSubIds()
public int getSubIdUsingPhoneId(int phoneId)
public int[] getSubIdUsingSlotId(int slotId)
public List<SubscriptionInfo> getSubInfoUsingSlotIdWithCheck(int slotId, boolean needCheck, String callingPackage)
public void updatePhonesAvailability(Phone[] phones)
public int[] getActiveSubIdList()
public boolean isActiveSubId(int subId)
public int getSimStateForSlotIdx(int slotIdx)
public void setSubscriptionProperty(int subId, String propKey, String propValue)
subId
- Subscription Id of SubscriptionpropKey
- Column name in database associated with SubscriptionInfopropValue
- Value to store in DB for particular subId & column namepublic String getSubscriptionProperty(int subId, String propKey, String callingPackage)
subId
- Subscription Id of SubscriptionpropKey
- Column name in SubscriptionInfo databasepublic void dump(FileDescriptor fd, PrintWriter pw, String[] args)