Call state monitoring method and device, equipment, storage medium

By creating and destroying listeners in multi-screen collaborative devices to monitor the call status of each SIM card, the problem of invalid call status monitoring under multiple SIM cards is solved, ensuring the flexibility and reliability of call status monitoring.

CN116367215BActive Publication Date: 2025-11-07HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310157030.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-11-07
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

In multi-screen collaboration scenarios, if the first device has multiple SIM cards installed, the call status monitoring of the SIM cards may become invalid, affecting the collaborative call process.

Method used

When the first device collaborates with the second device on multiple screens, it obtains the identifiers of all SIM cards, creates and starts the corresponding listeners, monitors the call status of each SIM card, and destroys or recreates the listeners according to user instructions to ensure flexibility and reliability.

Benefits of technology

It enables accurate monitoring of call status during multi-screen collaboration regardless of SIM card switching, avoiding redundant processing and resource waste, and improving the flexibility and reliability of call status monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116367215B_ABST
    Figure CN116367215B_ABST
Patent Text Reader

Abstract

The application discloses a call state monitoring method and device, equipment and storage medium, and belongs to the terminal technical field. The method comprises the following steps: acquiring the identity of each SIM card in all SIM cards installed by itself when starting to perform multi-screen cooperation with a second device, and creating a corresponding listener according to the identity of each SIM card and starting the listener. In this way, each listener can monitor the call state of the corresponding SIM card. Further, if a first instruction triggered by a user is received during the multi-screen cooperation, all listeners are destroyed; if a second instruction triggered by the user is received during the multi-screen cooperation, the listener corresponding to each SIM card is re-created and started. In this way, the flexibility of call state monitoring is improved, and in the case that the multi-screen cooperation scene needs to start monitoring and cancel monitoring multiple times, the newly created listener can be used to normally monitor the call state after each time of starting monitoring, so that the reliability of call state monitoring is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with application number 202111630633.7, application date December 28, 2021, and invention name "Call state monitoring method, device, equipment, storage medium", which is filed with the China Patent Office. TECHNICAL FIELD

[0002] The present application relates to the technical field of terminals, and in particular relates to a call state monitoring method, device, equipment, storage medium and program product. BACKGROUND

[0003] With the rapid development of terminal technology, multi-screen collaboration technology has been widely applied. Multi-screen collaboration refers to mirroring the screen picture of a first device (such as a mobile phone) on the interface of a second device (such as a tablet computer) after the first device and the second device are connected. In this case, the user can operate the screen picture of the first device displayed in the interface of the second device to make the first device perform corresponding functions.

[0004] In the multi-screen collaboration scenario, if the first device makes an operator call, the second device can be switched to collect and play the call voice, that is, collaborative call can be made. Specifically, when the first device and the second device make a collaborative call, the microphone of the second device collects the call voice of the local user and sends it to the first device, and the first device sends the call voice to the remote call device; the remote call device sends the call voice of the remote user to the first device, and the first device sends the call voice to the second device, which is played by the loudspeaker of the second device.

[0005] If collaborative call needs to be implemented in the case of multi-screen collaboration between the first device and the second device, the first device needs to monitor the call state of the subscriber identity module (SIM) card installed by itself to determine whether to start making an operator call. However, in the multi-screen collaboration scenario, if the first device is installed with multiple SIM cards, the call state monitoring of the SIM card will be invalid with a certain probability, which will affect the implementation of collaborative call. SUMMARY

[0006] The present application provides a call state monitoring method, device, equipment, storage medium and program product, which can improve the flexibility and reliability of call state monitoring. The technical solution is as follows:

[0007] In a first aspect, a call state monitoring method is provided. In the method, a first device obtains an identifier of each SIM card among all SIM cards installed in the first device when starting multi-screen cooperation with a second device, creates a corresponding listener for each SIM card among all SIM cards according to the identifier of the SIM card, respectively, and starts the listener corresponding to each SIM card among all SIM cards to monitor the call state of the SIM card. Then, if the first device receives a first instruction triggered by a user during the multi-screen cooperation with the second device, the first device destroys all listeners for monitoring the call state of the SIM card; and if the first device receives a second instruction triggered by a user during the multi-screen cooperation with the second device, the first device re-creates and starts the listener corresponding to each SIM card among all SIM cards installed in the first device.

[0008] Multi-screen cooperation refers to displaying a screen picture of the first device on an interface of the second device. That is, after the first device performs multi-screen cooperation with the second device, the screen picture of the first device is displayed on the interface of the second device. In this case, the user can operate the screen picture of the first device displayed in the interface of the second device to make the first device perform a corresponding function.

[0009] The first device is a device capable of performing carrier call. One or more SIM cards can be installed in the first device, and the first device can perform carrier call using any one of the one or more SIM cards. The one or more SIM cards installed in the first device have an identifier. For any one of the SIM cards, the identifier of the SIM card is used to uniquely identify the SIM card.

[0010] The listener corresponding to each SIM card is created according to the identifier of the SIM card, and is used to monitor the call state of the corresponding SIM card. That is, for any one of the SIM cards installed in the first device, the first device can create a listener corresponding to the SIM card according to the identifier of the SIM card, and the listener corresponding to the SIM card is used to monitor the call state of the SIM card.

[0011] The call state is used to indicate a transition from idle to in-call, or a transition from in-call to idle. For a SIM card, if the SIM card is idle, it means that the SIM card is not used for carrier call; if the SIM card is in-call, it means that the SIM card is being used for carrier call. In this case, if the first device starts carrier call using the SIM card, the call state of the SIM card will transition from idle to in-call. Then, if the first device hangs up the carrier call made by the SIM card, the call state of the SIM card will transition from in-call to idle.

[0012] The listener is a listening interface, which is used to receive a call state change event of the SIM card, and thus the call state of the SIM card can be determined. For example, when a call state change occurs in a SIM card, i.e., when the call state of the SIM card changes from idle to in-call or from in-call to idle, a call state change event is generated. At this time, the listener corresponding to the SIM card can receive the call state change event of the SIM card, and according to the call state change event, it can be determined whether the call state of the SIM card changes from idle to in-call or from in-call to idle.

[0013] The first instruction is used to instruct the first device to collect and play the voice of the operator call when the first device is making the operator call. Optionally, the first instruction is triggered when the user turns off the collaborative call switch in the first device or the second device; or the first instruction is triggered when the user dials a phone or answers an incoming call in the first device.

[0014] The second instruction is used to instruct the second device to collect and play the voice of the call when the first device is making the operator call. Optionally, the second instruction is triggered when the user turns on the collaborative call switch in the first device or the second device; or the second instruction is triggered when the user operates the screen image of the first device displayed by the second device to make the first device dial a phone or answer an incoming call.

[0015] In the present application, when the first device starts to perform multi-screen collaboration with the second device, the first device acquires the identity of each SIM card among all the SIM cards installed by itself, and respectively creates and starts a corresponding listener according to the identity of each SIM card among all the SIM cards. In this way, each listener can listen to the call state of the SIM card corresponding thereto, so that it can be ensured that the call state can be listened to regardless of which SIM card is used by the first device to make the operator call. Moreover, even if the first device switches from using one SIM card to using another SIM card to make the operator call during the process of making the operator call using the one SIM card, the call state can still be listened to. The business logic of the entire scheme is reasonable, and the listening process is simple, convenient, accurate and efficient, avoiding redundant processing and resource waste. Further, if the first device receives the first instruction triggered by the user during the process of performing multi-screen collaboration with the second device, all the listeners for listening to the call state of the SIM card are destroyed; if the first device receives the second instruction triggered by the user during the process of performing multi-screen collaboration with the second device, the listeners corresponding to each SIM card among all the SIM cards installed by the first device are re-created and started. In this way, the destruction or re-creation of the listeners can be performed according to whether there is a demand for collaborative call, so that the flexibility of call state listening is improved. Moreover, in the case where the listeners need to be started and canceled multiple times in the multi-screen collaboration scenario, it can be ensured that the call state can be normally listened to through the newly created listeners after each time the listeners are started, so that the reliability of call state listening is ensured.

[0016] As an example, the operation of the first device creating a listener corresponding to each of all SIM cards installed in the first device and starting the listener can be that the first device reacquires the identity of each of all SIM cards installed in the first device, and then respectively creates a corresponding listener according to the identity of each of all SIM cards reacquired.

[0017] In this way, even if the user pulls out a SIM card from the first device or inserts a new SIM card into the first device in the process of multi-screen cooperation, the first device can timely acquire the identity of each of all SIM cards currently present, and create a listener according to the identity to listen to the call state. That is, in the present application, whether a SIM card is pulled out or a new SIM card is inserted in the process of multi-screen cooperation, it will not affect the accurate judgment of the call state, and the flexibility of call state listening is improved.

[0018] The first device can have one or more card slots, each of which is used to install a SIM card, that is, each card slot is corresponding to the SIM card installed thereon. After a SIM card is installed into a card slot in the first device, the first device can use the SIM card to make a call or receive an incoming call, that is, the SIM card can be used to make an operator call. In this case, the operation of the first device acquiring the identity of each of all SIM cards installed in the first device can be that the first device acquires the identity of each of all card slots in the first device for installing a SIM card, and then respectively acquires the identity of the SIM card installed in each card slot according to the identity of each of all card slots.

[0019] As an example, the listener can be registered by a call management object. The call management object is used to manage the call state of the SIM card. For example, the call management object can be a phone service manager, which is a service class for managing the call state and network information. In this case, the operation of the first device respectively creating a listener corresponding to each of all SIM cards according to the identity of each of all SIM cards can be that for each of all SIM cards, the first device creates a call management object corresponding to the SIM card according to the identity of the SIM card, the call management object corresponding to the SIM card is used to manage the call state of the SIM card, and then registers a listener through the call management object corresponding to the SIM card as the listener corresponding to the SIM card.

[0020] Since the call management object corresponding to the SIM card is created according to the identifier of the SIM card, the call management object corresponding to the SIM card is used to manage the call state of the SIM card. In this case, the listener registered by the call management object corresponding to the SIM card is also used to listen to the call state of the SIM card, that is, the listener registered by the call management object corresponding to the SIM card is also the listener corresponding to the SIM card.

[0021] In this case, if only one SIM card is installed in the first device, only the listener corresponding to the SIM card is registered, and the event notification will be received in the corresponding listener when the call state of the SIM card changes. If multiple SIM cards are installed in the first device, the corresponding listeners are registered for the multiple SIM cards respectively, and the event notification will be received in the corresponding listener when the call state of each SIM card changes.

[0022] As an example, the first device starts a collaboration thread when starting to perform multi-screen collaboration with the second device, and then obtains the identifier of each SIM card installed in the first device by running the collaboration thread, and creates a corresponding listener according to the identifier of each SIM card in all SIM cards respectively. Then, the first device starts a sub-thread in the collaboration thread, and starts the listener corresponding to each SIM card in all SIM cards by running the sub-thread.

[0023] In this application, the operation of starting the listener to perform call state listening is completed in the sub-thread. In this way, the sub-thread is used to process the call state listening, and the call state listening will not block the collaboration thread, so that the collaboration thread can be avoided from being stuck, and the efficiency is higher.

[0024] Among them, the first device starts a sub-thread in the collaboration thread and creates a loop object for the sub-thread, and starts the listener corresponding to each SIM card in all SIM cards by running the sub-thread, and makes the listener corresponding to each SIM card continuously listen to the call state of the corresponding SIM card through the loop object of the sub-thread.

