Audio recording method, apparatus, device, medium and program product
By managing recording permissions through a global array of audio policy services, simultaneous recording of multiple applications in an Android all-in-one device is enabled, overcoming the limitations of the default policy and meeting users' personalized recording needs.
Patent Information
- Application Number
- CN202411899456.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-12-20
AI Technical Summary
When multiple applications record simultaneously in an Android all-in-one device, there is a mutual exclusion relationship, which cannot meet the needs of multiple applications recording simultaneously in special scenarios. Furthermore, the default recording strategy cannot be modified to meet the user's personalized customization needs.
This paper provides a recording method that manages the recording permissions of applications through a global array of audio policy services. It supports simultaneous recording by multiple applications, including simultaneous recording policies and mutual exclusion recording policies. Users can customize recording policies to meet different needs.
It enables simultaneous recording of multiple applications, meeting users' recording needs in special scenarios, overcoming the limitations of the default recording strategy, and allowing users to customize recording permissions and priority configurations.
Smart Images

Figure CN119720170B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a recording method, apparatus, device, medium, and program product. Background Technology
[0002] An Android all-in-one device is a multi-functional device that integrates the Android operating system, providing users with a convenient operating experience. In terms of audio processing, it allows applications to record audio via the microphone. For example, voice memo applications can record voice messages using the microphone, and social applications can record voice messages and send them, meeting users' audio needs in different scenarios.
[0003] In related technologies, the Android system uses a default recording strategy to handle application recording requests. This means that when an application uses the microphone to record, it must follow the system's predefined process: first, it requests microphone permission from the system; after authorization, it records through the system's audio architecture. When multiple applications request recording simultaneously, the application that initiates recording is determined based on factors such as priority and running status. For example, if a privacy-sensitive application is recording, other applications cannot record; when multiple ordinary applications have recording needs, only the application that initiates recording later has permission to record.
[0004] The default recording strategy described above has limitations in multi-application recording. When ordinary applications record simultaneously, they will exclude each other, failing to meet the needs of simultaneous recording by multiple applications in special scenarios. Furthermore, the default recording strategy cannot be modified, thus failing to meet users' personalized customization needs. Summary of the Invention
[0005] This application provides a recording method, apparatus, device, medium, and program product that can support simultaneous recording by multiple applications. The technical solution is as follows:
[0006] On the one hand, a recording method is provided, the method comprising:
[0007] In response to detecting a recording start operation of the first application, the global array corresponding to the audio policy service is read, and the global array is used to store the identifier of the application currently recording;
[0008] If the global array includes the identifier of the second application, then obtain the first application list, which contains the identifiers of at least two applications capable of recording simultaneously.
[0009] In response to the fact that the first application list contains the identifier of the first application and the identifier of the second application, the second application is allowed to record audio simultaneously with the first application.
[0010] On the other hand, a recording device is provided, the device comprising:
[0011] An array reading module is used to read a global array corresponding to the audio policy service in response to the detection of a recording start operation of the first application. The global array is used to store the identifier of the application currently recording.
[0012] The acquisition module is configured to acquire a first application list if the global array includes the identifier of a second application, wherein the first application list contains the identifiers of at least two applications capable of recording simultaneously.
[0013] The recording module is configured to, in response to the first application list containing the identifier of the first application and the identifier of the second application, allow the second application to record simultaneously with the first application.
[0014] In an optional embodiment, the first application list contains multiple sub-lists, and applications in the same sub-list have the permission to record simultaneously;
[0015] The recording module is further configured to, in response to the existence of a sublist containing the identifier of the first application and the identifier of the second application in the plurality of sublists, allow the second application to record simultaneously with the first application.
[0016] In an optional embodiment, the recording module is further configured to allow the second application to record simultaneously with the first application in response to the first application list being empty.
[0017] In an optional embodiment, the acquisition module is further configured to acquire the first application list when the simultaneous recording function is enabled and the mutual exclusion recording function is disabled, wherein the mutual exclusion recording function is used to restrict the permission of at least two applications to record simultaneously.
[0018] In an optional embodiment, the acquisition module is further configured to acquire a second application list when the simultaneous recording function is off and the mutual exclusion recording function is on, wherein the second application list contains the identifier of a target application, and the target application refers to an application that exclusively has recording permissions.
[0019] The recording module is further configured to determine the recording status of the first application based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, respectively.
[0020] In an optional embodiment, the recording module is further configured to disallow the first application from recording in response to the target application's identifier being the same as the identifier of the second application.
[0021] In an optional embodiment, the recording module is further configured to, in response to the target application having the same identifier as the first application, allow the first application to record and interrupt the recording of the second application.
[0022] In an optional embodiment, the recording module is further configured to determine the recording status of the first application through a default recording process when the simultaneous recording function is turned off and the mutual exclusion recording function is turned off.
[0023] In an optional embodiment, the apparatus further includes:
[0024] An array update module is used to add the identifier of the first application to the global array.
[0025] In an optional embodiment, the apparatus further includes:
[0026] A configuration module is configured to receive a first configuration operation, wherein the first configuration operation is used to determine the identifiers of applications included in the first application list; display a candidate application list based on the first configuration operation, wherein the candidate application list includes multiple applications that support recording functionality; and, in response to receiving a selection operation for at least two applications in the candidate application list, obtain the first application list based on the identifiers of the at least two applications.
[0027] In an optional embodiment, the configuration module is further configured to receive a second configuration operation, the second configuration operation being used to determine the identifier of a target application included in the second application list; display a candidate application list based on the second configuration operation, the candidate application list including the identifiers of multiple applications that support recording functionality; and, in response to receiving a selection operation for the target application in the candidate application list, obtain the second application list based on the identifier of the target application.
[0028] In an optional embodiment, the first application and the second application can be any type of application.
[0029] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement the recording method as described in any of the embodiments of this application above.
[0030] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the recording method as described in any of the embodiments of this application above.
[0031] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the recording methods described in the above embodiments.
[0032] The beneficial effects of the technical solutions provided in this application include at least the following:
[0033] This method pre-configures multiple applications with simultaneous recording permissions to obtain a first application list, and sets up a global array to store the identifiers of applications currently recording. When the first application requests recording, if the global array indicates that a second application is already recording, it determines whether the first application has permission to record simultaneously with the second application based on the first application list and the global array. If it does, recording permission is granted to the first application. This overcomes the limitations of related technologies using default recording strategies for multi-application recording and meets the need for simultaneous recording of multiple applications. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a schematic diagram of a recording process framework provided in an exemplary embodiment of this application;
[0036] Figure 2 This is a flowchart of a recording method provided in an exemplary embodiment of this application;
[0037] Figure 3 This is a schematic diagram illustrating the configuration of a first application list provided in an exemplary embodiment of this application;
[0038] Figure 4 This is a schematic diagram illustrating the configuration of a second application list provided in an exemplary embodiment of this application;
[0039] Figure 5 This is a flowchart of a method for simultaneous recording of multiple applications provided in an exemplary embodiment of this application;
[0040] Figure 6 This is a flowchart of a multi-application mutual exclusion recording method provided in an exemplary embodiment of this application;
[0041] Figure 7 This is a structural block diagram of a recording device provided in an exemplary embodiment of this application;
[0042] Figure 8 This is a structural block diagram of a recording device provided in another exemplary embodiment of this application;
[0043] Figure 9 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0046] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0047] It should be noted that all information and data involved in this application are authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0048] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0049] First, a brief introduction to the terms used in the embodiments of this application:
[0050] Android all-in-one PC: A device that deeply integrates the Android operating system with computer hardware. Hardware components include a processor, memory, and a touchscreen display, capable of installing and running a large number of applications. Its operation is similar to that of smartphones and tablets; users select target applications using the touchscreen, and the all-in-one PC runs the application and performs its functions.
[0051] In the field of smart office, Android all-in-one machines can be used for video conferencing, document presentation, remote collaboration and other functions in enterprise meeting rooms, improving office efficiency; in the medical field, Android all-in-one machines function as medical self-service terminals, enabling functions such as registration, payment and querying test reports, reducing patient waiting time and improving hospital service efficiency.
[0052] Android all-in-one devices, as a type of comprehensive multi-functional device integrating the Android operating system, have been widely used in many fields due to their numerous advantages, creating a convenient, efficient, and user-friendly operating environment. Android all-in-one devices have a built-in microphone, allowing various applications to record audio.
[0053] For example, voice memo apps can record users' dictated voice messages using a microphone and store them locally; social apps can record voice messages using a microphone and send them to chat.
[0054] To ensure security and privacy when applications are recording audio, Android all-in-one devices typically prohibit other applications from recording simultaneously when one application is recording. Therefore, when multiple applications request to use the microphone to record, the Android system sets a default recording policy for each application's request, determining which applications have recording permissions based on this default policy.
[0055] In the default recording policy, there is usually a recording mutual exclusion relationship between applications other than privileged applications. Privileged applications are those pre-installed on the all-in-one device and have special permissions; applications other than privileged applications are called ordinary applications, which are mostly third-party applications that can be downloaded from app stores, official websites, etc.
[0056] When multiple regular applications request recording simultaneously, the all-in-one device will only grant recording permissions to one of them, while remaining silent on the others. This mutual exclusion between regular applications during recording makes it impossible to meet the needs of multiple applications recording simultaneously.
[0057] Furthermore, the default recording strategy actually assigns a priority to each application, handling resource conflicts when multiple applications request recording simultaneously based on priority, allocating recording permissions to higher-priority applications first. However, the priority of each application cannot be modified, and users cannot set the priority of each application according to their needs, nor can they specify multiple applications to record simultaneously, which greatly limits the recording quality of the all-in-one device. For example, in special and complex scenarios such as online multi-party conference recording and simultaneous audio acquisition in multiple scenarios, it cannot meet the user's need to simultaneously capture voice and record meeting content through multiple applications on the all-in-one device.
[0058] This application provides a recording method that allows configuration of permissions for simultaneous recording by multiple applications. The custom recording strategy includes two options: simultaneous recording strategy and mutual exclusion recording strategy. Users can choose any one of these three strategies—simultaneous recording strategy, mutual exclusion recording strategy, and default recording strategy—to handle simultaneous recording by multiple applications.
[0059] When simultaneous recording is enabled and mutual exclusion recording is disabled, the simultaneous recording strategy is as follows: selected applications can record simultaneously, while unselected applications cannot record simultaneously with other applications.
[0060] When simultaneous recording is disabled and mutual exclusion recording is enabled, the mutual exclusion recording strategy is used: the selected application is set as a high-priority application, and when the high-priority application records, it has exclusive recording permissions and cannot be interrupted; other unselected applications cannot record at the same time as the high-priority application, but they can record at the same time as each other.
[0061] When both simultaneous recording and mutual exclusion recording are disabled, the default recording strategy is used.
[0062] The method provided in this application can meet the user's need for a custom application with simultaneous recording permissions, and solves the problem that multiple ordinary applications cannot record simultaneously.
[0063] Secondly, the recording processing flow involved in the embodiments of this application will be described. Figure 1 This is a schematic diagram of a recording process framework provided in an exemplary embodiment of this application.
[0064] The recording process framework diagram refers to the audio framework diagram of the Android system. The process of an application recording through the microphone in an Android all-in-one device involves the microphone acquiring audio signals and the application obtaining audio signals from the microphone. Therefore, the recording process is mainly implemented by the audio framework of the Android system.
[0065] The diagram includes audio-related applications 110, audio framework 120, Java native interface 130, native audio framework 140, audio binder inter-process communication proxy 150, media service 160, audio hardware abstraction layer 170, operating system kernel 180, and configuration module 190.
[0066] Among them, audio-related applications 110 include applications that use audio, such as recording applications and media playback applications.
[0067] Audio Framework 120 refers to Audio Framework Java, a software framework in the Android system used to handle audio-related functions. It is mainly written in Java (in the Android system, the audio framework also has underlying parts written in other languages). Audio Framework 120 provides a series of application programming interfaces (APIs) that enable audio-related applications 110 to easily implement functions such as audio playback, recording, and audio device management.
[0068] Java Native Interface 130 refers to JNI (Java Native Interface), a programming interface provided by the Java programming language. It allows Java programs to call code written in native languages, such as C or C++, and also allows native code to call Java code. The JNI interface enables the integration of C / C++ code into Java code.
[0069] Java Native Interface 130 mainly involves the following directory paths: (1) frameworks / base / core / jni (first directory path), which mainly stores related files used to implement the interaction between Java and native (such as C or C++) code; (2) frameworks / base / media / jni (second directory path), which mainly involves the implementation part of the interaction between Java and native code in the Android system media function, and is an important link in the communication between the media framework and the underlying native code.
[0070] The native audio framework 140 refers to Audio Framework Native, which is the part of the Android system's audio framework written in a native language (such as C or C++). Corresponding to Audio Framework 120, it is located at the lower level of audio processing, closer to the hardware device, and is mainly responsible for directly interacting with audio hardware (such as microphones, speakers, audio chips, etc.) and performing efficient and complex processing of audio data.
[0071] The local audio framework 140 mainly involves the following source files: (1) AudioRecord.cpp (audio recording source file), which is a C++ source file. In the audio processing mechanism of the Android system, it is mainly used to implement audio recording-related functions. It is a key part of the implementation of the underlying audio recording function. It works with other audio components of the system to provide audio recording services for upper-layer applications; (2) AudioTrack.cpp (audio track source file), which is a C++ source file. It is mainly responsible for the implementation of audio playback-related functions. It is an important part of the underlying mechanism of Android audio playback. It works with other audio components to provide audio playback services for audio-related applications 110.
[0072] Audio Binder IPC Proxies, or Audio Binder IPC Proxies, is a mechanism in the Android audio framework used to implement inter-process communication (IPC). In Android, different components (such as applications and system services) may run in different processes. When audio-related operations require cross-process communication, this proxy mechanism is used. Binder is an important IPC method in Android, and Audio Binder IPC Proxies are proxy modules specifically built for audio-related communication.
[0073] The audio binder inter-process communication agent 150 mainly involves the following source files: (1)
[0074] IAudioRecord.cpp (audio recording interface) defines a series of abstract interfaces for audio recording. These interfaces specify the basic operations of audio recording, such as starting recording, stopping recording, getting recording status and audio data, etc.; (2) IAudioTrack.cpp (audio track interface) defines abstract interfaces related to audio playback, including starting playback, pausing playback, stopping playback, setting playback parameters (such as volume, channel balance, etc.) and getting playback status, etc.; (3) IAudioFlinger.cpp (audio mixer interface) plays a key role in audio processing for mixing and audio stream management. It is responsible for mixing multiple audio sources, such as playing audio from multiple applications at the same time (such as a music player application and a voice navigation application running at the same time), and merging these audio streams into one or more output audio streams through mixing algorithms; (4) lbinder.cpp (lightweight binder) defines how to pass data, call methods and handle remote procedure calls between different processes.
[0075] Media Service 160 refers to Media Service, which is a system service in the Android system responsible for managing and processing various media-related operations. It mainly includes the following components: (1) AudioPolicyService, which is the creator of audio system policies (application recording policies) and is responsible for policy selection for audio device switching, volume adjustment policies, etc.; (2) AudioFlinger, which is the executor of audio system policies and is responsible for the management of audio streaming devices and the processing and transmission of audio streaming data.
[0076] The recording processes involved in this application are mainly implemented by AudioPolicyService.
[0077] Configuration module 190 includes a multi-application simultaneous recording configuration module 191 and a mutual exclusion recording configuration module 192. These two modules configure two independent recording strategies, which are listed alongside the default recording strategy.
[0078] Configuration module 190 saves the simultaneous recording function switch, the mutual exclusion recording function switch, the first application list with simultaneous recording permission, and the second application list with high-priority recording permission for AudioPolicyService to access and use. The state of the simultaneous recording function switch corresponds to that of simultaneous recording configuration module 191, and the state of the mutual exclusion recording function switch corresponds to that of mutual exclusion recording configuration module 192. Note that the simultaneous recording function switch and the mutual exclusion recording function switch cannot be enabled simultaneously.
[0079] When AudioPolicyService handles the recording process, it determines whether to grant recording permissions to the application and how to grant those permissions based on the recording policy configured in configuration module 190.
[0080] If AudioPolicyService determines that the simultaneous recording function is enabled, it means that the simultaneous recording configuration module 191 handles requests for simultaneous recording from multiple applications. The first application list stores the identifiers of multiple applications with simultaneous recording permissions. If the application currently requesting simultaneous recording is an application whose identifier is stored in the first application list, then the application currently requesting simultaneous recording is allowed to record simultaneously.
[0081] If AudioPolicyService determines that the mutual exclusion recording function is enabled, it indicates that the simultaneous recording request from multiple applications is being processed based on the simultaneous mutual exclusion recording configuration module 192. The second application list stores the identifiers of high-priority applications, which are applications with exclusive recording permissions. When a high-priority application is recording, other applications are not allowed to record simultaneously. If a high-priority application identified in the second application list is among the applications currently requesting simultaneous recording, then only the high-priority application is allowed to record. If no high-priority application identified in the second application list is among the applications currently requesting simultaneous recording, then all applications currently requesting simultaneous recording are allowed to record simultaneously.
[0082] If AudioPolicyService determines that both the mutual exclusion recording function and the simultaneous recording function are disabled, it indicates that requests for simultaneous recording from multiple applications will be handled based on the default recording policy. The default recording policy includes permissions for simultaneous recording between applications and whether there is a mutual exclusion recording relationship between applications, which will not be elaborated here.
[0083] It's worth noting that AudioPolicyService maintains a global array to dynamically record all currently recording applications. When an application successfully starts recording, its identifier is stored in the global array; when the application stops recording, its identifier is removed from the global array. AudioPolicyService enables simultaneous and mutually exclusive recording of multiple applications based on the switches set in configuration module 190, the application identifiers in the application list, and the recorded identifiers of all currently recording applications, regardless of the application type or the set audio source. The number of applications recording simultaneously is user-defined and stored in a first application list. The more powerful the all-in-one device's system performance, the more applications can be configured to record simultaneously. This satisfies users' needs to configure simultaneous recording permissions for any number of applications, overcoming the limitation of related technologies that cannot achieve simultaneous recording of multiple ordinary applications using default recording strategies.
[0084] Audio Hardware Abstraction Layer 170 (Audio HAL) is an intermediate layer in the Android system used to isolate audio hardware from the upper-level audio framework and applications. Its main purpose is to provide a unified interface, enabling upper-level audio software (such as the Audio Framework and Media Services) to operate audio hardware devices, including microphones, speakers, headphone jacks, and audio codecs, in a hardware-independent manner. Audio Hardware Abstraction Layer 170 mainly includes the AudioHal Implementation, which is the key link between upper-level audio software (such as the Audio Framework and Media Services) and lower-level audio hardware devices (such as microphones, speakers, and audio codecs), translating the abstract hardware operation interface into actual operation instructions specific to the hardware device.
[0085] Operating system kernel 180 refers to the Linux kernel, which is responsible for managing system hardware resources and software processes, providing core services and functions for the entire operating system. Operating system kernel 180 includes the Audio Driver, which enables the operating system to effectively control and utilize audio hardware to achieve audio playback, recording, and other related functions.
[0086] Based on the above-described recording process framework diagram, the recording method provided in this application will be explained. Within the Android all-in-one system, there are three recording strategies: a default recording strategy, a simultaneous recording strategy configured via the configuration module 190, and a mutually exclusive recording strategy. These three strategies are independent of each other, and only one strategy can be used to handle the problem of multiple applications recording simultaneously.
[0087] Simultaneous recording strategy has a corresponding switch for simultaneous recording function, and mutual exclusion recording strategy has a corresponding switch for mutual exclusion recording function. Only one of the two switches can be turned on at the same time.
[0088] When a first application initiates recording and requests microphone permission, the all-in-one device first obtains the global array, which records the identifier of the currently recording application. If the global array is empty, it means that no application is currently recording, so the first application is allowed to record, and its identifier is added to the global array. When the first application finishes recording, its identifier is removed from the global array.
[0089] If the global array is not empty and contains the identifier of the second application, it indicates that a second application is currently recording, which is a scenario of multiple applications recording simultaneously. The system retrieves the on / off states of the simultaneous recording function and the mutual exclusion recording function. Based on the on / off states of the simultaneous recording function and the mutual exclusion recording function, the system determines the recording strategy to be used.
[0090] 1. When the simultaneous recording function is turned on, the mutual exclusion recording function must be turned off, and the simultaneous recording strategy is used.
[0091] 2. When the mutual exclusion recording function is turned on, the recording function must be turned off at the same time, using the mutual exclusion recording strategy;
[0092] 3. When the simultaneous recording function is turned off, the default recording strategy will be used.
[0093] In summary, the method provided in this application enables users to configure recording strategies according to their needs. When dealing with scenarios where multiple applications simultaneously request recording, the user can switch recording strategies based on their requirements, achieving functions such as simultaneous recording by multiple applications and mutually exclusive recording. Furthermore, when configuring simultaneous and mutually exclusive recording strategies, the nature of the applications is not distinguished; it supports simultaneous recording by multiple applications of different types, and also supports specifying exclusive recording permissions for specific applications. Users can dynamically set the priority of recording applications according to their needs, flexibly achieving mutually exclusive recording between applications. There is no limit to the number of applications that can record simultaneously; the number depends on the performance of the Android all-in-one device.
[0094] Based on the above introduction to terminology and application scenarios, the recording method provided in this application will be explained, taking the method executed by a terminal as an example. Figure 2 As shown, Figure 2 This is a flowchart of a recording method provided in an exemplary embodiment of this application, the method including the following steps.
[0095] Step 210: In response to detecting the recording start operation of the first application, read the global array corresponding to the audio policy service.
[0096] Taking an Android all-in-one device as an example, the first application is the application installed on the terminal, and the terminal runs the first application to realize the program's functions.
[0097] The Audio Policy Service is a service in the Android system responsible for managing audio policies and ensuring the normal operation of audio functions. It is the creator of audio system policies (application recording policies), and is responsible for policy decisions regarding audio device switching, volume adjustment, and more.
[0098] The first application has a recording function. When the recording start operation of the first application is detected, it means that the first application requests to record through the microphone component in the terminal to obtain an audio signal.
[0099] A global array is used to store the identifier of the application currently recording. Based on the global array, it can be determined whether there is an application recording in the terminal at the current moment.
[0100] If an application identifier exists in the global array, it means that multiple applications are requesting recording simultaneously; if no application identifier exists in the global array, it means that only the first application is requesting recording.
[0101] For example, if the global array contains the identifier of application A, it means that application A is recording at the current moment; if the global array contains the identifiers of application A and application B, it means that application A and application B are recording at the current moment.
[0102] The application identifier in the global array is used to uniquely identify the application. The application identifier includes, but is not limited to, the following types:
[0103] (1) Application icon: It is represented by a graphic symbol, usually containing elements such as color and special shape, and is displayed on the terminal's home screen, app store or application list.
[0104] (2) Application name: This is the textual name of the application, used to accurately refer to the application in environments such as app stores and device menus.
[0105] (3) Application numbering: The applications in the terminal are sorted according to preset rules and each application is assigned a unique number, which uniquely identifies the application. For example, the application numbers are assigned according to the order in which the applications were installed on the terminal.
[0106] It is worth noting that the above-mentioned application identifiers are for illustrative purposes only. The application identifier type can be arbitrary, either user-defined or assigned a default identifier by the terminal. This embodiment does not limit this.
[0107] Step 220: If the global array includes the identifier of the second application, then obtain the list of the first applications.
[0108] Taking the example of a global array containing the identifier of a second application, the presence of this identifier indicates that a second application is currently recording. The recording initiation operation of the first application indicates that multiple applications are requesting simultaneous recording. When multiple applications request recording simultaneously, it is necessary to determine whether these applications have the necessary permissions to record simultaneously.
[0109] Optionally, the first application and the second application can be any type of application, including but not limited to: (1) privileged applications, which are applications pre-installed on the terminal, have special permissions, and can act as voice assistants to receive voice commands from users and control applications on the terminal; (2) privacy applications, which are applications that are sensitive to privacy when recording, and privacy applications usually involve information related to user privacy when recording; (3) ordinary applications, which are third-party applications that are different from privileged applications and privacy applications, and can usually be downloaded to the terminal from the official website or application store, or can be user-customized / self-developed applications.
[0110] The first application list contains identifiers of at least two applications that can record simultaneously, and the first application is used to determine whether to allow recording.
[0111] Users can configure the identifiers of the applications included in the first application list, that is, they can choose the applications that can record audio simultaneously.
[0112] Optionally, before obtaining the first application list, a first configuration operation is received, which is used to determine the identifiers of the applications included in the first application list. A candidate application list is displayed based on the first configuration operation, containing multiple applications that support recording functionality. In response to receiving a selection operation for at least two applications in the candidate application list, the first application list is obtained based on the identifiers of the at least two applications.
[0113] Indicative, for reference Figure 3 , Figure 3 This is a diagram illustrating the configuration of the first application list.
[0114] The candidate application list contains the identifiers of four applications: Application 1, Application 2, Application 3, and Application 4, which correspond to Application 1, Application 2, Application 3, and Application 4, respectively.
[0115] Selecting the identifiers for Application 1, Application 2, and Application 3 yields the first application list 300. This allows Application 1, Application 2, and Application 3 to record audio simultaneously.
[0116] The following situations are included: (1) Application 1 and Application 2 record audio at the same time; (2) Application 1 and Application 3 record audio at the same time; (3) Application 2 and Application 3 record audio at the same time; (4) Application 1, Application 2 and Application 3 record audio at the same time.
[0117] The first application list 300 does not contain the identifier for application 4, and application 4 does not have permission to record simultaneously with other applications. For example, when application 1 and application 2 are recording simultaneously, if the recording initiation operation of application 4 is detected, application 4 is not allowed to record.
[0118] Step 230: In response to the first application list containing the identifiers of the first application and the second application, the second application is allowed to record audio simultaneously with the first application.
[0119] For example, the first application list includes the following: the identifier of the first application, the identifier of the second application, the identifier of the third application, and the identifiers of the first application and the second application are present at the same time, allowing the second application and the first application to record simultaneously.
[0120] The process of simultaneous recording by the first application and the second application is as follows: The second application starts recording first, and the microphone component in the terminal collects audio signals based on the recording start operation of the second application. The second application obtains audio signals from the microphone component. During the recording process of the second application, the recording start operation of the first application is detected. If the first application and the second application are allowed to record simultaneously, the first application can obtain audio signals from the microphone component.
[0121] Optionally, in response to the first application list being empty, the second application is allowed to record audio simultaneously with the first application.
[0122] If the first application list is not empty, the applications that can record simultaneously are determined based on the first application list. If the first application list is empty, it means that the user has not configured the specified application with permission to record simultaneously, and instead, all applications in the terminal are allowed to record simultaneously by default. Therefore, the first application and the second application are allowed to record simultaneously.
[0123] By leaving the first application list empty, the user's need to assign simultaneous recording permissions to all applications can be met, eliminating the need for the user to select and configure multiple applications one by one, thus improving the efficiency of the user's recording permission configuration process.
[0124] In some embodiments, applications within the terminal can be grouped, specifying that applications within each group can record simultaneously, while applications belonging to different groups cannot record simultaneously.
[0125] Optionally, the first application list contains multiple sublists, and applications in the same sublist have the permission to record simultaneously. In response to the existence of a sublist containing the identifiers of the first application and the second application, the second application is allowed to record simultaneously with the first application.
[0126] For example, the first application list contains two sub-lists: the first sub-list contains the identifiers of the first application, the second application, and the third application; and the second sub-list contains the identifiers of the fourth application and the fifth application.
[0127] The first sublist contains the identifiers of both the first and second applications, allowing the first and second applications to record simultaneously.
[0128] The applications indicated in each sublist are allowed to record simultaneously, but applications from different sublists that do not both appear in the same sublist are not allowed to record simultaneously. For example, the fourth and fifth applications from the second sublist are allowed to record simultaneously, but the first application from the first sublist and the fourth application from the second sublist are not allowed to record simultaneously.
[0129] Setting recording permissions by grouping them can meet users' needs for customizing application recording permissions, increase the freedom of user customization, and enable users to set simultaneous recording permissions for each application separately.
[0130] After the first application starts recording, add the identifier of the first application to the global array.
[0131] At this point, the global array contains the identifiers of the first application and the second application. When an application stops recording, its identifier is removed from the global array.
[0132] For example, when the first application and the second application are recording simultaneously, the global array contains the identifiers of the first application and the second application; when the second application finishes recording before the first application, the identifier of the second application is removed from the global array; when the first application also finishes recording, the identifier of the first application is removed from the global array, and the global array is empty.
[0133] This application includes several methods for allocating recording permissions when multiple applications request simultaneous recording: a default recording process, a simultaneous recording process, and a mutually exclusive recording process. The above describes the process of the simultaneous recording process. After actually detecting that an application has started recording, it is necessary to first determine the processing flow of the recording operation.
[0134] Optionally, the simultaneous recording process has a corresponding simultaneous recording function switch (control), and the mutual exclusion recording process has a corresponding mutual exclusion recording function switch. Based on the on / off state of the simultaneous recording function switch and the mutual exclusion recording function switch, a recording process is selected from the default recording process, the simultaneous recording process, and the mutual exclusion recording process to handle the recording start request of the first application.
[0135] 1. With simultaneous recording enabled and mutual exclusion recording disabled, obtain the first application list. The mutual exclusion recording function is used to restrict the permission of at least two applications to record simultaneously.
[0136] "Simultaneous recording function enabled" means that the simultaneous recording function switch is in the "on" state, and "mutually exclusive recording function disabled" means that the mutually exclusive recording function switch is in the "off" state. At most one of the simultaneous recording function switch and the mutually exclusive recording function switch can be in the "on" state at any given time.
[0137] At this point, it is determined that the simultaneous recording process will be used to handle the recording initiation operation of the first application. This allows the acquisition of a first application list, which contains at least two applications with simultaneous recording permissions. Based on the recording permissions configured in the first application list, it is determined whether to allow the first application to record.
[0138] 2. When the recording function is turned off and the mutual exclusion recording function is turned on, obtain the second application list. The second application list contains the identifier of the target application. The target application refers to the application that has exclusive recording permission.
[0139] It has permission to record simultaneously with other applications that are not configured as the target application in the second application list.
[0140] At this point, it is determined that the recording start operation of the first application is handled using a mutual exclusion recording process, which allows the second application list to be obtained.
[0141] Based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, the recording status of the first application is determined.
[0142] For example, the target application does not allow other applications to record simultaneously while recording, and has higher permissions than other applications when recording.
[0143] Optionally, in response to the target application having the same identifier as the first application, the first application is allowed to record while the second application's recording is interrupted.
[0144] If the identifier of the first application is the same as that of the target application, it means that the first application is the target application and the first application has exclusive recording permissions. In this case, the second application will interrupt the recording and allow the first application to start recording.
[0145] Optionally, in response to the target application's identifier being the same as the second application's identifier, the first application is not allowed to record audio.
[0146] If the identifier of the second application is the same as that of the target application, then the second application is the target application. In this case, the second application exclusively has the recording permission and continues to record, and the first application is not allowed to start recording.
[0147] Optionally, in response to the target application's identifier being different from the second application's identifier, or the target application's identifier being different from the first application's identifier, the first application and the second application are allowed to record simultaneously.
[0148] If the identifiers of the first application and the second application are both different from the identifier of the target application, then neither the first application nor the second application is the target application, and in this case, the first application and the second application are allowed to record simultaneously.
[0149] The identifiers of the target applications included in the second application list can be customized by the user.
[0150] Optionally, a second configuration operation is received, which determines the identifier of a target application included in the second application list. A candidate application list is displayed based on the second configuration operation, containing identifiers of multiple applications that support recording functionality. In response to receiving a selection operation for a target application in the candidate application list, the second application list is obtained based on the identifier of the target application.
[0151] Indicative Figure 4 This is a diagram illustrating the configuration of a second application list.
[0152] The candidate application list contains the identifiers of four applications: Application 1, Application 2, Application 3, and Application 4, which correspond to Application 1, Application 2, Application 3, and Application 4, respectively.
[0153] The number of target applications is one. Select the identifier of application 1 to identify application 1 as the target application, and obtain the second application list 400.
[0154] The following situations apply: (1) When application 1 is recording, application 2, application 3 and application 4 cannot interrupt the recording process of application 1; (2) When any of application 2, application 3 and application 4 is recording, if the recording start operation of application 1 is detected, application 1 is allowed to record and the recording of other applications is interrupted.
[0155] 3. When both the recording function and the mutual exclusion recording function are turned off, the recording status of the first application is determined by the default recording process.
[0156] The default recording process refers to the pre-configured recording process within the terminal. When multiple applications request recording simultaneously, the application with recording permissions is determined based on its type. The default recording process cannot be modified, while the simultaneous recording process and the mutually exclusive recording process can be modified.
[0157] The default recording process is as follows: There is usually a mutual exclusion relationship between recording applications other than privileged applications in the terminal, which mainly includes the following situations.
[0158] 1. When both privileged and regular applications are recording simultaneously;
[0159] Privileged applications are applications pre-installed on a terminal that have special permissions. Privileged applications are mainly manifested as the terminal's voice assistant, which can collect the user's voice commands through microphone recording and control the terminal to achieve various functions based on the voice commands. For example, Google Assistant is a privileged application.
[0160] When a regular application is running in the foreground and a privileged application is running in the background, whether the two can record audio simultaneously depends on whether the regular application has privacy sensitivity.
[0161] Privacy sensitivity refers to an application having exclusive recording permissions while recording, preventing other applications from recording simultaneously.
[0162] For example, if a regular application does not have privacy sensitivity, and the user issues a voice command while the regular application is recording via microphone, the privileged application can still record via microphone and respond to the voice command.
[0163] For example, when a regular application is privacy-sensitive, if the user issues a voice command while the regular application is recording via microphone, the privileged application cannot record via microphone, nor can it respond to the user's voice command.
[0164] When a privileged application has visible interface components displayed at the top of the terminal's screen, a regular application cannot record audio simultaneously.
[0165] 2. When both accessibility services and regular applications are recording simultaneously;
[0166] Accessibility services are services provided by the Android system to help people with disabilities (such as visual impairments, mobility impairments, etc.). Once accessibility services are enabled, visible interface components will be displayed at the top of the device's screen.
[0167] When the accessibility service interface component is visible at the top of the screen, accessibility services and regular applications can record audio simultaneously.
[0168] When no visible accessibility service interface component is displayed at the top of the screen, the accessibility service and the regular application are treated as two regular applications.
[0169] 3. When two ordinary applications start recording simultaneously;
[0170] Regular applications do not have permission to record simultaneously. When two regular applications start recording at the same time, only one regular application will be granted recording permission, and the other regular application will remain silent (not record).
[0171] If two regular applications have privacy-sensitive features, the regular application at the top of the interface has permission to record audio.
[0172] If one of two regular applications is privacy-sensitive while the other is not, the privacy-sensitive application will record audio, while the other application will remain silent.
[0173] If both regular applications are privacy-sensitive, the regular application that starts recording later will record, while the other regular application will remain silent.
[0174] 4. When both a voice call application and a regular application are recording simultaneously;
[0175] If the device is in the middle of a voice call, regular applications cannot record the audio.
[0176] It is worth noting that only one of the three recording processes can exist at a time. Users can select the recording process to be executed by setting the on / off state of each recording process to handle the permission allocation problem of multiple applications recording simultaneously. Although the names of the simultaneous recording process and the mutually exclusive recording process indicate the relationship between multiple applications (i.e., simultaneous recording and mutually exclusive recording), both the simultaneous recording process and the mutually exclusive recording process contain the possible simultaneous recording relationship and mutually exclusive recording relationship between different applications. All three recording processes are designed to determine how to allocate recording permissions to the application requesting recording, and to allow applications with recording permissions to start recording and interrupt the recording of applications without recording permissions.
[0177] In summary, the method provided in this application pre-configures multiple applications with simultaneous recording permissions to obtain a first application list, and sets up a global array to store the identifiers of applications currently recording. When a first application requests recording, if the global array indicates that a second application is already recording, the method determines whether the first application has permission to record simultaneously with the second application based on the first application list. If it does, recording permission is granted to the first application. This overcomes the limitations of related technologies using default recording strategies for multi-application recording and meets the need for simultaneous recording of multiple applications. Furthermore, it adds support for user-defined simultaneous recording and mutually exclusive recording processes based on the default recording process.
[0178] Figure 5 This is a flowchart of a multi-application simultaneous recording method provided in an exemplary embodiment of this application, used to describe the simultaneous recording process, assuming that the mutual exclusion recording function is not enabled, and the method includes the following steps.
[0179] Step 501: The recording start operation of the first application is detected.
[0180] The recording start operation indicates that the first application requests to start recording. It is necessary to determine whether the current scenario involves multiple applications requesting to record simultaneously.
[0181] Step 502: Obtain the global array.
[0182] The global array stores the identifiers of the applications currently recording. If the global array is empty, it means that no application is currently recording, the first application is the only application requesting recording, and recording is permitted for the first application.
[0183] Step 503: If the global array is not empty, determine whether the simultaneous recording function is enabled.
[0184] If the global array is not empty, the identifier stored in it determines whether the application that is recording has permission to record simultaneously with the first application.
[0185] For example, the illustration will take the case where the identifier of the second application is contained in a global array.
[0186] In this embodiment, the mutual exclusion recording function is not enabled by default. Therefore, determining whether the simultaneous recording function is enabled can determine the recording process type used when allocating recording permissions to the first application.
[0187] Step 504: If the recording function is not enabled at the same time, determine the recording status of the first application based on the default recording process.
[0188] The recording conditions determined according to the default recording process include the following:
[0189] (1) If both the first application and the second application are ordinary applications, then the recording permission is assigned to the first application that starts recording later, based on the order of the recording start operations of the first application and the second application.
[0190] (2) If both the first application and the second application are privacy-sensitive applications, then the recording permission shall be assigned to the first application that starts recording later, based on the order in which the recording starts the first application and the second application.
[0191] (3) If one of the first application and the second application is a privacy-sensitive application and the other is a normal application, then the privacy-sensitive application is granted recording permission. When the privacy-sensitive application is recording, the other normal application is not allowed to record.
[0192] (4) If one of the first application and the second application is a privileged application and the other is a normal application, when the privileged application is running in the background, both the first application and the second application are allowed to record simultaneously; when the privileged application is running in the foreground, only the privileged application is allowed to record.
[0193] (5) If one of the first application and the second application is a privileged application and the other is a privacy-sensitive application, then only the privacy-sensitive application is allowed to record audio.
[0194] (6) If there is a call recording application in the first application and a normal application in the second application, then only the call recording application is allowed to record;
[0195] (7) If one of the first application and the second application is a call recording application and the other is a privileged application, then the first application and the second application are allowed to record simultaneously.
[0196] Step 505: If the recording function is enabled at the same time, obtain the first application list and determine whether the first application list is empty.
[0197] The first application list is configured with permissions for at least two applications to record simultaneously. If the first application list is empty after being retrieved, it means that all applications can record simultaneously. If the first application list is not empty, it means that a subset of applications specified in the first application list can record simultaneously.
[0198] Step 506: If the first application list is empty, allow the first application to record audio.
[0199] At this time, both the first and second applications are recording audio simultaneously.
[0200] Step 507: If the first application list is not empty, obtain the identifier of the first application.
[0201] If the first application list is not empty, then the first application list contains the identifiers of at least two applications that are capable of recording simultaneously.
[0202] Step 508: Determine whether the first application list contains both the identifier of the first application and the identifier of the application in the global array.
[0203] For example, if the global array only includes the identifier of the second application, then it is determined whether the identifier of the first application and the identifier of the second application exist simultaneously in the first application list.
[0204] Step 509: If the first application list contains the identifier of the first application and the identifier of the application in the global array, allow the first application to record audio.
[0205] At this time, both the first and second applications are recording audio simultaneously.
[0206] Step 510: If the first application list does not contain the identifier of the first application, the first application and the second application are not allowed to record simultaneously.
[0207] The first application does not have permission to record audio simultaneously with other applications.
[0208] When the identifier of the second application is included in the first application list, the second application continues recording, while the first application is not allowed to record.
[0209] If the identifier of the second application is not included in the first application list, the first application that started recording later is allowed to record, and the recording of the second application is interrupted, according to the order of the recording start operations.
[0210] Step 511: When the first application is recording, store the identifier of the first application in a global array.
[0211] Add an identifier for the first application to the global array and update the global array in a timely manner to indicate that the first application is recording. This will allow for more accurate allocation of recording permissions to applications when recording is initiated by other applications.
[0212] In summary, the method provided in this embodiment describes how to perform a simultaneous recording process to allocate recording permissions to applications. Users can customize at least two applications with simultaneous recording permissions according to their needs, thus solving the limitation that multiple ordinary applications cannot record simultaneously in the default recording process.
[0213] Figure 6 This is a flowchart of a multi-application mutual exclusion recording method provided in an exemplary embodiment of this application, used to describe the mutual exclusion recording process, with the premise that the simultaneous recording function is not enabled, and the method includes the following steps.
[0214] Step 601: The recording start operation of the first application is detected, and the global array is obtained.
[0215] The recording start operation indicates that the first application requests to start recording. It is necessary to determine whether the current scenario involves multiple applications requesting to record simultaneously.
[0216] The global array stores the identifiers of the applications currently recording. If the global array is empty, it means that no application is currently recording, the first application is the only application requesting recording, and recording is permitted for the first application.
[0217] Step 602: If the global array is not empty, determine whether the mutual exclusion recording function is enabled.
[0218] If the global array is not empty, it determines whether the application that is recording has a recording mutual exclusion relationship with the first application or has the permission to record at the same time, based on the identifier stored in it.
[0219] This embodiment assumes that the simultaneous recording function is not enabled. Therefore, determining whether the mutual exclusion recording function is enabled can determine the recording process type used when allocating recording permissions to the first application.
[0220] Step 603: If the mutual exclusion recording function is not enabled, determine the recording status of the first application based on the default recording process.
[0221] In the default recording process, the recording permission allocation between the first application and the second application is determined based on the application type of the first application and the application types contained in the global array.
[0222] Refer to step 504; it will not be repeated here.
[0223] Step 604: If the mutual exclusion recording function is enabled, obtain the second application list and determine whether the second application list is empty.
[0224] The second application list is used to store the identifiers of target applications that have exclusive recording permissions.
[0225] Step 605: If the second application list is empty, determine the recording status of the first application based on the default recording process.
[0226] If the second application list is empty, it means that the user has not set a high-priority target application, and the recording process type used when assigning recording permissions to the first application is the default recording process.
[0227] Step 606: If the second application list is not empty, determine whether the identifier of the target application exists in the global array.
[0228] Because the target application has exclusive recording permissions, it's necessary to determine if the target application is currently recording. This will be illustrated using an example where the global array contains only the identifier of the second application.
[0229] Step 607: If the identifier of the target application exists in the global array, the first application is not allowed to record audio.
[0230] At this point, the second application is the target application. When the second application records, it exclusively has recording permissions. Other applications cannot record at the same time as the second application, nor can they interrupt the second application's recording. Therefore, the first application is not allowed to record.
[0231] Step 608: If the identifier of the target application does not exist in the global array, determine whether the first application is the target application.
[0232] Regardless of whether the first application is the target application, the first application is allowed to record. The purpose of determining whether the first application is the target application is to determine whether the second application should interrupt the recording.
[0233] Step 609: If the first application is the target application, allow the first application to exclusively have the recording permission.
[0234] At this point, the second application interrupts recording, removes the identifier of the second application from the global array, and adds the identifier of the first application.
[0235] Step 610: If the first application is not the target application, allow the first application to record audio.
[0236] At this time, the first application and the second application record simultaneously, and the identifier of the first application is added to the global array.
[0237] In summary, the method provided in this embodiment describes how to execute a mutually exclusive recording process to allocate recording permissions to an application. Users can customize the target application for exclusive recording permissions according to their needs, allowing other applications besides the target application to record simultaneously. This solves the problem that ordinary applications in the default recording process do not meet the exclusive recording permissions in the default recording process, and indirectly configures the permission for other applications besides the target application to record simultaneously.
[0238] Figure 7 This is a structural block diagram of a recording device provided in an exemplary embodiment of this application, such as... Figure 7 As shown, the device includes the following parts.
[0239] The array reading module 710 is used to read the global array corresponding to the audio policy service in response to the detection of the recording start operation of the first application. The global array is used to store the identifier of the application currently recording.
[0240] The acquisition module 720 is used to acquire a first application list if the global array includes the identifier of a second application, wherein the first application list contains the identifiers of at least two applications capable of recording simultaneously.
[0241] The recording module 730 is configured to, in response to the first application list containing the identifier of the first application and the identifier of the second application, allow the second application to record simultaneously with the first application.
[0242] In an optional embodiment, the first application list contains multiple sub-lists, and applications in the same sub-list have the permission to record simultaneously;
[0243] The recording module 730 is further configured to, in response to the existence of a sublist containing the identifier of the first application and the identifier of the second application in the plurality of sublists, allow the second application to record simultaneously with the first application.
[0244] In an optional embodiment, the recording module 730 is further configured to allow the second application to record simultaneously with the first application in response to the first application list being empty.
[0245] In an optional embodiment, the acquisition module 720 is further configured to acquire the first application list when the simultaneous recording function is enabled and the mutual exclusion recording function is disabled, wherein the mutual exclusion recording function is used to restrict the permission of at least two applications to record simultaneously.
[0246] In an optional embodiment, the acquisition module 720 is further configured to acquire a second application list when the simultaneous recording function is off and the mutual exclusion recording function is on, wherein the second application list contains an identifier of a target application, and the target application refers to an application that exclusively has recording permissions.
[0247] The recording module 730 is further configured to determine the recording status of the first application based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, respectively.
[0248] In an optional embodiment, the recording module 730 is further configured to disallow the first application from recording in response to the target application's identifier being the same as the identifier of the second application.
[0249] In an optional embodiment, the recording module 730 is further configured to, in response to the target application having the same identifier as the first application, allow the first application to record and interrupt the recording of the second application.
[0250] In an optional embodiment, the recording module 730 is further configured to determine the recording status of the first application through a default recording process when the simultaneous recording function is off and the mutual exclusion recording function is off.
[0251] In an optional embodiment, such as Figure 8 As shown, the device further includes:
[0252] An array update module 740 is used to add the identifier of the first application to the global array.
[0253] In an optional embodiment, the apparatus further includes:
[0254] The configuration module 750 is configured to receive a first configuration operation, the first configuration operation being used to determine the identifiers of applications included in the first application list; display a candidate application list based on the first configuration operation, the candidate application list including multiple applications that support recording functions; and, in response to receiving a selection operation for at least two applications in the candidate application list, obtain the first application list based on the identifiers of the at least two applications.
[0255] In an optional embodiment, the configuration module 750 is further configured to receive a second configuration operation, the second configuration operation being configured to determine the identifier of a target application included in the second application list; display a candidate application list based on the second configuration operation, the candidate application list including the identifiers of multiple applications that support recording functionality; and, in response to receiving a selection operation for the target application in the candidate application list, obtain the second application list based on the identifier of the target application.
[0256] In an optional embodiment, the first application and the second application can be any type of application.
[0257] In summary, the recording device provided in this application can pre-configure multiple applications with simultaneous recording permissions to obtain a first application list, and set a global array to store the identifiers of the applications currently recording. When a first application requests recording, if the global array indicates that a second application is already recording, it determines whether the first application has the permission to record simultaneously with the second application based on the first application list and the global array. If it does, recording permission is granted to the first application. This solves the limitations of related technologies using default recording strategies for multi-application recording and meets the need for simultaneous recording of multiple applications.
[0258] It should be noted that the recording device provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the recording device and the recording method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0259] Figure 9This illustration shows a structural block diagram of a computer device 900 provided in an exemplary embodiment of this application. The computer device 900 may be a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The computer device 900 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
[0260] Typically, computer device 900 includes a processor 901 and a memory 902.
[0261] Processor 901 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 901 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 901 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 901 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 901 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0262] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 902 are used to store at least one instruction, which is executed by the processor 901 to implement the recording method provided in the method embodiments of this application.
[0263] In some embodiments, the computer device 900 also includes other components 903, the type and number of which can be selected based on the functional needs of the computer device 900. Those skilled in the art will understand that... Figure 9 The structure shown does not constitute a limitation on the computer device 900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0264] Optionally, the computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. The random access memory may include resistive random access memory (ReRAM) and dynamic random access memory (DRAM). The sequence numbers of the embodiments in this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0265] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, a code set, or an instruction set. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the recording method as described in any of the above embodiments of this application.
[0266] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the recording method as described in any of the above embodiments of this application.
[0267] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the recording methods described in the above embodiments.
[0268] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0269] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A recording method, characterized in that, The method includes: In response to detecting a recording start operation of the first application, the global array corresponding to the audio policy service is read, and the global array is used to store the identifier of the application currently recording; If the global array includes the identifier of the second application, then a first application list is obtained. The first application list contains the identifiers of at least two applications that can record simultaneously. The first application list contains multiple sublists. Applications in the same sublist have the permission to record simultaneously. Applications from different sublists that do not appear in the same sublist are not allowed to record simultaneously. In response to the existence of a sublist containing the identifier of the first application and the identifier of the second application, the second application is allowed to record audio simultaneously with the first application.
2. The method according to claim 1, characterized in that, After obtaining the first application list, the process also includes: In response to the first application list being empty, the second application is allowed to record audio simultaneously with the first application.
3. The method according to claim 1 or 2, characterized in that, The process of obtaining the first application list includes: With simultaneous recording enabled and mutual exclusion recording disabled, the first application list is obtained, wherein the mutual exclusion recording function is used to restrict the permission of at least two applications to record simultaneously.
4. The method according to claim 3, characterized in that, The method further includes: When the simultaneous recording function is off and the mutual exclusion recording function is on, a second application list is obtained. The second application list contains the identifier of the target application, which refers to the application that has exclusive recording permission. Based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, the recording status of the first application is determined.
5. The method according to claim 4, characterized in that, The step of determining the recording status of the first application based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, respectively, includes: In response to the fact that the identifier of the target application is the same as the identifier of the second application, the first application is not allowed to record audio.
6. The method according to claim 4, characterized in that, The step of determining the recording status of the first application based on the matching results between the identifier of the target application and the identifiers of the first application and the second application, respectively, includes: In response to the target application's identifier being the same as the first application's identifier, the first application is allowed to record while the second application's recording is interrupted.
7. The method according to claim 3, characterized in that, The method further includes: When both the simultaneous recording function and the mutually exclusive recording function are disabled, the recording status of the first application is determined by the default recording process.
8. The method according to claim 1 or 2, characterized in that, After allowing the second application to record simultaneously with the first application, it further includes: Add the identifier of the first application to the global array.
9. The method according to claim 1 or 2, characterized in that, Before obtaining the first application list, the process also includes: Receive a first configuration operation, the first configuration operation being used to determine the identifier of the application included in the first application list; Based on the first configuration operation, a candidate application list is displayed, which includes multiple applications that support recording functions; In response to receiving a selection operation for at least two applications in the candidate application list, the first application list is obtained based on the identifiers of the at least two applications.
10. The method according to claim 4, characterized in that, Before obtaining the second application list, the process also includes: Receive a second configuration operation, the second configuration operation being used to determine the identifier of the target application contained in the second application list; Based on the second configuration operation, a list of candidate applications is displayed, which contains the identifiers of multiple applications that support the recording function; In response to receiving a selection operation for a target application in the candidate application list, the second application list is obtained based on the identifier of the target application.
11. The method according to claim 1 or 2, characterized in that, The first application and the second application can be of any type.
12. A recording device, characterized in that, The device includes: An array reading module is used to read a global array corresponding to the audio policy service in response to the detection of a recording start operation of the first application. The global array is used to store the identifier of the application currently recording. The acquisition module is used to acquire a first application list if the global array includes the identifier of a second application. The first application list contains the identifiers of at least two applications that can record simultaneously. The first application list contains multiple sublists. Applications in the same sublist have the permission to record simultaneously. Applications from different sublists that do not appear in the same sublist are not allowed to record simultaneously. The recording module is configured to, in response to the existence of a sublist containing the identifier of the first application and the identifier of the second application in the plurality of sublists, allow the second application to record simultaneously with the first application.
13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the recording method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is loaded and executed by a processor to implement the recording method as described in any one of claims 1 to 11.
15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the recording method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Recording control method and device, and display equipment
CN112071338A