Disclosure of Invention
In view of the defects of the prior art, the present invention aims to provide a dual-card management control method and system based on a SIM card PLMN, and aims to solve the technical problems that in the prior art, the management of two SIM cards of a mobile terminal and the type of a SIM card connection network are managed through user settings, the operation steps are complicated, and a user cannot manage and control the other SIM cards and network connection modes according to one of the SIM cards.
The technical scheme of the invention is as follows:
a dual-card management control method based on a SIM card PLMN is disclosed, wherein the method comprises the following steps:
A. one of two card slots of the mobile terminal is set as a master card slot in advance, and the other card slot is set as a slave card slot;
B. detecting whether a PLMN value of a first SIM card inserted into a main card slot in a mobile terminal is a preset first PLMN value;
C. if the PLMN value of the first SIM card is a preset first PLMN value, controlling the first SIM card to be automatically unlocked;
D. detecting whether a PLMN value of a second SIM card inserted from a card slot in the mobile terminal is a preset first PLMN value; if the PLMN value of the second SIM card is the preset first PLMN value, controlling the second SIM card to be automatically unlocked; if the PLMN value of the second SIM card is not the preset first PLMN value, continuously judging whether the PLMN value of the second SIM card is the preset second PLMN value;
E. if the PLMN value of the second SIM card is a preset second PLMN value, controlling to lock the second SIM card; and if the PLMN value of the second SIM card is not the preset second PLMN value, automatically unlocking the second SIM card and limiting the use right of partial data services of the second SIM card.
The dual-card management control method based on the SIM card PLMN, wherein if the PLMN value of the second SIM card is not the preset second PLMN value in step E, the method further includes the steps of automatically unlocking the second SIM card and limiting the use right of a part of data services of the second SIM card:
e1, after detecting that the unlocking password input in the mobile terminal is successful, controlling the second SIM card to recover all the data service use rights.
The dual-card management control method based on the SIM card PLMN, wherein the step B further comprises the steps of:
and B1, if the PLMN value of the first SIM card is not the preset first PLMN value, controlling to lock the first SIM card and the second SIM card.
The dual-card management control method based on the SIM card PLMN, wherein the step B1 is followed by the further steps of:
b2, popping up an SIM card unlocking interface by the mobile terminal, and judging whether the PLMN value of the first SIM card is a second PLMN value or not after detecting that the unlocking is successful by inputting the unlocking password;
b3, if the PLMN value of the first SIM card is the second PLMN value, locking the first SIM card and the second SIM card;
b4, if the PLMN value of the first SIM card is not the second PLMN value, controlling the first SIM card to unlock;
b5, repeating the step C, D, E, and obtaining the data service use condition of the second SIM card.
The dual-card management control method based on the SIM card PLMN comprises the steps that the first SIM card is a 4G or 5G card, and the second SIM card correspondingly comprises a 4G or 5G card.
A dual-card management control system based on a SIM card PLMN, wherein the system comprises:
the card slot setting module is used for setting one of two card slots of the mobile terminal as a master card slot in advance, and setting the other card slot as a slave card slot;
the mobile terminal comprises a detection judging module, a first SIM card storing module and a second SIM card storing module, wherein the detection judging module is used for detecting whether a PLMN value of a first SIM card inserted into a main card slot in the mobile terminal is a preset first PLMN value;
the first control module is used for controlling the first SIM card to be automatically unlocked if the PLMN value of the first SIM card is a preset first PLMN value;
the second control module is used for detecting whether the PLMN value of a second SIM card inserted from the card slot in the mobile terminal is a preset first PLMN value or not; if the PLMN value of the second SIM card is the preset first PLMN value, controlling the second SIM card to be automatically unlocked; if the PLMN value of the second SIM card is not the preset first PLMN value, continuously judging whether the PLMN value of the second SIM card is the preset second PLMN value;
the third control module is used for controlling and locking the second SIM card if the PLMN value of the second SIM card is a preset second PLMN value; and if the PLMN value of the second SIM card is not the preset second PLMN value, automatically unlocking the second SIM card and limiting the use right of partial data services of the second SIM card.
The dual-card management control system based on the SIM card PLMN, wherein the third control module further includes:
and the data service recovery unit is used for controlling the second SIM card to recover all the data service use rights after detecting that the unlocking password input in the mobile terminal is successfully unlocked.
The dual-card management control system based on the SIM card PLMN, wherein the first control module specifically includes:
and the first SIM card locking unit is used for controlling and locking the first SIM card and the second SIM card if the PLMN value of the first SIM card is not the preset first PLMN value.
The dual-card management control system based on the SIM card PLMN is characterized in that the first control module further comprises:
the detection and judgment unit is used for popping up an SIM card unlocking interface by the mobile terminal, and judging whether the PLMN value of the first SIM card is a second PLMN value or not after the mobile terminal detects that the unlocking is successful by inputting an unlocking password;
a second SIM card locking unit, configured to lock the first SIM card and the second SIM card if the PLMN value of the first SIM card is the second PLMN value;
the control unit is used for controlling the first SIM card to unlock if the PLMN value of the first SIM card is not the second PLMN value;
and the data service use condition acquisition unit is used for acquiring the data service use condition of the second SIM card.
A dual-card management control system based on SIM card PLMN of any preceding item, wherein, the first SIM card is 4G or 5G card, and the second SIM card is corresponding to including 4G or 5G card.
The invention provides a double-SIM-card management control method and a double-SIM-card management control system based on a PLMN (public land Mobile network) of an SIM card.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is described in further detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The present invention also provides a flowchart of a preferred embodiment of a dual card management control method based on a SIM card PLMN, as shown in fig. 1, the method includes the steps of:
s100, one of two card slots of the mobile terminal is set as a master card slot in advance, and the other card slot is set as a slave card slot.
In particular, the mobile terminal includes, but is not limited to, a mobile phone, a tablet computer, and other electronic devices. Taking a mobile phone as an example, two card slots are arranged in the mobile phone. Before S100, the method further includes pre-configuring a SIMLOCK lock of the two card slots and presetting a first PLMN value and a second PLMN value. Among them, the PLMN (Public Land Mobile Network), a Network established and operated by the government or an operator approved by the Public for the purpose of providing a Land Mobile communication service to the Public, is a Public Land Mobile Network. Specifically, for example, there are two card slots in the mobile phone, which are card slot 1 and card slot 2 respectively. The card slot 1 is set as a preferential use card slot, namely the card slot 1 is set as a main card slot. The card slot 2 is provided as a slave card slot.
S200, detecting whether the PLMN value of a first SIM card inserted into a main card slot in the mobile terminal is a preset first PLMN value, if so, executing a step S300, and if not, executing a step S901. In specific implementation, the mobile terminal reads PLMNs of the two SIM cards when being powered on, determines whether the SIM card can be normally used and whether 4G services can be used by determining the PLMN of the SIM card in the card slot 1, and then determines the use conditions of the second SIM card and the data services in the card slot 2 according to the first SIM card PLMN inserted in the card slot 1.
The first SIM card is an SIM card inserted into the card slot 1, and the second SIM card is an SIM card in the card slot 2; the first SIM card is a 4G or 5G card, and the second SIM card is a corresponding 4G or 5G card. The invention also provides a double-card management control method based on the PLMN of the SIM card, and the mobile terminal is provided with two card slots, namely a card slot 1 and a card slot 2. The card slot 1 is set to be a preferential use card slot. Preferably, the card slot 1 is set as a master card slot, and the card slot 1 is set as a slave card slot. When the mobile terminal is started, PLMN values of two SIM cards in a card slot 1 and a card slot 2 are respectively read, the SIM card in the card slot 1 is marked as a first SIM card, and the SIM card in the card slot 2 is marked as a second SIM card. Determining whether the first SIM card can be normally used and whether the 4G service can be used by judging the PLMN of the first SIM card, and then determining the use condition of a second SIM card and a data service in the card slot 2 according to the first SIM card PLMN inserted in the card slot 1.
For example, the first PLMN value is based on a PLMN of a specified operator, that is, on the premise that the dual card is provided with a SIMLOCK lock and is a dual 4G SIM card, the SIM card of the operator can be automatically unlocked and can freely use data services of various formats (e.g. 2/3G/4G), the SIM card of a non-operator is conditionally used (when the primary card slot is inserted with the SIM card of the operator, and the secondary card slot is inserted with the SIM card of the non-operator, the device can be automatically unlocked and can only use 2G data services, otherwise, the SIM card of the non-operator is locked, an unlocking code needs to be input for unlocking, the unlocking code is provided by the operator, and can be normally used and can freely use 2/3G/4G data services after unlocking is finished), and the SIM card of a competitor of the operator is prohibited from being used (even if the SIM card is not used after unlocking).
S300, controlling the first SIM card to be automatically unlocked;
s400, detecting whether a PLMN value of a second SIM card inserted from a card slot in the mobile terminal is a preset first PLMN value, if so, executing a step S500, and if not, executing a step S600;
s500, controlling the second SIM card to be automatically unlocked;
s600, continuously judging whether the PLMN value of the second SIM card is a preset second PLMN value, if so, executing the step S700, and if not, executing the step S800;
s700, controlling and locking the second SIM card;
s800, automatically unlocking the second SIM card, and limiting the use right of partial data service of the second SIM card;
s900, after detecting that the unlocking password input in the mobile terminal is successfully unlocked, controlling a second SIM card to recover all data service use rights;
s901, controlling and locking the first SIM card and the second SIM card;
s902, popping up an SIM card unlocking interface by the mobile terminal, judging whether the PLMN value of the first SIM card is a second PLMN value or not after detecting that the unlocking is successful by inputting an unlocking password, if so, executing a step S903, and if not, executing a step S904;
s903, locking the first SIM card and the second SIM card;
s904, controlling the first SIM card to be unlocked, and then executing the step S400; 3/4 services are also available for use when card slot 1 is inserted into a non-carrier SIM card (except a competitor SIM card) and unlocked by entering the correct password. Under the condition of successful unlocking, after the user carries out factory setting recovery processing, the user does not need to input the unlocking code again, and the card (except the competitor SIM card) of the non-operator in the card slot 1 can be normally used and can use 3G/4G service;
and S905, ending.
In specific implementation, the SIMLOCK locks of two card slots are configured and the first PLMN value and the second PLMN value are preset in the dual-card dual-4G mobile terminal. Whether the other card slot is unlocked is controlled by monitoring the PLMN value of the first SIM card inserted into the main card slot to judge whether the PLMN value of the second SIM card inserted into the slave card slot is the second PLMN value, and whether the 4G service used by the second SIM card is limited is determined according to the card locking result of the main card slot and the second PLMN of the second SIM card in the slave card slot. For example: setting a card slot 1 as a main card slot, when judging that a PLMN (public land Mobile network) of a first SIM card inserted into the main card slot is matched with a preset first PLMN, automatically unlocking a data service which can be normally used and can freely use 2/3G/4G by the first SIM card, and at the moment, if judging that a PLMN value of a second SIM card inserted into the card slot 2 is the preset first PLMN, automatically unlocking the second SIM card and can also freely use a data service of 2/3G/4G; if the value of the PLMN of the second SIM card inserted into the card slot 2 is judged to be the preset second PLMN, the second SIM card is locked, and the second SIM card cannot be used after being unlocked by inputting an unlocking password; if the second SIM card PLMN inserted into the card slot 2 is not the preset first PLMN or the preset second PLMN, the second SIM card in the card slot 2 is also automatically unlocked and can be used normally, but the 3G/4G data service of the second SIM card is restricted from being used, and only the 2G service can be used. When the first SIM card PLMN inserted into the main card slot is judged not to be matched with the preset second PLMN, the two card slots are locked, an SIMLOCK unlocking interface can be popped up, and after the unlocking password is input for unlocking, the SIM cards of which the PLMNs are not the preset first PLMN or the preset second PLMN can be normally used and can also use 3G/4G data service.
For SIM cards whose PLMN value is not the first preset PLMN value nor the second preset PLMN value, the behavior of inputting the unlocking code and not inputting the unlocking code is inconsistent. After the unlocking code is entered, the non-operator card can also use the 3G/4G service. The method for judging whether the unlocking code is input by the mobile phone comprises the following steps: after the user enters the unlock code and the unlock is successful, a state is saved in the database. And reading the state every time the computer is started to judge whether the user inputs the unlocking code. However, after factory settings are restored, the user does not need to input the unlocking code again, and the state previously stored in the database is cleared, so that the phenomenon occurs: the non-operator card cannot use the 3G/4G service after the factory setting is restored. The solution to this problem is: and storing the unlocking state into the protection partition, reading and storing the unlocking state of the network lock in the same process, and enabling the reading process to adapt to the writing process. The writing process is in a system UI process, after a user inputs an unlocking code, the state is stored in the protection partition, the reading process is in a Phone process, the unlocking code state is read, and whether the mobile Phone can use 3G/4G service or not is judged. Because the read and save states are not in the same process, the solution is to find a method (a construction method of keyguard update monitor) which can be automatically called every time the system ui process is started, in the method, the state of the unlock code in the database is read, if the state does not exist in the database, it indicates that the user has not input the unlock code or has recovered the factory setting, at this time, the state of the protection partition needs to be read, and the state of the protection partition needs to be stored in the database state. And in the Phone process, the original place needing to read the protected partition state only needs to read the state of the database.
As can be seen from the above method embodiments, the present invention provides a dual-card management control method based on a SIM card PLMN, where after determining that a PLMN value of a first SIM card inserted in a card slot 1 is a first preset PLMN value, and determining that a PLMN value of a second SIM card inserted in a card slot 2 is not a second preset PLMN value, both the first SIM card and the second SIM card are automatically unlocked. And after the first SIM card and the second SIM card are automatically unlocked, both the first SIM card and the second SIM card can use 2G/3G/4G services, and if the PLMN value of the SIM card is not the first preset PLMN value or the second preset PLMN value, the SIM card can only use the 2G services.
When the PLMN value of the first SIM card inserted into the card slot 1 is not the first preset PLMN value, nor the second preset PLMN value, and the correct password is entered for unlocking, the first SIM card may also use the 3G/4G service. And under the condition of successful unlocking, after the user performs factory setting restoration processing, the user does not need to input the unlocking code again, and the first SIM card in the card slot 1 can be normally used and can use 3G/4G services.
In specific implementation, taking the first PLMN value as the PLMN value customized by the operator as an example, the second PLMN value is the PLMN value of the competition object of the operator, the first SIM card is denoted as SIM1, and the second SIM card is denoted as second SIM 2. The key pseudo-code implementation:
the SIM2 relies on the card locking handling logic of the SIM1, i.e. the SIM1 matches the operator customized PLMN, Unlock SIM2(SIM2 PLMN is not included in the customized competitor's PLMN). The specific implementation pseudo code is as follows:
/**
mounting relevant data files with customized operator PLMN and SIMLOCK lock states into partitions with readable rights
Reading the PLMN of the SIM card according to the normal flow of the SIMLOCK and matching with the customized PLMN
****
**/
……
switch (current SIM card state)
{
case READY:
{
// iscompetithorplmnexist means that there is a card of a competitor of the operator in the card slot
if (! iscomputer PlmExist & & currently processed is SIM1)
{
if (SIM2 LOCKED) {
// SIM1 matched, unlocking SIM2
Setting the state of the SIM2 to READY;
need_unlock = true;
}
}
}
break;
case LOCKED:
{
if (currently processing SIM2)
{
if (!isCompetitorPlmnExist && SIM1 READY)
{
Setting the state of the SIM2 to READY;
need_unlock = true;
}
}
else
{
SIM1 locked;
}
break;
}。
the pseudo code for realizing that the card slot which is inserted into the SIM card of the non-operator can only use the 2G service after the equipment is automatically unlocked is as follows:
// obtaining the card slot where the current 4G service is located
SystemProperties.get(PROPERTY_3G_SIM, "");
If the card slot uses a non-operator card, the 2G only card is switched to
Phone phone = PhoneFactory.getPhone(curr3GSIMSlot);
if (phone != null) {
checkAndChangeNetworkModeIfNeed(phone, Phone.NT_MODE_GSM_ONLY);
}
And all UI interfaces for switching data are controlled, and the 3G and 4G switching capabilities are forbidden whenever data can be switched between the card slots. When a non-operator card is set as 2G only, the card slot does not have 4G capability, but only the card slot having 4G capability is forced to use 2G only. Therefore, the pseudo code for implementing the UI interface which needs to disable the network mode switching is as follows:
data usage interface datausagesummary
Java, SIM management interface simdialogactivity
Java, startup setting datasubselect
Update capability related preference (), mobile network settings, this method is used to control the path: whether the Settings- > More- > Mobile networks- > Prefer network mode menu is clickable.
ispriorityEnabled: the function of the priority card is indicated to be started, and 4G and data are preferentially set to the card slot where the SIM card defined by the preset PLMN list is located.
Iso thermo operator4 GHide: indicating that the 3G/4G menu of the card slot in which the hidden non-operator SIM card is positioned is enabled.
***/
if (isPriorityEnabled && (isOtherOperator4GHide == 0x01 || !isAllOtherOperator)) {
String mccmnc = RadioCapabilitySwitchUtil.getSimOperator(
SubscriptionManager.getSlotId(mPhone.getSubId()));
isNWModeEnabled &= isHighPriorityOperator(mccmnc);
}
The above code indicates that we need to gray the menu when the inserted cards are not all cards of other operators, but the SIM card of the tab page currently processed is exactly the card of the other operator.
The pseudo code for implementing the read-write operation of the protection partition and the unlocking state in the database after the unlocking is successful is as follows:
storing the unlocked state into the protected partition tctpersist, and giving read-write authority to the partition file in the system _ app.te file
allow system_app tctpersist_file:dir { add_name open create search read write };
allow system_app tctpersist_file:file { open read write create getattr };
Establishing SIMLOCK file after judging successful unlocking and writing unlocking mark into file and database
File simlockFile = new File(SIMLOCK_STATE_FILE_PATH);
try {
if (!simlockFile.exists()) {
simlockFile.createNewFile();
}
// write data to file
Writing the unlocking mark into the simlockFile;
} catch (IOException ex) {
Log.d(TAG, "Input Exception:"+ex.toString());
}
reading the unlocking mark of the SIMLOCK file of the protected partition in the construction method of the KeyguardUpdateMonitor during each startup, and updating the unlocking mark in the database
// reading the data of SIMLOCK _ UNLOCKED in the database
if (SIMLOCK _ UNLOCKED data is null) {// meaning that the user has not entered the unlock code or restored the factory settings
File simlockFile = new File(SIMLOCK_STATE_FILE_PATH);
try {
if (simlockFile.exists()) {
Reading an unlocking mark stored in the simlockFile;
if (unlocking index equals 1)
Setting SIMLOCK _ UNLOCKED to true and writing the value into a database;
} else {
setting SIMLOCK _ UNLOCKED to false and writing the false into a database;
}
} else {
setting SIMLOCK _ UNLOCKED to false and writing the false into a database;
}
} catch (IOException ex) {
Log.d(TAG, "Input Exception:"+ex.toString());
}
}
in an exemplary embodiment, the apparatus may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an apparatus to perform the above method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The present invention also provides a functional schematic block diagram of a preferred embodiment of a dual-card management control system based on a SIM card PLMN, as shown in fig. 2, wherein the system includes:
a card slot setting module 100, configured to set one of two card slots of the mobile terminal as a master card slot in advance, and set the other card slot as a slave card slot; as described in the method embodiments.
The detection and judgment module 200 is used for detecting whether a PLMN value of a first SIM card inserted into a main card slot in the mobile terminal is a preset first PLMN value; as described in the method embodiments.
The first control module 300 is configured to control the first SIM card to be automatically unlocked if the PLMN value of the first SIM card is a preset first PLMN value; as described in the method embodiments.
A second control module 400, configured to detect whether a PLMN value of a second SIM card inserted from a card slot in the mobile terminal is a preset first PLMN value; if the PLMN value of the second SIM card is the preset first PLMN value, controlling the second SIM card to be automatically unlocked; if the PLMN value of the second SIM card is not the preset first PLMN value, continuously judging whether the PLMN value of the second SIM card is the preset second PLMN value; as described in the method embodiments.
A third control module 500, configured to control to lock the second SIM card if the PLMN value of the second SIM card is a preset second PLMN value; if the PLMN value of the second SIM card is not the preset second PLMN value, the second SIM card is automatically unlocked, and the use right of partial data service of the second SIM card is limited; as described in the method embodiments.
The dual-card management control system based on the SIM card PLMN, wherein the third control module further includes:
the data service recovery unit is used for controlling the second SIM card to recover all the data service use rights after detecting that the unlocking password input in the mobile terminal is successfully unlocked; as described in the method embodiments.
The dual-card management control system based on the SIM card PLMN, wherein the first control module specifically includes:
the first SIM card locking unit is used for controlling and locking the first SIM card and the second SIM card if the PLMN value of the first SIM card is not the preset first PLMN value; as described in the method embodiments.
The dual-card management control system based on the SIM card PLMN is characterized in that the first control module further comprises:
the detection and judgment unit is used for popping up an SIM card unlocking interface by the mobile terminal, and judging whether the PLMN value of the first SIM card is a second PLMN value or not after the mobile terminal detects that the unlocking is successful by inputting an unlocking password; as described in the method embodiments.
A second SIM card locking unit, configured to lock the first SIM card and the second SIM card if the PLMN value of the first SIM card is the second PLMN value; as described in the method embodiments.
The control unit is used for controlling the first SIM card to unlock if the PLMN value of the first SIM card is not the second PLMN value; as described in the method embodiments.
A data service use condition acquisition unit for acquiring the data service use condition of the second SIM card; as described in the method embodiments.
The dual-card management control system based on the SIM cards and the PLMN comprises a first SIM card and a second SIM card, wherein the first SIM card is a 4G or 5G card, and the second SIM card correspondingly comprises a 4G or 5G card; as described in the method embodiments.
In summary, the present invention provides a dual-card management control method and system based on a SIM card PLMN, the method comprising: detecting whether the PLMN value of the first SIM card is a preset first PLMN value or not; if so, controlling the first SIM card to be automatically unlocked, continuously detecting whether the PLMN value of the second SIM card is the preset first PLMN value, and if so, controlling the second SIM card to be automatically unlocked; if the PLMN value of the second SIM card is not the preset first PLMN value and is not the preset second PLMN value, the second SIM card is automatically unlocked, the use right of partial data service of the second SIM card is limited, and if the PLMN value of the second SIM card is the preset second PLMN value, the locking of the second SIM card is controlled. The invention can realize automatic locking management and data access to the SIM card according to the judgment of the PLMN value of the SIM card when using the double SIM cards, thereby bringing convenience for users to use the SIM cards.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.