[0025] The loop object of the sub-thread is used to manage the message queue of the sub-thread, and the loop object can make the message queue in a message loop state, that is, the loop object can continuously take messages from the message queue for the sub-thread to process, and continuously put messages into the message queue. In this way, the sub-thread can be continuously run, and the listener started in the sub-thread can continuously listen to the call state of the corresponding SIM card.

[0026] As an example, for any one of the SIM cards installed in the first device, the SIM card can be referred to as a target SIM card. If the first device detects, through the listener corresponding to the target SIM card, that the call state of the target SIM card changes from idle to in-call, it indicates that the first device starts to make a carrier call using the target SIM card. During the process of making the carrier call using the target SIM card, the first device can make a collaborative call, that is, the second device that collaborates with the first device collects and plays the call voice. After that, if the first device detects, through the listener corresponding to the target SIM card, that the call state of the target SIM card changes from in-call to idle, it indicates that the first device has hung up the carrier call made by the target SIM card. Then, the first device can end the collaborative call, that is, stop collecting and playing the call voice through the second device.

[0027] During the process of making the carrier call using the target SIM card, the first device makes a collaborative call, which means that the call voice of the carrier call made by the first device using the target SIM card is switched to the second device, and the second device collects and plays the call voice. Specifically, when the first device and the second device make a collaborative call, the microphone of the second device collects the call voice of the local user and sends it to the first device, and the first device sends the call voice to the remote call device. The remote call device sends the call voice of the remote user to the first device, and the first device sends the call voice to the second device, and the second device plays the call voice through the loudspeaker. After that, if the first device hangs up the carrier call made by the target SIM card, the collaborative call can be ended. In this case, the collection and playing of the call voice return to the original state, that is, the switching back to the first device.

[0028] In a second aspect, a call state monitoring apparatus is provided. The call state monitoring apparatus has functions to implement the behaviors of the call state monitoring method in the first aspect. The call state monitoring apparatus includes at least one module for implementing the call state monitoring method provided in the first aspect.

[0029] In a third aspect, a call state monitoring apparatus is provided. The call state monitoring apparatus includes a processor and a memory. The memory is configured to store programs supporting the call state monitoring apparatus to execute the call state monitoring method provided in the first aspect, and store data related to the call state monitoring method in the first aspect. The processor is configured to execute the programs stored in the memory. The call state monitoring apparatus can further include a communication bus for establishing a connection between the processor and the memory.

[0030] In a fourth aspect, a computer readable storage medium is provided, which stores instructions, when executed on a computer, cause the computer to perform the call state monitoring method of the first aspect.

[0031] In a fifth aspect, a computer program product is provided, which contains instructions, when executed on a computer, cause the computer to perform the call state monitoring method of the first aspect.

[0032] The technical effects obtained by the second aspect, the third aspect, the fourth aspect and the fifth aspect are similar to the technical effects obtained by the corresponding technical means in the first aspect, and thus are not described herein. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 is a structural schematic diagram of a terminal provided by an embodiment of the present application;

[0034] Figure 2 is a block diagram of a software system of a terminal provided by an embodiment of the present application;

[0035] Figure 3 is an interface schematic diagram of a tablet computer provided by an embodiment of the present application;

[0036] Figure 4 is an interface schematic diagram of a mobile phone provided by an embodiment of the present application;

[0037] Figure 5 is another interface schematic diagram of a tablet computer provided by an embodiment of the present application;

[0038] Figure 6 is another interface schematic diagram of a mobile phone provided by an embodiment of the present application;

[0039] Figure 7 is an interface schematic diagram in a multi-screen cooperation scenario provided by an embodiment of the present application;

[0040] Figure 8 is another interface schematic diagram in a multi-screen cooperation scenario provided by an embodiment of the present application;

[0041] Figure 9 is a schematic diagram of a multi-screen cooperation system provided by an embodiment of the present application;

[0042] Figure 10 is a flowchart of a call state monitoring method provided by an embodiment of the present application;

[0043] Figure 11 is a schematic diagram of destruction and creation of a listener provided by an embodiment of the present application;

[0044] Figure 12is a schematic diagram of a new cycle object provided by an embodiment of the present application;

[0045] Figure 13 is a flowchart of another call state monitoring method provided by an embodiment of the present application;

[0046] Figure 14 is a schematic diagram of a call state monitoring method provided by the related art;

[0047] Figure 15 is a schematic diagram of a call state monitoring method provided by an embodiment of the present application;

[0048] Figure 16 is a structural schematic diagram of a call state monitoring apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0050] It should be understood that the "multiple" mentioned in the present application refers to two or more than two. In the description of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; "and / or" in the present application only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent three cases of A alone, A and B together, and B alone. In addition, in order to clearly describe the technical solutions of the present application, the same items or similar items with basically the same functions and effects are distinguished by using "first", "second", etc. The skilled in the art can understand that "first", "second", etc. do not limit the quantity and execution order, and "first", "second", etc. also do not limit the difference.

[0051] Before the call state monitoring method provided by the embodiments of the present application is explained in detail, the terminal involved in the embodiments of the present application will be explained first.

[0052] Figure 1 is a structural schematic diagram of a terminal provided by an embodiment of the present application. Referring to Figure 1The terminal 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0053] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0054] The processor 110 can include one or more processing units, such as: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated in one or more processors.

[0055] The controller can be the nerve center and command center of the terminal 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0056] The processor 110 can also include memory that stores instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The cache memory can hold instructions and data that the processor 110 has recently used or is likely to use again. If the processor 110 needs to use that instruction or data again, it can be retrieved directly from the cache memory. This avoids repeated accesses to the main memory, reducing the latency of the processor 110 and improving the efficiency of the system.

[0057] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some embodiments with wired charging, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some embodiments with wireless charging, the charging management module 140 can receive wireless charging input through a wireless charging coil of the terminal 100. The charging management module 140 can charge the battery 142 while also providing power to the terminal 100 through the power management module 141.

[0058] The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0059] The wireless communication functions of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.

[0060] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the terminal 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive an electromagnetic wave by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic wave, and transfer to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate as an electromagnetic wave through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.

[0061] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the terminal 100. The wireless communication module 160 can be one or more devices integrated with at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification, and radiate as an electromagnetic wave through the antenna 2.

[0062] The terminal 100 can implement a display function through a GPU, a display 194, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.

[0063] The terminal 100 can implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display 194, and an application processor, etc.

[0064] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to extend the storage capacity of the terminal 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, music, video, and other files can be saved in the external memory card.

[0065] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the terminal 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), and the like. The data storage area can store data (such as audio data, a phone book, etc.) created by the terminal 100 during use, and the like. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), and the like.

[0066] The terminal 100 can implement audio functions, such as music playing, recording, and the like, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, and the like.

[0067] The audio module 170 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or part of the functions of the audio module 170 can be disposed in the processor 110.

[0068] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the terminal 100. The terminal 100 can support one or N SIM card interfaces, where N is an integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. The same SIM card interface 195 can simultaneously insert multiple cards. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The terminal 100 interacts with a network through the SIM card to achieve functions such as calling and data communication. In some embodiments, the terminal 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal 100 and cannot be separated from the terminal 100.

[0069] Next, the software system of the terminal 100 is described.

[0070] The software system of the terminal 100 can use a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Embodiments of the present application exemplarily describe the software system of the terminal 100 by taking an Android system with a layered architecture as an example.

[0071] Figure 2 FIG. 1 is a block diagram of a software system of a terminal 100 according to an embodiment of the present application. Referring to FIG. 1, the layered architecture divides software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and a system layer, and a kernel layer. Figure 2

[0072] The application layer can include a series of application packages. As shown in FIG. 2, the application packages can include multi-screen collaboration, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, short message, and the like. The multi-screen collaboration application is used to start the multi-screen collaboration function. Figure 2

[0073] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. As shown in FIG. 3, the application framework layer includes a series of application programming interfaces (APIs) and programming frameworks, such as Activity Manager, Package Manager, Window Manager, Content Provider, Resource Manager, Telephony Manager, Location Manager, and the like. Figure 2 ​​As shown, the application framework layer can include a distributed mobile sensing development platform (DMSDP), a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The window manager is used to manage window programs. The DMSDP is used to listen to the call state of the SIM card when multi-screen cooperation is performed, and to realize cooperative calls accordingly. The window manager can acquire the size of the display screen, judge whether there is a status bar, lock the screen, intercept the screen, etc. The content provider is used to store and acquire data, and to enable the data to be accessed by application programs, which can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build the display interface of an application program, which can be composed of one or more views, such as a view for displaying a short message notification icon, a view for displaying text, and a view for displaying pictures. The phone manager is used to provide the communication function of the terminal 100, such as the management of the call state (including connection, disconnection, etc.). The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables application programs to display notification information in the status bar, which can be used to convey messages of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloading, message reminders, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text in the top status bar of the system, such as a notification of an application program running in the background. The notification manager can also be a notification in the form of a dialog window on the screen, such as a text information prompt in the status bar, a prompt sound, an electronic device vibration, a flashing indicator light, etc.

[0074] The Android Runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library contains two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.

[0075] The system library can include a plurality of functional modules, such as a surface manager, media libraries, a three-dimensional graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), and the like. The surface manager is used to manage a display subsystem and provides a plurality of applications with a fusion of 2D and 3D layers. The media libraries support playback and recording of a plurality of commonly used audio, video formats, and still image files, and the like. The media libraries can support a plurality of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, and the like. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, and the like. The 2D graphics engine is a drawing engine for 2D drawing.

[0076] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0077] The application scenarios related to the embodiments of the present application are described below.

[0078] In the case of multi-screen cooperation between a mobile phone and a tablet computer, if the mobile phone makes an operator call, the mobile phone can be switched to the tablet computer to collect and play call voice, that is, cooperative call can be made. If cooperative call needs to be implemented in the case of multi-screen cooperation between the mobile phone and the tablet computer, the mobile phone needs to monitor the call state of the SIM card installed in the mobile phone to determine whether the mobile phone starts to make an operator call. When the mobile phone monitors that the call state of the SIM card changes from idle to in-call, it is determined that the mobile phone starts to make an operator call, and then the mobile phone can be switched to the tablet computer to collect and play call voice.

[0079] However, at present, when monitoring the call state, the call state of the SIM card in the main card slot is monitored by default. This results in that in the case of inserting two SIM cards into the mobile phone, when the mobile phone makes an operator call using the SIM card in the secondary card slot, the mobile phone cannot monitor the started operator call, and cannot be switched to the tablet computer to collect and play call voice. In this case, when the mobile phone makes an operator call using the SIM card in the secondary card slot, the expected call voice is on the tablet computer side, but the actual call voice is still on the mobile phone side, and cooperative call fails.

[0080] Therefore, the embodiments of the present application provide a call state monitoring method, which can not only simply, quickly, accurately and efficiently monitor the call states of all SIM cards installed in the mobile phone when the mobile phone and the tablet computer perform multi-screen cooperation, but also improve the flexibility and reliability of call state monitoring, so as to ensure the normal operation of cooperative call.

[0081] The following section uses mobile phones and tablets as an example to illustrate several possible connection methods for multi-screen collaboration.

[0082] 1. Establish a connection via Bluetooth.

[0083] For example, if a user wants to work collaboratively with their phone and tablet, they can first turn on Bluetooth on both the phone and tablet. Then, the user can manually enable the multi-screen collaboration function on their phone. For instance, the user can find the "Multi-screen Collaboration" switch in the phone's interface through "Settings" - "More Connections" - "Multi-screen Collaboration" and turn it on to enable the phone's multi-screen collaboration function.

[0084] See Figure 3 The interface diagram of the tablet computer shown is as follows: Figure 3 As shown in Figure (a), the user swipes down from the tablet's status bar to access a notification panel, which includes a "Multi-screen Collaboration" option 31. When the user taps the "Multi-screen Collaboration" option 31, the tablet responds by displaying a first prompt window. This first prompt window includes instructions on how to perform the multi-screen collaboration. For example, as shown in Figure (a),... Figure 3 As shown in Figure (b), the first operation prompt includes "1. Turn on your phone's Bluetooth and bring it close to the device. Once the device is detected, click 'Connect'".

[0085] 2. After connecting, you can operate your phone on your tablet and share data between the devices. The system will then display a prompt stating, "..." Users can then perform the corresponding operations based on the initial prompts, such as bringing their phone close to the tablet.

[0086] In one example, see Figure 4 The diagram shown illustrates the phone's interface. As the phone approaches the tablet, a second prompt window appears when the phone detects the tablet. Figure 4 As shown in Figure (a), the second prompt window includes the prompt "Establish collaborative connection with the discovered device?", as well as "Connect" option 41 and "Cancel" option 42. When the user clicks "Connect" option 41, it indicates that the user confirms the establishment of a collaborative connection. The phone responds to the user's trigger operation on "Connect" option 41 and establishes a collaborative connection with the tablet via Bluetooth. When the user clicks "Cancel" option 42, it indicates that the user does not want to establish a collaborative connection. The phone responds to the user's trigger operation on "Cancel" option 42 and does not perform the operation of establishing a collaborative connection. In another example, when the phone is near the tablet, it may not display the second prompt window when it discovers the tablet, but instead automatically establish a collaborative connection with the tablet via Bluetooth.

[0087] As an example but not limitation, in the process that the mobile phone establishes the collaborative connection with the tablet computer through Bluetooth, in order to display the progress of establishing the collaborative connection, the mobile phone can also display a third prompt window for indicating that the connection is being established, for example, a third prompt window as shown in the (b) of FIG. 1 can be displayed. Optionally, the third prompt window includes a "cancel" option, so that the user can cancel the connection at any time if needed. Figure 4

[0088] 2. Establish the connection through scanning the code.

[0089] As an example, the user can find the button of "scanning the code to connect" through the path of "my mobile phone" - "connect immediately" - "scan the code to connect" in the interface of the tablet computer, the user clicks the button, and the tablet computer displays a two-dimensional code for establishing the collaborative connection in response to the triggering operation of the user on the button, for example, a two-dimensional code as shown in the (a) of FIG. 2 can be displayed. Optionally, the tablet computer can also display second operation prompt information for prompting the user how to operate to realize the multi-screen collaboration, for example, as shown in the (b) of FIG. 2, the second operation prompt information can be "use the mobile phone browser to scan the code to connect". Figure 5 Figure 5

[0090] In an example, referring to the interface schematic diagram of the mobile phone as shown in the (a) of FIG. 3, the user can enter the interface in which the "scan the code" option is displayed in the browser (or intelligent vision) of the mobile phone, for example, the user can enter the interface of the browser as shown in the (a) of FIG. 3 in which the "scan the code" option 61 is displayed. The user can click the "scan the code" option 61, and the mobile phone starts the camera in response to the triggering operation of the user on the "scan the code" option 61, displays the scanning code interface as shown in the (b) of FIG. 3, so that the user can perform the scanning code operation by aiming the camera at the two-dimensional code displayed by the tablet computer. Figure 6 Figure 6 Figure 6

[0091] In an example, after the mobile phone successfully scans the code, the mobile phone sends a request for establishing the collaborative connection to the tablet computer. After receiving the request sent by the mobile phone, the tablet computer can display a fourth prompt window, the fourth prompt window includes prompt information for prompting the user whether to agree to establish the collaborative connection, for example, the prompt information can include the prompt content of "xx device requests to establish the collaborative connection with this end, do you agree to establish the collaborative connection?", and the "agree" option and the "reject" option. When the user clicks the "agree" option, it means that the user allows the mobile phone to establish the collaborative connection with the tablet computer, and the tablet computer establishes the collaborative connection with the mobile phone in response to the triggering operation of the user on the "agree" option. When the user clicks the "reject" option, it means that the user does not allow the mobile phone to establish the collaborative connection with the tablet computer, and the tablet computer notifies the mobile phone that the establishment of the collaborative connection fails in response to the triggering operation of the user on the "reject" option. ​​​​​​

[0092] It should be noted that the above example only illustrates how a user can open a QR code on a tablet via the path "My Phone" - "Connect Now" - "Scan to Connect". Optionally, the QR code can also be opened via other paths. For example, ... Figure 3 As shown in Figure (b), in addition to the initial operation prompt, the first prompt window also includes the message "Cannot find this device? You can also connect by scanning the QR code." The phrase "connect by scanning the QR code" is triggerable. The user can click on the "connect by scanning the QR code" message in the first prompt window, and the tablet computer responds to the user's triggering action by displaying the following... Figure 5 The QR code shown is displayed. Users can then scan the QR code displayed on the tablet with their mobile phones to establish a collaborative connection.

[0093] 3. Establish a connection by tapping.

[0094] Users can enable NFC and multi-screen collaboration on both their phones and tablets. Then, the user taps the NFC area on the back of the phone (usually around the rear camera) against the NFC area on the tablet (usually located in the lower right corner). The phone and tablet respond to the touch and establish a collaboration connection via NFC. Optionally, before establishing the collaboration connection via NFC, the tablet and phone can prompt the user for consent. After the user consents, the phone and tablet will proceed with establishing the collaboration connection. In one example, when the phone and tablet successfully establish a collaboration connection, the phone can also notify the user via vibration or ringing.

[0095] It should be noted that the above-described possible connection methods are all illustrated using wireless connection as an example. In another embodiment, a wired connection can also be used, such as a Type-C to High Definition Multimedia Interface (HDMI) cable. This application does not limit this method.

[0096] After the mobile phone and tablet successfully establish a collaborative connection, such as Figure 7 As shown, the tablet computer mirrors the phone's screen. This allows users to control the phone's functions by manipulating the phone's screen displayed on the tablet. In one example, the phone and tablet simultaneously display... Figure 7The main interface of the phone is shown. If the user wants to make a call, the user can click the icon for making a call in the main interface of the phone displayed by the tablet computer to open the dialing interface of the phone. At this time, the phone and the tablet computer synchronously display the dialing interface of the phone. Then the user can make a dialing operation in the dialing interface of the phone displayed by the tablet computer to make a call in the phone.

[0097] After the call is made in the phone, if the phone starts to make a carrier call, as shown in Figure 8 , the phone and the tablet computer synchronously display the call interface of the phone. During the carrier call of the phone, the switching to the tablet computer for collecting and playing the call voice can be selected, that is, the collaborative call can be made. Specifically, during the collaborative call of the phone and the tablet computer, the microphone of the tablet computer collects the call voice of the local user and sends the call voice to the phone, and the phone sends the call voice to the remote call device; the remote call device sends the call voice of the remote user to the phone, and the phone sends the call voice to the tablet computer, and the loudspeaker of the tablet computer plays the call voice.

[0098] For example, after the multi-screen collaboration of the phone and the tablet computer, if the phone starts to make a carrier call, as shown in Figure 8 , the user pulls down the notification bar of the tablet computer, and the notification bar of the tablet computer can display the prompt content of "collaborated to the phone". The notification bar can also include a switch for switching the call voice to the tablet computer. The user can operate the switch according to the requirement to indicate whether to switch the call voice to the tablet computer, that is, whether to make the collaborative call. Alternatively, the user can also pull down the notification bar of the phone, and the notification bar of the phone can display the prompt content of "collaborated to the tablet computer". The notification bar can also include a switch for switching the call voice to the tablet computer. The user can operate the switch according to the requirement to indicate whether to make the collaborative call. If the user indicates to switch the call voice to the tablet computer, that is, to make the collaborative call, by operating the switch for switching the call voice to the tablet computer on the tablet computer or the phone during the carrier call of the phone, the collection and playing of the call voice of the carrier call of the phone being made are executed on the tablet computer. If the user indicates not to switch the call voice to the tablet computer, that is, not to make the collaborative call, by operating the switch for switching the call voice to the tablet computer on the tablet computer or the phone during the carrier call of the phone, the collection and playing of the call voice of the carrier call of the phone being made are still executed on the phone.

[0099] It is worth noting that in some embodiments, in the scenario of multi-screen cooperation, the phone can also automatically perform the cooperative call when the carrier call is performed by default. That is, after the phone cooperates with the tablet, if the phone starts the carrier call, the cooperative call can be automatically performed without user operation, that is, the collection and playing of the call voice is automatically switched to the tablet. In this case, if the user does not want to perform the cooperative call, the switch for switching the call voice to the tablet can be operated on the tablet or the phone to indicate that the call voice is not switched to the tablet, that is, the cooperative call is closed, and the call voice is switched back to the phone. At this time, the collection and playing of the call voice of the carrier call being performed by the phone are switched back to the phone to continue to be performed.

[0100] From the above description, if it is necessary to implement the cooperative call in the case that the phone cooperates with the tablet, the phone needs to listen to the call state of the SIM card installed in the phone to determine whether the phone starts the carrier call. When the phone listens to the call state of the SIM card from idle to call, it can be determined that the phone starts the carrier call, and the phone can be switched to the tablet to collect and play the call voice, that is, to perform the cooperative call.

[0101] Therefore, the embodiment of the present application provides a call state listening method, which can simply, quickly, accurately and efficiently listen to the call state of all SIM cards installed in the phone when the phone cooperates with the tablet, and can improve the flexibility and reliability of the call state listening.

[0102] The call state listening method provided by the embodiment of the present application is applied to a multi-screen cooperation system, and the multi-screen cooperation system will be described below.

[0103] Figure 9 is a schematic diagram of a multi-screen cooperation system provided by the embodiment of the present application. Referring to Figure 9 , the multi-screen cooperation system can include a first device 901 and a second device 902. The first device 901 and the second device 902 can communicate through wired connection or wireless connection.

[0104] The first device 901 and the second device 902 can both be terminals, which can be the terminal as described above. Figures 1-2The terminal can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a television, or the like, and embodiments of the present application do not limit the terminal.

[0105] The first device 901 and the second device 902 can perform multi-screen cooperation. After the first device 901 and the second device 902 perform multi-screen cooperation, the screen of the first device 901 can be displayed on the interface of the second device 902.

[0106] The first device 901 and the second device 902 can be different types of terminals or the same type of terminals, and embodiments of the present application do not limit the terminal. For example, both can be a mobile phone or a tablet computer.

[0107] In a possible implementation, the screen size of the first device 901 is smaller than the screen size of the second device 902. When the small screen and the large screen perform multi-screen cooperation, the screen of the small screen is displayed as a window on the interface of the large screen, so that the user can operate the screen of the small screen in the interface of the large screen, and the operation experience of the user is improved. For example, the first device 901 is a mobile phone, and the second device 902 is a tablet computer or a television. Alternatively, the first device 901 is a tablet computer, and the second device 902 is a television. Of course, the screen size of the first device 901 can also be larger than the screen size of the second device 902. For example, the first device 901 is a tablet computer, and the second device 902 is a mobile phone.

[0108] In the case where the first device 901 and the second device 902 perform multi-screen cooperation, the first device 901 needs to listen to the call state of the SIM card installed in the first device 901 to determine whether the first device 901 starts to perform the operator call, so as to determine whether to switch to the second device 902 to collect and play the call voice, that is, to determine whether to perform the cooperative call. The call state listening method provided in the embodiments of the present application is applied to the scenario where the first device 901 and the second device 902 perform multi-screen cooperation. In this case, the first device 901 can simply, quickly, accurately and efficiently listen to the call state of all SIM cards installed in the first device 901 when the first device 901 and the second device 902 perform multi-screen cooperation by executing the call state listening method provided in the embodiments of the present application, and the flexibility and reliability of the call state listening can be improved.

[0109] The call state monitoring method provided by the embodiments of the present application is explained in detail as follows.

[0110] The call state monitoring method provided by the embodiments of the present application is applied to a first device, and the first device and a second device can perform multi-screen cooperation. The multi-screen cooperation refers to displaying a screen picture of the first device on an interface of the second device.

[0111] After the multi-screen cooperation between the first device and the second device, the screen picture of the first device is displayed on the interface of the second device. In this case, the user can operate the screen picture of the first device displayed in the interface of the second device to make the first device perform a corresponding function. The first device and the second device can perform multi-screen cooperation in a plurality of possible ways, such as through Bluetooth, scanning a code, and bumping, which have been described in detail above, and the embodiments of the present application will not be repeated here.

[0112] The first device is a device capable of performing carrier call. One or more SIM cards can be installed in the first device, and the first device can perform carrier call using any one of the one or more SIM cards. For example, in the case where the first device is installed with only one SIM card, the first device can directly perform carrier call using the SIM card, such as making a call or receiving an incoming call using the SIM card. In the case where the first device is installed with a plurality of SIM cards, the first device can perform carrier call using one of the plurality of SIM cards, such as making a call or receiving an incoming call using the SIM card.

[0113] Next, the carrier call scenario and the call voice switching scenario involved in the case where the first device and the second device perform multi-screen cooperation are described.

[0114] Carrier call scenario:

[0115] In the case where the first device and the second device perform multi-screen cooperation, the user can directly operate in the first device to make the first device start carrier call, or the user can operate in the second device to make the first device start carrier call.

[0116] For example, in the case of making a call in the first device to start carrier call, several possible operation modes are described.

[0117] In the first possible operation mode, if the user wants to make a call in the first device, the user can directly perform operation in the first device to achieve this.

[0118] For example, the user can click the icon of making a call in the home interface of the first device to open the dialing interface of the first device, and then the user can perform dialing operation in the dialing interface of the first device to make a call in the first device to start the carrier call. In the case that the first device is installed with only one SIM card, the user can directly perform dialing operation in the dialing interface of the first device, so as to make a call in the first device by using the SIM card; in the case that the first device is installed with multiple SIM cards, the user can first select a SIM card in the dialing interface of the first device, and then perform dialing operation in the dialing interface of the first device, so as to make a call in the first device by using the selected SIM card.

[0119] In the second possible operation mode, if the user wants to make a call in the first device, the user can perform operation in the second device to realize the operation.

[0120] For example, after the first device and the second device perform multi-screen cooperation, the first device and the second device synchronously display the home interface of the first device, the user can click the icon of making a call in the home interface of the first device displayed by the second device to open the dialing interface of the first device, at this time, the first device and the second device synchronously display the dialing interface of the first device, and then the user can perform dialing operation in the dialing interface of the first device displayed by the second device to make a call in the first device to start the carrier call. In the case that the first device is installed with only one SIM card, the user can directly perform dialing operation in the dialing interface of the first device displayed by the second device, so as to make a call in the first device by using the SIM card; in the case that the first device is installed with multiple SIM cards, the user can first select a SIM card in the dialing interface of the first device displayed by the second device, and then perform dialing operation in the dialing interface of the first device displayed by the second device, so as to make a call in the first device by using the selected SIM card.

[0121] In the third possible operation mode, if the user wants to make a call in the first device, the user can perform operation in both the first device and the second device to realize the operation.

[0122] For example, after the first device and the second device perform multi-screen cooperation, the first device and the second device synchronously display the home interface of the first device, and the user can click the icon for dialing a phone in the home interface of the first device displayed by the second device to open the dialing interface of the first device. At this time, the first device and the second device synchronously display the dialing interface of the first device, and then the user can perform dialing operation in the dialing interface of the first device to dial a phone in the first device to start the carrier call. In the case where the first device is installed with only one SIM card, the user can directly perform dialing operation in the dialing interface of the first device, so as to dial a phone in the first device by using the SIM card. In the case where the first device is installed with multiple SIM cards, the user can first select a SIM card in the dialing interface of the first device, and then perform dialing operation in the dialing interface of the first device, so as to dial a phone in the first device by using the selected SIM card.

[0123] For example, after the first device and the second device perform multi-screen cooperation, the first device and the second device synchronously display the home interface of the first device, and the user can click the icon for dialing a phone in the home interface of the first device displayed by the second device to open the dialing interface of the first device. At this time, the first device and the second device synchronously display the dialing interface of the first device, and then the user can perform dialing operation in the dialing interface of the first device to dial a phone in the first device to start the carrier call. In the case where the first device is installed with only one SIM card, the user can directly perform dialing operation in the dialing interface of the first device, so as to dial a phone in the first device by using the SIM card. In the case where the first device is installed with multiple SIM cards, the user can first select a SIM card in the dialing interface of the first device, and then perform dialing operation in the dialing interface of the first device, so as to dial a phone in the first device by using the selected SIM card.

[0124] For example, in the case of starting the carrier call by answering an incoming call in the first device, several possible operation modes are described.

[0125] The first possible operation mode is that when the first device has an incoming call, if the user wants to answer the incoming call in the first device, the user can directly perform operation in the first device to achieve the purpose.

[0126] For example, if the first device has an incoming call, the first device displays an incoming call interface, and the user can click a call answering button in the incoming call interface of the first device to answer the incoming call in the first device to start the carrier call. In the case where the first device has only one SIM card installed, the incoming call in the first device is an incoming call for the SIM card, and thus the incoming call is answered in the first device using the SIM card. In the case where the first device has multiple SIM cards installed, the incoming call in the first device is an incoming call for one of the multiple SIM cards, and thus the incoming call is answered in the first device using the SIM card.

[0127] In the second possible operation mode, if the user wants to answer the incoming call in the first device when the first device has the incoming call, the user can perform an operation on the second device in multi-screen cooperation with the first device to achieve the operation.

[0128] For example, after the first device and the second device perform multi-screen cooperation, if the first device has an incoming call, the first device and the second device synchronously display an incoming call interface of the first device, and the user can click a call answering button in the incoming call interface of the first device displayed on the second device to answer the incoming call in the first device to start the carrier call. In the case where the first device has only one SIM card installed, the incoming call in the first device is an incoming call for the SIM card, and thus the incoming call is answered in the first device using the SIM card. In the case where the first device has multiple SIM cards installed, the incoming call in the first device is an incoming call for one of the multiple SIM cards, and thus the incoming call is answered in the first device using the SIM card.

[0129] Voice call switching scenario:

[0130] In the case where the first device and the second device perform multi-screen cooperation, the first device and the second device each include a cooperative call switch, which is used to indicate whether the second device performs collection and playing of call voice when the first device performs the carrier call, that is, whether the cooperative call function is enabled. For example, the cooperative call switch can be included in the pull-down notification bar of the first device and the pull-down notification bar of the second device, so that the user can open or close the cooperative call switch in the first device or the second device. Of course, the cooperative call switch can also be arranged in other interfaces of the first device and the second device, and embodiments of the present application do not limit this.

[0131] When the collaborative call switch is opened, i.e. the collaborative call function is opened. In this case, if the first device makes the carrier call in the process of multi-screen collaboration with the second device, the collaborative call will be made in the process that the first device makes the carrier call, i.e. the call voice will be collected and played through the second device in the process that the first device makes the carrier call. Specifically, when the first device and the second device make the collaborative call, the microphone of the second device collects the call voice of the local user and sends it to the first device, and the first device sends the call voice to the remote call device; the remote call device sends the call voice of the remote user to the first device, and the first device sends the call voice to the second device, and the second device plays the call voice through the loudspeaker.

[0132] When the collaborative call switch is closed, i.e. the collaborative call function is closed. In this case, if the first device makes the carrier call in the process of multi-screen collaboration with the second device, the collaborative call will not be made in the process that the first device makes the carrier call, i.e. the call voice will still be collected and played by the first device in the process that the first device makes the carrier call. Specifically, the microphone of the first device collects the call voice of the local user and sends it to the remote call device; the remote call device sends the call voice of the remote user to the first device, and the first device plays the call voice through the loudspeaker.

[0133] It is worth noting that when the first device and the second device just start multi-screen collaboration, the collaborative call function will be opened by default. That is, when the first device and the second device just start multi-screen collaboration, the collaborative call switch in the first device and the second device is in the opened state.

[0134] As an example, if the user wants to close the collaborative call function, the user can directly close the collaborative call switch in the first device or directly close the collaborative call switch in the second device in the process of multi-screen collaboration of the first device and the second device to close the collaborative call function. If the user wants to open the collaborative call function after closing the collaborative call function, the user can directly open the collaborative call switch in the first device or directly open the collaborative call switch in the second device in the process of multi-screen collaboration of the first device and the second device to open the collaborative call function.

[0135] For example, the collaborative call function has been opened in the process of multi-screen collaboration of the first device and the second device. If the first device has not started the carrier call, the user wants to close the collaborative call function, and can directly close the collaborative call switch in the first device or the second device. In this way, if the first device starts the carrier call subsequently, the call voice will still be collected and played by the first device.

[0136] Or, the collaborative call function has been closed in the process of multi-screen cooperation between the first device and the second device. If the first device has not started the carrier call, the user can directly open the collaborative call switch in the first device or the second device. In this way, if the first device subsequently starts the carrier call, the second device collects and plays the call voice.

[0137] For another example, the opening and closing of the collaborative call function can also be determined by the user's dialing behavior or the behavior of answering the incoming call. Specifically, if the user directly dials a phone or answers an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be closed, that is, the first device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the closed state. Or, if the user operates the screen image of the first device displayed by the second device to dial a phone or answer an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be opened, that is, the second device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the open state.

[0138] For another example, the opening and closing of the collaborative call function can also be determined by the user's dialing behavior or the behavior of answering the incoming call. Specifically, if the user directly dials a phone or answers an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be closed, that is, the first device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the closed state. Or, if the user operates the screen image of the first device displayed by the second device to dial a phone or answer an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be opened, that is, the second device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the open state.

[0139] For another example, the opening and closing of the collaborative call function can also be determined by the user's dialing behavior or the behavior of answering the incoming call. Specifically, if the user directly dials a phone or answers an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be closed, that is, the first device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the closed state. Or, if the user operates the screen image of the first device displayed by the second device to dial a phone or answer an incoming call on the first device in the process of multi-screen cooperation between the first device and the second device, the collaborative call function will be opened, that is, the second device collects and plays the call voice in the process of carrier call of the first device, and the collaborative call switches in the first device and the second device are also in the open state.

[0140] As can be seen from the above description, the user can open and close the collaborative call function in two ways.

[0141] Specifically, if the first device receives a first instruction triggered by a user in the process of multi-screen cooperation with the second device, the first device can close the cooperative call function. The first instruction is used to instruct the first device to collect and play the voice of the carrier call when the first device makes the carrier call. Alternatively, the first instruction is triggered when the user closes the cooperative call switch on the first device or the second device; or the first instruction is triggered when the user makes a call or answers an incoming call on the first device.

[0142] If the first device receives a second instruction triggered by a user in the process of multi-screen cooperation with the second device, the first device can start the cooperative call function. The second instruction is used to instruct the second device to collect and play the voice of the carrier call when the first device makes the carrier call. Alternatively, the second instruction is triggered when the user opens the cooperative call switch on the first device or the second device; or the second instruction is triggered when the user operates the screen image of the first device displayed by the second device to make a call or answer an incoming call on the first device.

[0143] Next, the overall flow of the call state monitoring method provided by the embodiment of the application is described.

[0144] Figure 10 is a flowchart of a call state monitoring method provided by the embodiment of the application. Referring to Figure 10 , the method comprises:

[0145] Step 1001: When the first device starts multi-screen cooperation with the second device, the first device acquires the identity of each SIM card among all the SIM cards installed on the first device, respectively creates a corresponding listener according to the identity of each SIM card among all the SIM cards, and starts the listener corresponding to each SIM card among all the SIM cards to monitor the call state of each SIM card.

[0146] When the first device starts multi-screen cooperation with the second device, the cooperative call function is started by default, and at this time, the cooperative call switches in the first device and the second device are both in the open state. Thus, in order to realize cooperative call, the call state of all the SIM cards installed on the first device needs to be monitored.

[0147] In this case, when the first device starts multi-screen cooperation with the second device, the first device can acquire the identity of each SIM card among all the SIM cards installed on the first device, and respectively create a corresponding listener according to the identity of each SIM card among all the SIM cards and start the listener. In this way, each listener can monitor the call state of the SIM card corresponding to the listener, so that the call state of any SIM card used for carrier call can be monitored. Moreover, even if the first device switches from one SIM card to another SIM card during the process of carrier call using the one SIM card, the call state can still be monitored.

[0148] The one or more SIM cards installed in the first device have an identity (which can be referred to as a subID). For any SIM card, the identity of the SIM card is used to uniquely identify the SIM card.

[0149] The first device can have one or more card slots, each of which is used to install a SIM card, that is, each card slot corresponds to the SIM card installed thereon. After a SIM card is installed into a card slot in the first device, the first device can use the SIM card to make a call or receive an incoming call, that is, the first device can use the SIM card to make a carrier call.

[0150] In this case, the operation of the first device obtaining the identity of each of the SIM cards installed in the first device can be that the first device obtains the identity of each of the card slots used to install a SIM card in the first device, and then obtains the identity of the SIM card installed in each card slot according to the identity of each of the card slots.

[0151] The one or more card slots in the first device have an identity. For any card slot, the identity of the card slot is used to uniquely identify the card slot. The first device stores the identity of each of the card slots in advance.

[0152] As an example, the first device can store a correspondence between the identity of a card slot and the identity of a SIM card, which includes the identity of each of the card slots in the first device. For any card slot in the first device, if a SIM card is inserted into the card slot, the first device can store the identity of the SIM card as the identity of the SIM card corresponding to the identity of the card slot in the correspondence. If the SIM card is removed from the card slot, the first device can delete the identity of the SIM card corresponding to the identity of the card slot in the correspondence, and at this time, the identity of the card slot does not have a corresponding identity of a SIM card in the correspondence.

[0153] For example, the correspondence between the identity of a card slot and the identity of a SIM card can be as shown in Table 1. In the correspondence shown in Table 1, the identity of a card slot 1 corresponds to the identity of a SIM card 1, and the identity of a card slot 2 does not have a corresponding identity of a SIM card. According to the correspondence shown in Table 1, the card slot identified by the identity of the card slot 1 installs the SIM card identified by the identity of the SIM card 1, and the card slot identified by the identity of the card slot 2 currently does not install a SIM card.

[0154] Table 1

[0155] Card slot identification SIM card identification Card slot identification 1 SIM card identification 1 Card slot identification 2

[0156] In the embodiments of the present application, the correspondence between the card slot identifiers and the SIM card identifiers is described by taking Table 1 as an example, and Table 1 does not limit the embodiments of the present application.

[0157] In this case, the operation of the first device obtaining the identifier of the SIM card installed in each card slot according to the identifier of each card slot among all the card slot identifiers can be as follows: for the identifier of each card slot among all the card slots in the first device, the first device can obtain the corresponding SIM card identifier from the correspondence between the card slot identifiers and the SIM card identifiers according to the identifier of the card slot, and the obtained SIM card identifier is the identifier of the SIM card installed in the card slot. If the first device does not obtain the corresponding SIM card identifier from the correspondence between the card slot identifiers and the SIM card identifiers according to the identifier of the card slot, it indicates that the card slot is currently not installed with a SIM card.

[0158] For example, the first device has two card slots, one card slot has an identifier of card slot identifier 1, and the other card slot has an identifier of card slot identifier 2. The first device obtains the corresponding SIM card identifier as SIM card identifier 1 from the correspondence between the card slot identifiers and the SIM card identifiers shown in Table 1 according to the card slot identifier 1, and the obtained SIM card identifier 1 is the identifier of the SIM card installed in the card slot identified by the card slot identifier 1. Moreover, the second device does not obtain the corresponding SIM identifier from the correspondence between the card slot identifiers and the SIM card identifiers shown in Table 1 according to the card slot identifier 2, and it can be determined that the card slot identified by the card slot identifier 2 is currently not installed with a SIM card. In this way, the first device obtains the identifier of all the SIM cards installed in the first device (i.e., the SIM card installed in the card slot identified by the card slot identifier 1) as SIM card identifier 1.

[0159] As an example, the identifier of the SIM card installed in any card slot can be generated according to the number of SIM cards that have been installed in the card slot. For example, after a SIM card is inserted into a card slot, if the SIM card is the i th SIM card installed in the card slot, that is, i-1 SIM cards have been installed in the card slot before the SIM card is installed in the card slot, the first device can set the identifier of the SIM card as i. Wherein, i is a positive integer.

[0160] That is, the identification of the SIM card installed in the card slot is incremental. For example, the identification of the first SIM card inserted into the card slot can be 1. If another SIM card is inserted into the card slot after the first SIM card is removed, the SIM card currently inserted is the second SIM card inserted into the card slot, and the identification of the second SIM card can be 2. If a SIM card is inserted into the card slot after the second SIM card is removed, the SIM card currently inserted is the third SIM card inserted into the card slot, and the identification of the third SIM card can be 3.

[0161] The listener corresponding to each SIM card is used to listen to the call state of the corresponding SIM card. That is, for any one of the SIM cards installed in the first device, the first device can create the listener corresponding to the SIM card according to the identification of the SIM card. The listener corresponding to the SIM card is used to listen to the call state of the SIM card.

[0162] The call state is used to indicate the transition from idle to offhook, or the transition from offhook to idle. For a SIM card, if the SIM card is idle, it means that the SIM card is not used for operator call; if the SIM card is offhook, it means that the SIM card is used for operator call. In this case, if the first device starts to make an operator call using the SIM card, the call state of the SIM card will change from idle to offhook. After that, if the first device hangs up the operator call made by the SIM card, the call state of the SIM card will change from offhook to idle.

[0163] The listener (also referred to as a listener object) is a listening interface, which is used to receive the call state change event of the SIM card, and thus the call state of the SIM card can be determined. For example, when the call state of a SIM card changes, that is, when the call state of the SIM card changes from idle to offhook, or from offhook to idle, a call state change event will be generated. At this time, the listener corresponding to the SIM card can receive the call state change event of the SIM card, and according to the call state change event, it can be determined whether the call state of the SIM card changes from idle to offhook, or from offhook to idle.

[0164] As an example, the listener can be registered by a call management object. The call management object is used to manage the call state of the SIM card. For example, the call management object can be a TelephonyManager, which is a service class for managing the call state and network information.

[0165] In this case, the operation of the first device creating the corresponding listener according to the identifier of each SIM card in all SIM cards can be: for each SIM card in all SIM cards installed by the first device, the first device creates a call management object corresponding to the SIM card according to the identifier of the SIM card. Then, the first device registers a listener as the corresponding listener of the SIM card through the call management object corresponding to the SIM card.

[0166] Since the call management object corresponding to the SIM card is created according to the identifier of the SIM card, the call management object corresponding to the SIM card is used to manage the call state of the SIM card. In this case, the listener registered by the call management object corresponding to the SIM card is also used to listen to the call state of the SIM card, that is, the listener registered by the call management object corresponding to the SIM card is also the corresponding listener of the SIM card.

[0167] In this case, if the first device only has one SIM card installed, only the corresponding listener of the SIM card is registered, and when the call state of the SIM card changes, the event notification will be received in the corresponding listener. If the first device has multiple SIM cards installed, the corresponding listeners are registered for the multiple SIM cards respectively, and when the call state of each SIM card changes, the event notification will be received in the corresponding listener.

[0168] After the first device starts the corresponding listener of each SIM card in all SIM cards, the call state of each SIM card can be listened to by the corresponding listener. In this case, whether the first device has one SIM card installed or multiple SIM cards installed, the call state of each SIM card is listened to by the corresponding listener. In this way, whether the first device uses the installed SIM card to make a carrier call, it can be listened to in time. And if the first device switches to another SIM card to make a carrier call during the use of a SIM card to make a carrier call, it can also be listened to in time. The first device can accordingly perform corresponding business processing.

[0169] Step 1002: If the first device receives a first instruction triggered by a user during the multi-screen cooperation with the second device, the first device destroys all listeners for listening to the call state of the SIM card.

[0170] The first instruction is used to close the collaborative call function, i.e., the first instruction is used to instruct the collection and playing of the operator call voice by the first device when the first device makes the operator call. Optionally, the first instruction is triggered when the user closes the collaborative call switch in the first device or the second device; or the first instruction is triggered when the user dials a call or answers an incoming call in the first device. The specific triggering manner of the first instruction has been described in detail above, and the embodiments of the present application will not repeat it here.

[0171] If the first device receives the first instruction triggered by the user in the process of the multi-screen collaboration with the second device, it indicates that the user wants to close the collaborative call function, then the first device has no need of the collaborative call, and thus it is not necessary to continue to monitor the call status of all the SIM cards, and thus the first device can destroy all the listeners for monitoring the call status of the SIM cards.

[0172] Optionally, the first device can destroy only the listener corresponding to each SIM card when destroying all the listeners for monitoring the call status of the SIM cards. Or, the first device can destroy the listener corresponding to each SIM card, the call management object corresponding to each SIM card, and the identifier of each SIM card obtained before.

[0173] Step 1003: If the first device receives the second instruction triggered by the user in the process of the multi-screen collaboration with the second device, the first device re-creates and starts the listener corresponding to each SIM card among all the SIM cards installed in the first device.

[0174] The second instruction is used to open the collaborative call function, i.e., the second instruction is used to instruct the collection and playing of the call voice by the second device when the first device makes the operator call. Optionally, the second instruction is triggered when the user opens the collaborative call switch in the first device or the second device; or the second instruction is triggered when the user operates the screen picture of the first device displayed by the second device to make the first device dial a call or answer an incoming call. The specific triggering manner of the second instruction has been described in detail above, and the embodiments of the present application will not repeat it here.

[0175] If the first device receives the second instruction triggered by the user in the process of the multi-screen collaboration with the second device, it indicates that the user wants to open the collaborative call function, then the first device has the need of the collaborative call, and thus it is necessary to monitor the call status of all the SIM cards, and thus the first device can re-create and start the listener corresponding to each SIM card among all the SIM cards installed in the first device to monitor the call status of all the SIM cards respectively.

[0176] Optionally, if the first device destroyed only the listener corresponding to each SIM card when it previously destroyed all listeners used to monitor the call status of the SIM cards, then when the first device recreates the listeners for each SIM card among all the SIM cards installed on the first device, it can directly create the corresponding listener based on the identifier of each SIM card obtained previously. Specifically, it can register a listener as the corresponding listener through the call management object corresponding to each SIM card created previously. Afterwards, the first device can then start all the listeners created for monitoring the call status of the SIM cards.

[0177] Alternatively, when recreating the listener for each SIM card among all the SIM cards installed on the first device, it can re-obtain the identifier of each SIM card in all the SIM cards installed on the first device, and then create and start the corresponding listener based on the newly obtained identifier of each SIM card. Specifically, the first device can re-obtain the identifier of the SIM card installed in each SIM card slot based on the identifier of each SIM card slot in the first device, and then create a call management object corresponding to each SIM card based on the newly obtained identifier of each SIM card. A listener is then registered through the call management object corresponding to each SIM card as the listener corresponding to each SIM card. Afterwards, the first device starts all the listeners created for monitoring the call status of the SIM cards.

[0178] It is worth noting that in this embodiment, during multi-screen collaboration with the second device, when the first device receives a second command triggered by the user, it can re-acquire the identifier of each SIM card among all the SIM cards installed on the first device. Then, it creates and activates a corresponding listener based on the newly acquired identifier of each SIM card. Thus, even if the user removes a SIM card from the first device or inserts a new SIM card during multi-screen collaboration, the first device can still promptly acquire the identifier of each SIM card currently present and create a listener accordingly to monitor the call status. In other words, in this embodiment, removing or inserting a SIM card during multi-screen collaboration does not affect the accurate judgment of the call status, making it more flexible than existing call status monitoring methods.

[0179] Another point worth noting is that the monitoring of call status in related technologies is a one-time event; that is, monitoring of the call status is started when the service begins and canceled when the service ends. Specifically, a listener is created at the start of the service to start monitoring (i.e., LISTEN_CALL_STATE), and the listener is set to an invalid state at the end of the service to cancel monitoring (i.e., LISTEN_NONE).

[0180] However, in the multi-screen collaboration scenario involved in this application embodiment, the collaborative call function can be turned on and off multiple times, meaning that call status monitoring can be started and canceled multiple times. In this case, if the approach in related technologies is adopted, setting the listener to an invalid state when canceling monitoring, the listener will still be in an invalid state the next time monitoring is started, and the call status cannot be monitored normally. Therefore, related technologies are not applicable to the multi-screen collaboration scenario involved in this application embodiment, and call status monitoring will be abnormal.

[0181] Therefore, such as Figure 11 As shown, in a multi-screen collaboration scenario, this embodiment of the application can be operated according to steps A1-A4: Step A1: The first device detects that listening needs to be canceled (i.e., the first instruction triggered by the user is received, requiring the collaborative call function to be turned off), and executes step A2. Step A2: The first device destroys all listeners used to monitor the call status of the SIM cards (i.e., sets the listener object to null). Step A3: The first device detects that listening needs to be started (i.e., the second instruction triggered by the user is received, requiring the collaborative call function to be enabled), and executes step A4. Step A4: The first device recreates the listener corresponding to each SIM card in all SIM cards installed on the first device (i.e., creates a new listener object) and starts it.

[0182] In other words, when the first device needs to cancel listening, it doesn't invalidate the listeners; instead, it destroys all listeners. Then, each time listening needs to be restarted, the first device recreates the listener for each installed SIM card and restarts it. This ensures that in multi-screen collaboration scenarios where listening needs to be started and canceled multiple times, the newly created listeners can be used to monitor the call status normally after each restart, guaranteeing the reliability of call status monitoring.

[0183] In this embodiment, the first device monitors the call status of each SIM card through a corresponding listener for each SIM card. If the first device detects a change in the call status of any SIM card, it can perform corresponding service processing, such as switching call voice messages, which will be described below.

[0184] For example, for any one of the SIM cards in all the SIM cards installed in the first device, the SIM card can be referred to as a target SIM card. If the first device listens to the call state of the target SIM card through the listener corresponding to the target SIM card and finds that the call state of the target SIM card changes from idle to in-call, it indicates that the first device starts to make a carrier call by using the target SIM card. Therefore, the first device can make a collaborative call during the carrier call by using the target SIM card, that is, the first device can collect and play the call voice through the second device which collaborates with the first device. After that, if the first device listens to the call state of the target SIM card through the listener corresponding to the target SIM card and finds that the call state of the target SIM card changes from in-call to idle, it indicates that the first device has hung up the carrier call made by the target SIM card. Therefore, the first device can end the collaborative call, that is, stop collecting and playing the call voice through the second device.

[0185] The collaborative call made by the first device during the carrier call by using the target SIM card means that the call voice of the carrier call made by the first device by using the target SIM card is switched to the second device, and the second device collects and plays the call voice. Specifically, when the first device collaborates with the second device, the microphone of the second device collects the call voice of the local user and sends it to the first device, and the first device sends the call voice to the remote call device. The remote call device sends the call voice of the remote user to the first device, and the first device sends the call voice to the second device, and the second device plays the call voice through the loudspeaker. After that, if the first device hangs up the carrier call made by the target SIM card, the collaborative call can be ended. In this case, the collection and playing of the call voice return to the original state, that is, the switching back to the first device.

[0186] In some embodiments, the first device starts a collaboration thread when the first device starts to collaborate with the second device. The collaboration thread is used to provide some functional support for the multi-screen collaboration process between the first device and the second device.

[0187] For the operations of obtaining the identifier of each SIM card in all the SIM cards installed in the first device and creating a listener corresponding to each SIM card according to the identifier of each SIM card in all the SIM cards in steps 1001 and 1003, the operations can be performed by the collaboration thread. That is, the first device obtains the identifier of each SIM card in all the SIM cards installed in the first device and creates a listener corresponding to each SIM card according to the identifier of each SIM card in all the SIM cards by running the collaboration thread. That is, the operation of obtaining the identifier of each SIM card and the operation of creating a listener corresponding to each SIM card in the embodiment are completed in the collaboration thread.

[0188] In this case, the operations of starting the listener corresponding to each of the SIM cards in all the SIM cards in the step 1001 and the step 1003 can be performed in a new sub-thread. That is, the first device can start a sub-thread in the cooperative thread, and start the listener corresponding to each of the SIM cards in all the SIM cards by running the sub-thread. That is, the operation of starting the listener to perform the call state monitoring in the embodiment of the application is completed in the sub-thread. In this way, the call state monitoring is processed by the sub-thread, and the call state monitoring does not block the cooperative thread, so that the cooperative thread can be prevented from being deadlocked, and the efficiency is improved.

[0189] Since the monitoring of the call state of the SIM card by the listener needs to be continuously performed, when the first device starts the sub-thread in the cooperative thread, the first device can create a loop object (i.e., a looper object) for the sub-thread. At this time, by running the sub-thread, the listener corresponding to each of the SIM cards in all the SIM cards can be started, and by the loop object of the sub-thread, the listener corresponding to each of the SIM cards can continuously monitor the call state of the corresponding SIM card.

[0190] The loop object of the sub-thread is used to manage a message queue (i.e., a MessageQueue) of the sub-thread. The loop object can make the message queue in a message loop state, that is, the loop object can continuously take messages from the message queue for processing by the sub-thread, and continuously put messages into the message queue. In this way, the sub-thread can continuously run, and the listener started in the sub-thread can continuously monitor the call state of the corresponding SIM card.

[0191] It is worth noting that the monitoring of the call state in the related art is performed in the cooperative thread, and at this time, the loop object of the cooperative thread is used to continuously monitor the call state. In this case, the loop object of the cooperative thread is created by a thread local storage (TLS) manager of the cooperative thread. The role of the TLS manager is to provide local variables within a thread, and the variables work within the life cycle of the thread.

[0192] However, the embodiment of the application performs the monitoring of the call state in a newly started sub-thread, and therefore cannot obtain the loop object of the cooperative thread. Therefore, as shown in FIG. 1B, the embodiment of the application can perform operations according to steps B1-B3: step B1: starting a sub-thread in the cooperative thread. Step B2: creating a loop object for the sub-thread, and specifically, the loop object of the sub-thread can be created by a TLS manager of the sub-thread. Step B3: after the sub-thread is run, the loop object of the sub-thread can be used to continuously monitor the call state of the corresponding SIM card by the listener corresponding to each of the SIM cards. Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12 Figure 12

[0193] As an example, the call state monitoring method provided by the embodiments of the present application can be executed by the DMSDP (also referred to as a virtual modem) in the application framework layer of the first device, the DMSDP can run a cooperative thread, and the sub-thread started by the cooperative thread for monitoring the call state can be a PhoneStateListener thread. In the following, the call state monitoring method is exemplified by taking the DMSDP running a cooperative thread and the sub-thread started by the cooperative thread being a PhoneStateListener thread as an example in combination with Figure 13

[0194] Figure 13 is a flowchart of a call state monitoring method provided by the embodiments of the present application. Referring to Figure 13 , the call state monitoring method can include the following steps C1-C14.

[0195] Step C1: After the first device and the second device are cooperatively connected to start multi-screen cooperation, the multi-screen cooperation application in the application layer of the first device instructs the DMSDP in the application framework layer to start a cooperative thread, and the cooperative thread runs.

[0196] The first device and the second device can realize multi-screen cooperation in a plurality of possible ways, for example, multi-screen cooperation can be realized through Bluetooth, scanning a code, and bumping, and the above-mentioned ways have been described in detail above, and the embodiments of the present application will not be repeated here.

[0197] After the multi-screen cooperation starts, the DMSDP can start the cooperative thread, and through the cooperative thread, the call state can be monitored, which is described in detail as follows.

[0198] Step C2: The cooperative thread obtains the identity of each SIM card in all SIM cards installed in the first device.

[0199] The operation of the cooperative thread obtaining the identity of each SIM card in all SIM cards installed in the first device is the same as the operation of the first device obtaining the identity of each SIM card in all SIM cards installed in the first device in step 1001, and the embodiments of the present application will not be repeated here. For example, the cooperative thread can obtain the identity of each card slot in all card slots for installing SIM cards in the first device, and then obtain the identity of the SIM card installed in each card slot according to the identity of each card slot.

[0200] Step C3: The cooperative thread creates a corresponding call management object according to the identity of each SIM card.

[0201] ​The operation of creating the corresponding listener by the call management object corresponding to each SIM card is the same as the operation of creating the corresponding listener by the call management object corresponding to each SIM card of the first device in step 1001, and details are not repeated herein.

[0202] Step C4: The call management object corresponding to each SIM card creates a corresponding listener.

[0203] The operation of creating the corresponding listener by the call management object corresponding to each SIM card is the same as the operation of creating the corresponding listener by the call management object corresponding to each SIM card of the first device in step 1001, and details are not repeated herein.

[0204] Step C5: The DMSDP starts a sub-thread (i.e., a PhoneStateListener thread) in the cooperative thread, and creates a loop object for the sub-thread.

[0205] The operation of starting a sub-thread in the cooperative thread and creating a loop object for the sub-thread can be referred to the related description of the operation shown in FIG. 10, and details are not repeated herein. Figure 12

[0206] Step C6: After the PhoneStateListener thread is run, the listener corresponding to each SIM card is started to continuously listen to the call state of each SIM card.

[0207] After the listener corresponding to each SIM card is started, the call state of each SIM card can be listened to by the corresponding listener. That is, whether the first device is installed with one SIM card or multiple SIM cards, the call state of each SIM card is listened to by the corresponding listener. In this way, no matter which SIM card installed by the first device is used for operator call, it can be listened to in time. Moreover, if the first device switches to another SIM card for operator call during the process of using one SIM card for operator call, it can also be listened to in time.

[0208] In this case, if the first device uses a certain SIM card to answer an incoming call, the following steps C7-C10 can be performed.

[0209] Step C7: The first device uses a certain SIM card to answer an incoming call.

[0210] Step C8: The listener corresponding to the SIM card listens to the call state of the SIM card changing from idle to in call.

[0211] ​After the first device answers the incoming call using the SIM card, the SIM card is used to make a carrier call, and the call state of the SIM card changes from idle to in-call. The change in the call state is detected by the listener corresponding to the SIM card.

[0212] In step C9, the DMSDP calls back the detected call state to the multi-screen collaboration application, so that the multi-screen collaboration application performs corresponding business processing.

[0213] After the listener corresponding to the SIM card detects the change in the call state, the DMSDP can perform a collaborative callback to notify the multi-screen collaboration application of the call state, so that the multi-screen collaboration application performs corresponding business processing.

[0214] In step C10, the multi-screen collaboration application performs a collaborative call, that is, switches to the second device to collect and play the call voice.

[0215] Specifically, when performing the collaborative call, the microphone of the second device collects the call voice of the local user and sends it to the first device, and the first device sends the call voice to the remote call device; the remote call device sends the call voice of the remote user to the first device, and the first device sends the call voice to the second device, and the loudspeaker of the second device plays the call voice.

[0216] After that, if the first device hangs up the carrier call made by the SIM card, the following steps C11-C14 can be performed.

[0217] In step C11, the first device hangs up the carrier call made by the SIM card.

[0218] In step C12, the listener corresponding to the SIM card detects that the call state of the SIM card changes from in-call to idle.

[0219] After the first device hangs up the carrier call made by the SIM card, the call state of the SIM card changes from in-call to idle, and the change in the call state is detected by the listener corresponding to the SIM card.

[0220] In step C13, the DMSDP calls back the detected call state to the multi-screen collaboration application, so that the multi-screen collaboration application performs corresponding business processing.

[0221] After the listener corresponding to the SIM card detects the change in the call state, the DMSDP can perform a collaborative callback to notify the multi-screen collaboration application of the call state, so that the multi-screen collaboration application performs corresponding business processing.

[0222] Step C14: the multi-screen coordination application ends the coordination call, i.e. stops collecting and playing the call voice through the second device, and switches to collecting and playing the call voice through the first device.

[0223] After the coordination call is ended, the collection and playing of the call voice returns to the original state, i.e. switches back to the first device for execution.

[0224] For the convenience of understanding, the following takes the first device as a mobile phone and the second device as a tablet computer as an example, and Figure 14 and Figure 15 are used to exemplarily illustrate the above call state monitoring method.

[0225] The current mobile phone is generally in a dual-card dual standby mode, i.e. the mobile phone has two card slots and can install two SIM cards. However, the traditional call state monitoring method is for a single-card mobile phone, i.e. the traditional call state monitoring method can only monitor the call state of one SIM card. Thus, when the traditional call state monitoring method is applied to a dual-card mobile phone, the call state of the SIM card in the main card slot is monitored by default, and the call state of the SIM card in the secondary card slot cannot be monitored. In order to solve this problem, the related technology adjusts the traditional call state monitoring method. The call state monitoring method in the related technology is described below in conjunction with Figure 14

[0226] Figure 14 is a schematic diagram of a call state monitoring method provided by the related technology. Referring to Figure 14 , the call state monitoring method can include the following steps D1-D7.

[0227] Step D1: when the mobile phone starts the multi-screen coordination with the tablet computer, a coordination thread is started.

[0228] Step D2: after the coordination thread is run, a call management object is created.

[0229] Step D3: the call management object registers a listener and starts.

[0230] Step D4: the listener monitors the call state of the SIM card in the main card slot of the mobile phone by default.

[0231] If the listener monitors that the call state (i.e. the call state of the SIM card in the main card slot) is changed from idle to in call, the mobile phone performs a coordination call to switch the call voice to the tablet computer.

[0232] Step D5: if the listener monitors that the call state is changed from in call to idle, the call state of the SIM card in each card slot (i.e. the main card slot and the secondary card slot) in the mobile phone is obtained, i.e. the call state of all SIM cards in the mobile phone is obtained. ​

[0233] Step D6: judging whether there is a SIM card in the phone in a call.

[0234] Step D7: if all SIM cards in the phone are idle, ending the collaborative call.

[0235] If there is a SIM card in the phone in a call, the collaborative call is continued.

[0236] That is, in the traditional call state monitoring manner, if the listener monitors that the call state changes from in-call to idle, the collaborative call is directly ended. This results in that the collaborative call can only be implemented when the phone uses the SIM card in the main card slot to make the operator call, so as to switch the call voice to the tablet computer. However, when the phone uses the SIM card in the secondary card slot to make the operator call, the collaborative call cannot be implemented, that is, the call voice switching fails.

[0237] The related technology adjusts the traditional call state monitoring manner. Specifically, when the listener monitors that the call state changes from in-call to idle, the call state of the SIM card in each card slot in the phone is reacquired. If there is any SIM card in a call, the collaborative call is continued. In this way, whether the phone uses the SIM card in the main card slot or the secondary card slot to make the operator call, the collaborative call can be successfully implemented.

[0238] However, the call state monitoring manner in the related technology has the following problems: 1. unreasonable business logic: designed to avoid the problems in the traditional call state monitoring manner, only to quickly solve the problem, the business logic is unreasonable. 2. Resource waste: no matter how many SIM cards are in the phone, as long as the call state changes from in-call to idle, the call state of the SIM card in each card slot in the phone is reacquired, which causes redundant processing and resource waste.

[0239] Therefore, in view of the above problems in the dual-card scenario and the unreasonable related technical solutions, the embodiments of the present application reorganize the business process of call voice switching and propose an optimization scheme. The call state monitoring method provided by the embodiments of the present application will be described below in combination with Figure 15

[0240] Figure 15 is a schematic diagram of a call state monitoring method provided by an embodiment of the present application. Referring to Figure 15 , the call state monitoring method can include the following steps E1-E9.

[0241] Step E1: when the phone starts a multi-screen collaboration with the tablet computer, a collaborative thread is started.

[0242] ​The mobile phone and the tablet computer can realize multi-screen cooperation in various possible manners, such as, through Bluetooth, scanning code, bumping, and the like. The manners have been described in detail above, and thus will not be repeated here.

[0243] The mobile phone starts a cooperation thread when starting multi-screen cooperation with the tablet computer. The operation of starting the cooperation thread in the mobile phone is the same as that in the tablet computer, and thus will not be repeated here. Figure 13 The operation of starting the cooperation thread in step C1 in the embodiment is the same as that in the tablet computer, and thus will not be repeated here.

[0244] Step E2: After the cooperation thread is run, the identification of the SIM card in each card slot in all card slots (i.e., the main card slot and the auxiliary card slot) in the mobile phone is acquired.

[0245] The operation of acquiring the identification of the SIM card in each card slot in all card slots in the mobile phone by the cooperation thread is the same as that in the tablet computer, and thus will not be repeated here. Figure 13 The operation in step C2 in the embodiment is the same as that in the tablet computer, and thus will not be repeated here.

[0246] Step E3: The cooperation thread creates a corresponding call management object according to the identification of each SIM card.

[0247] The operation of creating a corresponding call management object according to the identification of each SIM card by the cooperation thread is the same as that in the tablet computer, and thus will not be repeated here. Figure 13 The operation in step C3 in the embodiment is the same as that in the tablet computer, and thus will not be repeated here.

[0248] Step E4: The call management object corresponding to each SIM card registers a corresponding listener.

[0249] The operation of registering a corresponding listener by the call management object corresponding to each SIM card is the same as that in the tablet computer, and thus will not be repeated here. Figure 13 The operation in step C4 in the embodiment is the same as that in the tablet computer, and thus will not be repeated here.

[0250] That is, in the case that the mobile phone has a main card slot and an auxiliary card slot, the mobile phone creates a corresponding call management object for the SIM card in the main card slot according to the identification of the SIM card in the main card slot, and then the call management object corresponding to the SIM card in the main card slot registers a corresponding listener, which is used to listen to the call state of the SIM card in the main card slot. In addition, the mobile phone creates a corresponding call management object for the SIM card in the auxiliary card slot according to the identification of the SIM card in the auxiliary card slot, and then the call management object corresponding to the SIM card in the auxiliary card slot registers a corresponding listener, which is used to listen to the call state of the SIM card in the auxiliary card slot.

[0251] Step E5: A sub-thread is started in the cooperation thread, and a loop object is created for the sub-thread.

[0252] The operation of starting the sub-thread and creating the loop object for the sub-thread in the cooperative thread is the same as the above Figure 13 The operation in step C5 in the embodiment is the same as the above, and the embodiment of the present application will not be repeated here.

[0253] Step E6: After the sub-thread is run, the listener corresponding to each SIM card is started to continuously monitor the call state of each SIM card.

[0254] The operation of starting the listener corresponding to each SIM card to continuously monitor the call state of each SIM card after the sub-thread is run is the same as the above Figure 13 The operation in step C6 in the embodiment is the same as the above, and the embodiment of the present application will not be repeated here.

[0255] Step E7: Any one of the listeners monitors the call state change (i.e. from idle to in-call, or from in-call to idle).

[0256] When the phone starts to make an operator call using any one of the SIM cards (such as making a call or receiving an incoming call using the SIM card), the call state of the SIM card will change from idle to in-call, and this change in call state will be monitored by the listener corresponding to the SIM card. Alternatively, when the phone ends the operator call being made by a certain SIM card (such as hanging up the operator call being made by the SIM card), the call state of the SIM card will change from in-call to idle, and this change in call state will also be monitored by the listener corresponding to the SIM card.

[0257] Step E8: The sub-thread performs corresponding business processing according to the monitored call state change indication.

[0258] After the call state changes, corresponding business processing can be performed according to the indication, such as performing cooperative call when the call state changes from idle to in-call, or ending cooperative call when the call state changes from in-call to idle.

[0259] Step E9: The cooperative thread performs cooperative callback.

[0260] The cooperative thread can perform cooperative callback to notify the upper-layer application of the monitored call state, so that the upper-layer application can perform corresponding business processing. For example, the upper-layer application can be instructed to start cooperative call or end cooperative call as described in steps C10 or C14 in the embodiment. Figure 13

[0261] ​In the call status monitoring method provided in this application embodiment, after the collaborative thread obtains the identifier of each SIM card in the mobile phone, it creates a corresponding call management object based on the identifier of each SIM card. Then, the call management object corresponding to each SIM card registers a corresponding listener, and each listener can monitor the call status of its corresponding SIM card. Afterwards, a sub-thread is started in the collaborative thread, which can start the listener corresponding to each SIM card to monitor the call status of each SIM card. In this way, the listener corresponding to the SIM card in the primary SIM card slot can monitor the call status of the SIM card in the primary SIM card slot, and the listener corresponding to the SIM card in the secondary SIM card slot can monitor the call status of the SIM card in the secondary SIM card slot. This ensures that regardless of whether the mobile phone is using the SIM card in the primary or secondary SIM card slot for a carrier call, the call status can be monitored. Furthermore, even if the mobile phone switches to another SIM card while using one SIM card for a carrier call, the call status can still be monitored. In addition, since the newly created sub-thread is dedicated to handling call status monitoring, this monitoring will not block the collaborative thread, thus preventing the collaborative thread from getting stuck. The overall solution has a reasonable business logic, and the monitoring process is simple, convenient, accurate, and efficient, avoiding redundant processing and resource waste.

[0262] Figure 16 This is a schematic diagram of a call monitoring device provided in an embodiment of this application. The device can be implemented as part or all of a computer device by software, hardware, or a combination of both. This computer device can be as described above. Figures 1-2 The terminal described in the embodiment. See also Figure 16 The device includes: a listening module 1601, a destruction module 1602, and a creation module 1603.

[0263] The monitoring module 1601 is used to obtain the identifier of each SIM card in all the SIM cards installed in itself when multi-screen collaboration with the second device begins, create a corresponding listener according to the identifier of each SIM card, and start the listener corresponding to each SIM card to monitor the call status of each SIM card. Here, multi-screen collaboration refers to displaying its own screen on the interface of the second device, and the listener corresponding to each SIM card is used to monitor the call status of the corresponding SIM card. The call status is used to indicate whether it has changed from being in a call to being idle, or from being idle to being in a call.

[0264] The destruction module 1602 is used to destroy all listeners used to monitor the call status of the SIM card if a first instruction triggered by the user is received during multi-screen collaboration with the second device. The first instruction is used to instruct itself to collect and play the voice of the operator call when it is making an operator call.

[0265] The creating module 1603 is configured to re-create and start a listener corresponding to each of all SIM cards installed in the device if a second instruction triggered by a user is received in the process of multi-screen cooperation with the second device, the second instruction being used to instruct to collect and play a call voice of the second device when the device is in operation.

[0266] Optionally, the creating module 1603 is configured to:

[0267] re-obtain the identity of each of all SIM cards installed in the device;

[0268] create and start a listener corresponding to each of all SIM cards according to the identity of each of all SIM cards.

[0269] Optionally, the listening module 1601 is configured to:

[0270] obtain the identity of each of all card slots in which the SIM cards are installed in the device;

[0271] obtain the identity of the SIM card installed in each of all card slots according to the identity of each of all card slots.

[0272] Optionally, the listening module 1601 is configured to:

[0273] for each of all SIM cards, create a call management object corresponding to the SIM card according to the identity of the SIM card, the call management object corresponding to the SIM card being used to manage the call state of the SIM card;

[0274] register a listener as the listener corresponding to the SIM card through the call management object corresponding to the SIM card.

[0275] Optionally, the listening module 1601 is configured to:

[0276] start a cooperation thread when the multi-screen cooperation with the second device is started;

[0277] obtain the identity of each of all SIM cards installed in the device by running the cooperation thread, and create a listener corresponding to each of all SIM cards according to the identity of each of all SIM cards.

[0278] Optionally, the listening module 1601 is configured to:

[0279] start a sub-thread in the cooperation thread, and start a listener corresponding to each of all SIM cards by running the sub-thread.

[0280] Optionally, the listening module 1601 is configured to:

[0281] The sub-thread is started in the cooperative thread, and a loop object is created for the sub-thread, each SIM card corresponding listener in all SIM cards is started by running the sub-thread, and the loop object of the sub-thread enables each SIM card corresponding listener to continuously listen to the call state of the corresponding SIM card.

[0282] Optionally, the first instruction is triggered when the user turns off a cooperative call switch in the first device or the second device, and the cooperative call switch is used to indicate whether the call voice collection and playing by the second device is performed when the operator call is performed by the first device; or the first instruction is triggered when the user dials a phone or answers an incoming call in the first device.

[0283] Optionally, the second instruction is triggered when the user turns on the cooperative call switch in the first device or the second device, and the cooperative call switch is used to indicate whether the call voice collection and playing by the second device is performed when the operator call is performed by the first device; or the second instruction is triggered when the user operates the screen picture of the first device displayed by the second device to make the first device dial a phone or answer an incoming call.

[0284] Optionally, the apparatus further comprises:

[0285] The cooperative call module is configured to, if the call state of the target SIM card is converted from idle to call-in by the listener corresponding to the target SIM card, perform the call voice collection and playing by the second device in the process of performing the operator call by using the target SIM card, and the target SIM card is any one of the SIM cards installed by the apparatus.

[0286] Optionally, the apparatus further comprises:

[0287] The stopping module is configured to, if the call state of the target SIM card is converted from call-in to idle by the listener corresponding to the target SIM card, stop the call voice collection and playing by the second device.

[0288] In the embodiments of the present application, when the multi-screen cooperation with the second device is started, the identifier of each SIM card of all the SIM cards installed by the first device is acquired, and a corresponding listener is created and started according to the identifier of each SIM card of all the SIM cards respectively. In this way, each listener can listen to the call state of the corresponding SIM card, so that it can be ensured that the call state can be listened to no matter which SIM card is used to make the operator call. Moreover, even if another SIM card is switched to make the operator call during the process of making the operator call by using a SIM card, the call state can also be listened to. The business logic of the whole scheme is reasonable, and the listening process is simple, convenient, accurate and efficient, which avoids redundant processing and resource waste. Further, if a first instruction triggered by a user is received during the multi-screen cooperation with the second device, all the listeners for listening to the call state of the SIM card are destroyed; if a second instruction triggered by a user is received during the multi-screen cooperation with the second device, the listeners corresponding to each SIM card of all the SIM cards installed by the first device are re-created and started. In this way, the destruction or re-creation of the listeners can be performed according to whether there is a demand for cooperative call, so that the flexibility of the call state listening is improved. Moreover, in the case that the multi-screen cooperation needs to start listening and cancel listening for many times, it can be ensured that the call state can be normally listened to by the newly created listener after each time of starting listening, so that the reliability of the call state listening is ensured.

[0289] It should be noted that the call state listening device provided by the above embodiments is only used as an example for illustrating the division of the above functional modules, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions.

[0290] The functional units and modules in the above embodiments can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware, or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only used for distinguishing each other, and do not limit the protection scope of the embodiments of the present application.

[0291] The call state listening device and the call state listening method provided by the above embodiments belong to the same concept, and the specific working process of the units and modules in the above embodiments and the resulting technical effects can be referred to the method embodiment part, which will not be repeated here.

[0292] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network or other programmable apparatus. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, such as the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium accessible by a computer, or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as digital versatile disc (DVD)) or semiconductor media (such as solid state disk (SSD)) and the like.

[0293] The above is an optional embodiment provided by the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the technical scope disclosed by the present application shall be included in the protection scope of the present application.

Claims

1. A call state monitoring method applied to a first device comprising a plurality of SIM cards, characterized in that, The method comprises: The first device and the second device are connected through a wired connection or a wireless connection, and the first device creates a corresponding listener for each of the plurality of SIM cards to listen to the call state of each of the plurality of SIM cards; the call state is used to indicate a transition from call transfer to idle, or a transition from idle to call transfer; If the first device receives a first instruction triggered by a user, the first device destroys the listener corresponding to each of the plurality of SIM cards, and the first instruction is used to indicate that the first device collects and plays the voice of the operator call when the first device makes an operator call; If the first device receives a second instruction triggered by a user, the first device re-creates the listener corresponding to each of the plurality of SIM cards, and the second instruction is used to indicate that the second device collects and plays the voice of the call when the first device makes an operator call.

2. The method of claim 1, wherein, Before the first device creates a corresponding listener for each of the plurality of SIM cards, the first device obtains the identifier of each of the plurality of SIM cards installed in the first device.

3. The method of claim 2, wherein, If the first device receives a second instruction triggered by a user, the first device re-creates the listener corresponding to each of the plurality of SIM cards, comprising: The first device re-obtains the identifier of each of the plurality of SIM cards; The first device creates a corresponding listener for the identifier of each of the plurality of SIM cards newly obtained.

4. The method of claim 2, wherein, The first device obtains the identifier of each of the plurality of SIM cards installed in the first device, comprising: The first device obtains the identifier of each card slot in the plurality of card slots in the first device for installing a SIM card; The first device obtains the identifier of the SIM card installed in each card slot according to the identifier of each card slot in the plurality of card slots.

5. The method of claim 2, wherein, The first device creates a corresponding listener for each of the plurality of SIM cards, comprising: the first device creates a corresponding listener for the identifier of each of the plurality of SIM cards.

6. The method of claim 5, wherein, The first device creates a corresponding listener for the identifier of each of the plurality of SIM cards, comprising: For each of the plurality of SIM cards, the first device creates a call management object corresponding to each of the plurality of SIM cards according to the identifier of each of the plurality of SIM cards; the call management object corresponding to each of the plurality of SIM cards is used to manage the call state of each of the plurality of SIM cards; The first device registers a listener as the listener corresponding to each of the plurality of SIM cards through the call management object corresponding to each of the plurality of SIM cards.

7. The method of claim 5, wherein, The first device acquires the identity of each of the plurality of SIM cards installed in the first device when the first device cooperates with the second device, and creates a corresponding listener for the identity of each of the plurality of SIM cards. The first device starts a cooperation thread when cooperating with the second device. The first device acquires the identity of each of the plurality of SIM cards installed in the first device by running the cooperation thread and creates a corresponding listener for the identity of each of the plurality of SIM cards.

8. The method of claim 7, wherein, After the first device creates a corresponding listener for each of the plurality of SIM cards, the first device starts the listener corresponding to each of the plurality of SIM cards.

9. The method of claim 8, wherein, The first device starts a sub-thread in the cooperation thread, and starts the listener corresponding to each of the plurality of SIM cards by running the sub-thread. The first device starts a sub-thread in the cooperation thread, and starts the listener corresponding to each of the plurality of SIM cards by running the sub-thread.

10. The method of claim 9, wherein, The first device starts the sub-thread in the cooperation thread and creates a loop object for the sub-thread, and starts the listener corresponding to each of the plurality of SIM cards by running the sub-thread, and through the loop object of the sub-thread, the listener corresponding to each of the plurality of SIM cards continuously listens to the call state of the corresponding SIM card. The first instruction is triggered when a user closes a cooperative call switch in the first device or the second device, and the cooperative call switch is used to indicate whether to collect and play call voice by the second device when the first device makes an operator call; 11. The method of any one of claims 1 to 10, wherein, Or, The first instruction is triggered when a user dials a phone or answers an incoming call in the first device. The second instruction is triggered when a user opens a cooperative call switch in the first device or the second device, and the cooperative call switch is used to indicate whether to collect and play call voice by the second device when the first device makes an operator call; 12. The method of any one of claims 1 to 10, wherein, Or, The second instruction is triggered when a user operates the screen interface of the first device displayed by the second device to make a phone call or answer an incoming call in the first device. The method further comprises:

13. The method of claim 1, wherein, If the first device listens to the call state of the target SIM card changing from idle to in-call through the listener corresponding to the target SIM card, the first device collects and plays call voice through the second device during the process of making an operator call using the target SIM card, and the target SIM card is any one of the plurality of SIM cards installed in the first device. After collecting and playing call voice through the second device during the process of making an operator call using the target SIM card, the method further comprises:

14. The method of claim 13, wherein, ​ If the first device detects, through the listener corresponding to the target SIM card, that the call state of the target SIM card is changed from on-hook to idle, the first device stops collecting and playing the call voice through the second device.

15. A computer device, comprising: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program, when executed by the processor, implements the method of any one of claims 1-14.

16. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, which, when executed on a computer, cause the computer to perform the method of any one of claims 1-14.

Citation Information

Patent Citations

  • Method and system for processing emergency calls on a wireless communication device with a low battery

    CA2598362A1

  • Anti-monitoring method and system and mobile terminal

    CN105451233A