Screen capture method and electronic device

By displaying a permission request pop-up window and obtaining user authorization during each screen capture operation, and using historical authorization records to create a virtual display screen, the problem of user privacy and security in screen capture operations is solved, and more efficient and secure screen capture is achieved.

CN119249519BActive Publication Date: 2025-10-10HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410083420.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2025-10-10
Estimated Expiration
2044-01-19

AI Technical Summary

Technical Problem

In the prior art, screen capture operations do not require re-authorization after the initial authorization, which leads to potential risks to user privacy and security.

Method used

A permission request pop-up window is displayed during each screen capture operation. Screen capture or recording is performed only after obtaining user authorization. Historical authorization records are used to create a virtual display screen for screen capture to ensure user privacy.

Benefits of technology

By displaying a permission request pop-up window before each screen capture operation, screen capture is performed only after the user's authorization, avoiding unauthorized operations, protecting user privacy, and improving the efficiency of screenshots or screen recordings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249519B_ABST
    Figure CN119249519B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of electronic equipment, and provides a screen capturing method and electronic equipment. The method comprises the following steps: running a first application on the electronic equipment, and displaying a first interface of the first application; in response to a first operation of a user on a screen capturing control, a permission application pop-up window is displayed, wherein the permission application pop-up window comprises an authorization confirmation control, and the authorization confirmation control is used to determine the content of the first interface; in response to a click operation of the user on the authorization confirmation control, a historical authorization record is obtained, and the first interface is captured or recorded according to the historical authorization record, wherein the historical authorization record is used to indicate whether the first application allows screen capturing. Thus, the permission application pop-up window is displayed every time the user triggers the screen capturing operation, whether it is the first screen capturing operation or the non-first screen capturing operation. The application can only perform the screen capturing or recording operation after obtaining the user authorization, thereby ensuring the privacy of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic devices, and in particular to a screen capture method and electronic device. Background Art

[0002] Screen capture, which includes screenshots and screen recording, refers to the process of using software or tools to capture all or part of an electronic device's screen and convert it into an image or video. Screen capture can be used not only to record fixed content on the screen, such as game screens, videos, or presentations, but also to record screen dynamics to preserve a video of a specific process or interaction.

[0003] In the related art, when an application captures the screen for the first time, it usually requires user authorization, and subsequent screenshot or screen recording operations for the application do not require re-authorization. However, this method can easily lead to user privacy and security risks. Summary of the Invention

[0004] The present application provides a screen capture method and electronic device that can ensure user privacy when taking screenshots or recording screens.

[0005] In a first aspect, an embodiment of the present application provides a screen capture method, the method comprising: running a first application on an electronic device and displaying a first interface of the first application; in response to a user's first operation on a screen capture control, displaying a permission application pop-up window, wherein the permission application pop-up window includes an authorization confirmation control, and the authorization confirmation control is used to determine the content of the first interface to be captured; in response to a user clicking operation on the authorization confirmation control, obtaining a historical authorization record, and taking a screenshot or recording of the first interface according to the historical authorization record, wherein the historical authorization record is used to indicate whether the first application allows screen capture.

[0006] In the technical solution of the present application, a permission request pop-up window will be displayed each time the user triggers a screen capture operation, whether it is the first screen capture operation or not. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization, thereby ensuring the user's privacy.

[0007] Optionally, in a possible implementation manner of the first aspect, the method further includes: when the historical authorization record indicates that the first application is not allowed to perform screen capture, creating a screen recording agent item, and using the created screen recording agent item to capture the first interface; or when the historical authorization record indicates that the first application is allowed to perform screen capture, using the created screen recording agent item to capture the first interface.

[0008] When the first application is allowed to perform screen capture for the first time, the electronic device can apply for the screen recording agent item, and then apply for creating a virtual display screen, and use the virtual display screen to save the screen content of the first interface. When the first application is allowed to perform screen capture again, the screen recording agent item does not need to be created again, and the virtual display screen can be created directly using the existing screen recording agent item, thereby simplifying the operation of performing screen capture for the first time, and improving the efficiency of screen capture.

[0009] Optionally, in another possible implementation manner of the first aspect, the method further includes: starting to block the screen capture or the screen recording of the first interface when the first operation is received; and stopping the blocking of the screen capture or the screen recording of the first interface when it is detected that the virtual display screen is created. Through the embodiment, it can be ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission of the first interface, and the screen capture operation can be normally performed only after the user authorization is obtained, thereby avoiding the case that the screen capture or the screen recording content is empty.

[0010] Optionally, in another possible implementation manner of the first aspect, the method further includes: when the first operation is received, suspending the main thread of the first application; and when the click operation is received, resuming the running of the main thread of the first application. Since the user wants to capture the content of a specific interface, the main thread of the first application can be suspended, so that it is ensured that the interface will not change during the permission application process.

[0011] Optionally, in another possible implementation manner of the first aspect, the method further includes: starting from displaying the permission application pop-up window, when the click operation is detected within a preset time period, performing the operation of obtaining the historical authorization record; and when the click operation is not detected until the end of the preset time period, stopping the screen capture of the current round.

[0012] Among them, if the user does not choose to authorize after the permission request pop-up window is displayed for a certain period of time, the current round of screenshot or screen recording operations can be stopped by default instead of waiting for the user's authorization operation. This not only ensures the user's privacy and security, but also improves the responsiveness of the application.

[0013] Optionally, in another possible implementation of the first aspect, a countdown number is displayed on the permission request pop-up window. The countdown number is used to inform the user of the remaining time to operate the controls in the permission request pop-up window. By displaying the countdown, users can clearly know how much time they have left to make an authorization decision, thereby helping them better manage time and avoid affecting their user experience due to long waiting times.

[0014] Optionally, in another possible implementation of the first aspect, the permission request pop-up window further includes a permission cancellation control, where the permission cancellation control is used to cancel capturing the content of the first interface. The method further includes: in response to a user clicking the permission cancellation control, stopping the current round of screen capture. Detecting a click indicates that the user does not trust the first application, and therefore, screenshots or recordings of the first interface are not permitted to protect the user's privacy.

[0015] In a second aspect, an embodiment of the present application provides a screen capture device, which includes a unit composed of software and / or hardware for executing any one of the methods of the first aspect.

[0016] In a third aspect, an embodiment of the present application provides an electronic device comprising one or more processors and a memory; the memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code comprising computer instructions, and the one or more processors calling the computer instructions to enable the electronic device to implement any one of the methods of the first aspect.

[0017] In a fourth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device and includes one or more processors, and the one or more processors are used to call computer instructions to enable the electronic device to implement any one of the methods of the first aspect.

[0018] Optionally, the chip system also includes a memory, which is electrically connected to the processor.

[0019] Optionally, the chip system may further include a communication interface.

[0020] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device can implement any one of the methods of the first aspect.

[0021] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by an electronic device, the electronic device can implement any one of the methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 It is a schematic diagram of the screen capture process;

[0024] Figure 2 This is a flowchart of a screen capture method provided by an embodiment of the present application;

[0025] Figure 3 This is a schematic diagram of the execution process of the first application performing the screen capture operation for the first time provided in an embodiment of the present application;

[0026] Figure 4 This is a schematic diagram of the execution process of a screen capture operation performed by a first application not for the first time provided by an embodiment of the present application;

[0027] Figure 5 This is a schematic diagram of the execution process of user authorization provided by an embodiment of the present application;

[0028] Figure 6 is a structural diagram of a screen capture device provided in an embodiment of the present application;

[0029] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following describes the solutions of the embodiments of the present application with reference to the accompanying drawings.

[0031] Figure 1 is a schematic diagram of the screen capture process. Figure 1 As shown in the figure, when a user first calls the screen capture function for an app, a permission request pop-up window will be displayed. This permission request pop-up window is used to obtain user authorization. Once authorized, the user can perform screenshots or screen recordings of the app interface normally. Subsequent calls by the user, that is, when the user calls the screen capture function for a different reason, can directly perform screenshots or screen recordings of the app interface without further authorization. However, this method can easily lead to user privacy and security risks.

[0032] In view of this, an embodiment of the present application discloses a screen capture method, which mainly displays a permission request pop-up window each time the user triggers a screen capture operation, whether it is the first screen capture operation or not. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining user authorization, thereby ensuring the user's privacy.

[0033] Reference Figure 2 , shows a flow chart of the screen capture method provided by the embodiment of the present application. Figure 2 The steps shown are introduced.

[0034] Step 201: Run a first application on an electronic device and display a first interface of the first application.

[0035] Among them, the electronic device can be a terminal device such as a mobile phone, a tablet computer, and a laptop computer.

[0036] In an embodiment of the present application, the first application is an application that supports capturing or recording the current electronic device screen content. That is, the first application can capture and save the image on the current screen and store it in the form of a picture or video so that the user can record the information on the screen, share the content, or use it for other purposes. The first interface is any display interface of the first application, such as the main interface, settings interface, content browsing interface, etc.

[0037] Step 202: In response to a first operation of the user on the screen capture control, a permission request pop-up window is displayed.

[0038] It should be noted that since screen capture involves the user's privacy and security, the user's explicit authorization is required before executing the screenshot or screen recording operation. That is, when the user triggers the screen capture control (i.e., the first operation), a permission request pop-up window will be displayed on the screen of the electronic device to obtain permission for the screenshot or screen recording operation.

[0039] In an embodiment of the present application, the screen capture control can be a screenshot control or a screen recording control, and the user can select the corresponding control according to actual needs to trigger the screenshot or screen recording function.

[0040] As an example, when a user wants to take a screenshot, the first action may be pressing a mechanical shortcut key combination on the electronic device. Specifically, a specific mechanical key combination may be defined for the electronic device, such as a power key and a volume down key. When the user presses the power key and the volume down key simultaneously, the screenshot action is triggered.

[0041] As another example, when a user wants to perform a screenshot operation, the first operation may be clicking on the screenshot control in the function interface pulled down from the top of the screen. For example, the user may perform a downward sliding gesture at the top of the screen of the electronic device to display the second interface. The second interface may include a screenshot control. When the user clicks on the screenshot control, the screenshot operation of the electronic device is triggered.

[0042] As another example, when the user wants to perform a screen recording operation, the first operation can be clicking on the screen recording control in the function interface pulled down from the top of the screen. For example, the above-mentioned second interface can also include a screen recording control. When the user clicks on the screen recording control, the screen recording operation of the electronic device is triggered.

[0043] In an embodiment of the present application, the permission request pop-up window includes an authorization confirmation control, which is used to confirm whether to capture the content of the first interface. Correspondingly, the permission request pop-up window may also include an authorization cancellation control, which is used to cancel the capture of the content of the first interface. The user can choose to click the authorization confirmation control or the authorization cancellation control based on their needs and trust in the first application to decide whether to grant screen capture permission for the first interface.

[0044] In one example, the permission request pop-up window can also display a clear title, such as "Permission Request" or "Access to Screen Capture Permission," to help users quickly understand the purpose of the permission request pop-up window. The permission request pop-up window can also include additional information, such as the name of the first application, developer information, and the purpose of the permission, to help users make decisions.

[0045] Step 203: In response to the user clicking the authorization confirmation control, historical authorization records are obtained, and a screenshot or screen recording of the first interface is taken according to the historical authorization records.

[0046] The historical authorization record is used to indicate whether the first application is allowed to perform screen capture.

[0047] It should be noted that the click operation is the user triggering the authorization confirmation control operation, which is used to indicate that the user confirms the authorization of the first application to perform screen capture. Correspondingly, the click operation below is the user triggering the authorization cancellation control operation, which is used to indicate that the user refuses authorization.

[0048] In one possible implementation, the above step 203 may include: when the historical authorization record indicates that the first application is not allowed to capture the screen, creating a screen recording proxy project, and using the created screen recording proxy project to take a screenshot or record the first interface, wherein the screen recording proxy project is used to create a virtual display screen on the first interface, and the virtual display screen is used to save the screen content of the first interface; or, when the historical authorization record indicates that the first application has been allowed to capture the screen, using the created screen recording proxy project to take a screenshot or record the first interface.

[0049] In this implementation, when the historical authorization record indicates that the first application is not allowed to perform screen capture, that is, the historical authorization record may be empty, or there may be no historical authorization record. This indicates that in step 203, the first application is allowed to perform screen capture for the first time. At this time, you can apply to obtain the screen recording agent project, and then the electronic device applies to create a virtual display screen, and use the virtual display screen to save the screen content of the first interface. When the historical authorization record indicates that the first application is allowed to perform screen capture, that is, there may be a record that the first application has been authorized before this round of operations. This indicates that in step 203, the first application is not allowed to perform screen capture for the first time. At this time, there is no need to create a screen recording agent project. The virtual display screen can be created directly using the existing screen recording agent project, thereby simplifying the operation of non-first-time screen capture and improving the efficiency of screenshots or screen recording.

[0050] It should be noted that the screen recording proxy project is a tool or service that can capture screens by simulating a display and graphics environment. It uses a virtual graphics device driver to create a virtual display screen and render the contents of the virtual display screen into memory. Parameters such as the virtual display screen area, size, resolution, pixel format, and refresh rate are all configurable. Once the virtual display screen is created, it can be used to capture the screen content of the first interface and perform screenshot or recording operations.

[0051] The following takes the Android system as an example to illustrate the above-mentioned process of executing screenshots or screen recordings. When the first application performs a screen capture operation for the first time, the first application needs to first register the screen capture system service, obtain the screen capture agent, and obtain the screen recording agent project (such as the VirtualDisplay project provided by the Android system). Then obtain the MediaProjection object through the system screen recording management module (such as the MediaProjectionManager module) in the electronic device, and then use the MediaProjection object and call the MediaProjection.createVirtualDisplay interface to specify the parameters of the virtual display screen. Finally, the display module on the electronic device creates a virtual display screen (VirtualDisplay) for capturing the screen content of the first interface, and returns it to the first application after capturing the screen content. When this is not the first time that the first application performs a screen capture operation, there is no need to create a screen recording agent project, and the MediaProjection.createVirtualDisplay interface can be used directly to capture the screen content of the first interface.

[0052] It's important to note that the Screen Capture System Service is a system service registered within electronic device applications. It provides screen capture functionality and interfaces. By accessing the Screen Capture System Service, applications can request screen capture permissions, use the screen capture interface to obtain screen content, and perform operations such as screen area selection, frame rate, and quality control.

[0053] The system screen recording management module is a management module in electronic devices that is used to manage the screen capture function of applications. The system screen recording management module can provide an interface so that applications can request screen capture permissions. Taking the MediaProjectionManager module as an example, the MediaProjectionManager module is a management module in the Android system. The MediaProjectionManager module can perform screen capture operations by creating MediaProjection objects. The MediaProjectionManager module specifically includes functions such as screen capture permission request, screen capture permission result processing, and screen capture parameter configuration. Through the MediaProjectionManager module, applications can interact with the system screen capture function, obtain screen capture permissions, and create MediaProjection objects for screen capture. In this way, applications can use the screen capture function to perform operations such as screenshots and screen recordings.

[0054] The display module is a hardware or software component responsible for displaying images and content. The display module generally includes a display screen, a display controller, and related drivers. In an embodiment of the present application, the display module can be used to create a virtual display screen for capturing the screen content of the first interface. In this process, the first application can first determine the parameters of the virtual display screen, such as area, size, resolution, pixel format, refresh rate, and other parameters. These parameters determine the characteristics and display effect of the virtual display screen; then the application uses the interface provided by the display module to create a virtual display screen with the set parameters. The virtual display screen is equivalent to a blank canvas that can be used to draw and display screen content; then the virtual display screen is used to capture the screen content of the first interface and render it onto the virtual display screen, for example, elements such as images, text, and graphics are drawn onto the canvas of the virtual display screen, thereby realizing the rendering of the screen content; finally, the display module returns the screen content to the first application, and the first application can obtain the rendering result (i.e., the captured screen content of the first interface) from the virtual display screen, such as an image or a video frame.

[0055] In a possible implementation, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when detecting the click operation, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, it can be ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface, but only after obtaining the user's authorization, can the screen capture operation be performed normally, avoiding the situation where the screenshot or screen recording content is empty. In addition, this embodiment makes it convenient for the electronic device to control the time node of the screenshot or screen recording. However, when the first application performs the screen capture operation for the first time, if the screen recording agent project is not created when the screen content is captured, that is, if the time node of the screen content is captured is between the click operation and the time node of the creation of the screen recording agent project, the screenshot or screen recording content will also be empty. This embodiment is applicable to the scenario where the first application performs the screen capture operation for the first time or not for the first time.

[0056] In another possible implementation, the method further includes: when receiving the first operation, starting to block the screenshot or screen recording of the first interface; when detecting that the virtual display screen has been created, stopping blocking the screenshot or screen recording of the first interface. Through this embodiment, blocking the screenshot or screen recording of the first interface is stopped only when the virtual display screen is created, which can effectively avoid the situation where the screenshot or screen recording content is empty. However, at this moment, it is necessary to capture the screen content through the virtual display screen in time. At this time, if the blocking is stopped first and then the screenshot or screen recording operation is performed, the timeliness is poor. This embodiment is applicable to the scenario where the first application performs the screen capture operation for the first time or not for the first time.

[0057] In another possible implementation, the method further includes: upon receiving the first operation, starting to block screenshots or screen recordings of the first interface; and after detecting that the virtual display screen has been created, stopping blocking screenshots or screen recordings of the first interface. This embodiment can minimize the possibility of screenshots or screen recordings being empty, but it is difficult to control the timing of the blocking. This embodiment is applicable to scenarios where the first application performs a screen capture operation, both for the first time and for non-first time.

[0058] In another possible implementation, the method further includes: upon receiving the first operation, starting to block the screenshot or screen recording of the first interface; and stopping blocking the screenshot or screen recording of the first interface when the screen recording proxy project is created. As long as the screen recording proxy project is created, the process of capturing the screen content and storing the screen content can be completed quickly. Through this embodiment, it is possible to avoid the situation where the screenshot or screen recording content is empty, and it is also convenient to control the time node. This embodiment is applicable to the scenario where the first application performs a screen capture operation for the first time. It should be understood that this embodiment is also applicable to the scenario where a screen recording proxy project needs to be created to complete the screenshot or screen recording regardless of whether it is the first time or not.

[0059] As an example, the above-mentioned process of blocking the screenshot or screen recording of the first interface can be implemented by blocking the call of the MediaProjection.createVirtualDisplay interface.

[0060] In one implementation, the method further includes: upon receiving the first operation, causing the main thread of the first application to sleep; and upon receiving the click operation, resuming the main thread of the first application. Since the user wishes to capture the content of a specific interface, this embodiment ensures that the interface does not change during the permission application process.

[0061] In one implementation, step 203 may include: starting from the display of the permission request pop-up window, when a click operation is detected within a preset time period, executing an operation to obtain historical authorization records; when no click operation is detected until the end of the preset time period, stopping the current round of screen capture. In this embodiment, if the user does not select authorization after the permission request pop-up window is displayed for a certain period of time, the current round of screenshot or screen recording operations can be stopped by default instead of waiting for the user's authorization operation. This not only ensures the user's privacy and security, but also improves the responsiveness of the application. It should be understood that the preset time period can be set according to user needs, such as a few seconds or tens of seconds.

[0062] In one implementation, a countdown number is displayed on the permission application pop-up window, and the countdown number is used to prompt the user of the remaining time for operating the controls in the permission application pop-up window. In this embodiment, by displaying the countdown, users can clearly know how much time they have to make an authorization choice, thereby helping users to better manage time and avoid affecting the user experience due to long waiting times. When the countdown ends, if the user has not made an authorization choice, canceling the screenshot or screen recording operation can provide a clear operation result. The user knows clearly that the screenshot or screen recording operation was canceled due to a timeout, and can redo the operation or take other actions as needed.

[0063] In one implementation, the method further includes: in response to a user clicking an authorization cancellation control, canceling step 203 and stopping the current round of screen capture operations. It should be noted that when a click operation is detected, it indicates that the user does not trust the first application, and screenshot or screen recording operations on the first interface are not allowed at this time to protect the user's privacy. A message canceling the screen capture operation can be displayed on the electronic device screen, so that the user clearly knows that the screenshot or screen recording operation has been canceled and can redo the operation or take other actions as needed.

[0064] The screen capture method provided in the above embodiment of the present application mainly ensures the privacy of the user by displaying a permission request pop-up window each time the user triggers the screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization. In addition, the blocking of the screenshot or screen recording of the first interface is blocked before the user authorizes it, thereby ensuring that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining the user's authorization, thereby avoiding the situation where the screenshot or screen recording content is empty.

[0065] Figure 3 This is a schematic diagram of the execution process of the first application performing the screen capture operation for the first time provided in an embodiment of the present application.

[0066] Step 301: The user triggers a screen capture operation.

[0067] Among them, the user can trigger the screenshot operation by pressing a mechanical key on the electronic device. For another example, the user can also trigger the screenshot or screen recording operation by clicking the screenshot control or screen recording control in the function interface pulled down from the top of the screen.

[0068] Step 302: The first application obtains a screen capture system service.

[0069] Among them, in response to the first operation of the user triggering the screen capture operation, the first application first obtains the screen capture system service and the screen capture agent, and then can perform the screenshot or screen recording operation through the screen capture system service after the user authorizes it.

[0070] Step 303: The first application creates and displays a permission request pop-up window.

[0071] The permission request pop-up window may include an authorization confirmation control and an authorization cancellation control. The authorization confirmation control is used to confirm whether to capture the content of the first interface, and the authorization cancellation control is used to cancel the capture of the content of the first interface. The user can choose to click the authorization confirmation control or the authorization cancellation control based on their needs and trust in the first application to decide whether to grant the screen capture permission for the first interface.

[0072] In step 304 , the user confirms whether authorization is granted. If so, step 305 is executed; if not, step 306 is executed.

[0073] In one example, when the user clicks the authorization confirmation control, it means that the user allows the first application to perform the screen capture operation, and step 305 and subsequent steps 307-311 are executed; when the user clicks the authorization cancellation control, it means that the user does not allow the first application to perform the screen capture operation, and step 306 is executed at this time, that is, the screen capture operation is canceled.

[0074] In step 305, the first application obtains the user authorization result and determines the first call of the application based on the historical authorization results, and applies for the screen recording agent project.

[0075] When the historical authorization record indicates that the first application is not allowed to perform screen capture, for example, the historical authorization record is empty or does not exist, it is determined that the first application has called the screen capture operation for the first time.

[0076] Step 306: cancel screen capture.

[0077] Among them, a message of canceling screen capture can be displayed on the screen of the electronic device, so that the user can clearly know that the screenshot or screen recording operation has been canceled and can redo the operation or take other actions as needed.

[0078] Step 307: The system screen recording management module creates a new screen recording agent project.

[0079] It should be noted that since the first application is performing a screen capture operation for the first time, the system screen recording management module needs to create a new screen recording proxy project for subsequent screenshot or screen recording operations. If this is not the first time a screen capture operation is performed, there is no need to create a new screen recording proxy project. The existing screen recording proxy project can be directly used to create a virtual display screen.

[0080] Step 308: The first application obtains a screen recording agent project.

[0081] Step 309: The system screen recording management module applies to create a virtual display screen.

[0082] Step 310: The display module creates a virtual display screen to store the screen content of the first interface.

[0083] Step 311: The first application obtains screen content for processing.

[0084] Figure 4 This is a schematic diagram of the execution process of the screen capture operation performed by the first application not for the first time provided in an embodiment of the present application.

[0085] Step 401: The user triggers a screen capture operation.

[0086] Among them, the user can trigger the screenshot operation by pressing a mechanical key on the electronic device. For another example, the user can also trigger the screenshot or screen recording operation by clicking the screenshot control or screen recording control in the function interface pulled down from the top of the screen.

[0087] In step 402, the system screen recording management module determines that the application is not called for the first time based on historical authorization results.

[0088] When the historical authorization record indicates that the first application is allowed to perform screen capture, for example, the first application has been authorized before the current round of operations, it is determined that the first application is not calling the screen capture operation for the first time.

[0089] Step 403: The system screen recording management module displays a pop-up window requesting permission.

[0090] The permission request pop-up window may include an authorization confirmation control and an authorization cancellation control. The authorization confirmation control is used to confirm whether to capture the content of the first interface, and the authorization cancellation control is used to cancel the capture of the content of the first interface. The user can choose to click the authorization confirmation control or the authorization cancellation control based on their needs and trust in the first application to decide whether to grant the screen capture permission for the first interface.

[0091] Step 404: The first application blocks the execution of screenshot or screen recording.

[0092] It should be noted that in order to ensure that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission of the first interface, but only after obtaining the user authorization, the screen capture operation can be normally performed, and the situation that the screen capture or screen recording content is empty is avoided, the screen capture or screen recording of the first interface can be temporarily blocked before the user authorization. Especially for non-first time screen capture operation, the step of displaying the permission application pop-up window to obtain user authorization and the step of performing screen capture or screen recording operation are usually asynchronous calls, which can easily lead to the last obtained screen content being empty, affecting the user experience.

[0093] In step 405, the user confirms whether to authorize, if yes, step 406 is executed; if no, steps 407 and 408 are executed.

[0094] In one example, when the user clicks the authorization confirmation control, it means that the user allows the first application to perform the screen capture operation, and then step 306 and subsequent steps 408-410 are executed; when the user clicks the authorization cancel control, it means that the user does not allow the first application to perform the screen capture operation, and then steps 407 and 408 are executed, that is, the screen capture operation is cancelled.

[0095] In step 406, the system screen recording management module uses the created screen recording agent project to apply for creating a virtual display screen.

[0096] Since the non-first time screen capture operation is performed, the screen recording agent project does not need to be newly created, and the existing screen recording agent project can be directly used to create a virtual display screen, thereby simplifying the operation of the non-first time screen capture and improving the efficiency of screen capture or screen recording.

[0097] In step 407, the screen capture is cancelled.

[0098] In step 408, the first application stops blocking the screen capture or screen recording.

[0099] It should be noted that the time node of the first application stopping the blocking of the screen capture or screen recording can refer to the related description below step 203, which will not be repeated here.

[0100] In step 409, the display module creates a virtual display screen to save the screen content of the first interface.

[0101] In step 410, the first application obtains the screen content for processing.

[0102] The above Figure 3 and Figure 4The execution process of the screen capture operation provided by the illustrated embodiment is mainly to display a permission request pop-up window each time the user triggers the screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining user authorization, thereby ensuring the user's privacy. In addition, by blocking the blocking of screenshots or screen recordings of the first interface before the user authorizes, it is ensured that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining user authorization, avoiding the situation where the screenshot or screen recording content is empty.

[0103] Figure 5 This is a schematic diagram of the execution process of user authorization in an embodiment of the present application. Figure 5 As shown, interface 501 is an interface of the first application (an example of the first interface) when the user triggers the screenshot capture operation. When the screenshot capture operation is triggered, a permission request pop-up window is displayed, and an authorization confirmation control and an authorization cancellation control are displayed in the permission request pop-up window, as shown in interface 502. Assuming that the user clicks the authorization confirmation control on interface 502, it means that the user confirms the authorization of the first application to perform screen capture, as shown in interface 503; assuming that the user clicks the authorization cancellation control on interface 502, it means that the user refuses authorization, and the screen capture is canceled, as shown in interface 504.

[0104] The above mainly introduces the method of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that although the various steps in the flowcharts involved in the various embodiments described above are shown in sequence, these steps are not necessarily performed in sequence in the order shown in the figures. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the steps or stages in other steps. The device of the embodiment of the present application is introduced below in conjunction with the accompanying drawings.

[0105] Figure 6 FIG is a structural diagram of a screen capture device according to an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown. Figure 6As shown, the screen capture device 600 includes a processing unit 601 and a display unit 602. The screen capture device 600 can be integrated into electronic devices such as mobile phones, tablet computers, and laptop computers. For another example, the screen capture device 600 can also be used to perform Figure 3 and Figure 4 The first application, the system screen recording management module and the display module perform the steps, and receive the user's operation and respond. The device screen capture device 600 can also be used to perform Figure 5 The process shown.

[0106] In one implementation, the screen capture device 600 may further include a storage unit for storing relevant data. The storage unit may be integrated into any one of the above units or may be a unit independent of all the above units.

[0107] The screen capture device provided in the above embodiment of the present application mainly ensures the privacy of the user by displaying a permission request pop-up window each time the user triggers a screen capture operation, whether it is the first screen capture operation or a non-first screen capture operation. The application can only perform the corresponding screenshot or screen recording operation according to the historical authorization record after obtaining the user's authorization. In addition, it also blocks the blocking of the screenshot or screen recording of the first interface before the user authorizes it, thereby ensuring that the user will not perform unauthorized screen capture before deciding whether to grant the screen capture permission for the first interface. Instead, the screen capture operation can only be performed normally after obtaining the user's authorization, thereby avoiding the situation where the screenshot or screen recording content is empty.

[0108] Figure 7 FIG is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Figure 7As shown, the electronic device 700 may include a processor 710, an external memory interface 720, an internal memory 721, a universal serial bus (USB) interface 730, a charging management module 740, a power management module 741, a battery 742, an antenna 1, an antenna 2, a mobile communication module 750, a wireless communication module 760, an audio module 770, a speaker 770A, a receiver 770B, a microphone 770C, an earphone interface 770D, a sensor module 780, a button 790, a motor 791, an indicator 792, a camera 793, a display screen 794, and a subscriber identification module (SIM) card interface 795, etc. Among them, the sensor module 780 may include a pressure sensor 780A, a gyroscope sensor 780B, an air pressure sensor 780C, a magnetic sensor 780D, an acceleration sensor 780E, a distance sensor 780F, a proximity light sensor 780G, a fingerprint sensor 780H, a temperature sensor 780J, a touch sensor 780K, an ambient light sensor 780L, a bone conduction sensor 780M, etc.

[0109] It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 700. In other embodiments of the present application, the electronic device 700 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0110] For example, Figure 7 The processor 710 shown may include one or more processing units. For example, the processor 710 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0111] The controller may be the nerve center and command center of the electronic device 700. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

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

[0113] In some embodiments, the MIPI interface can be used to connect the processor 710 and the display screen 794, the camera 793, and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. The processor 710 and the display screen 794 communicate through the DSI interface to realize the display function of the electronic device 700.

[0114] In some embodiments, the GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. The GPIO interface can be used to connect the processor 710 and the camera 793, the display screen 794, the wireless communication module 760, the audio module 770, the sensor module 780, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.

[0115] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 700. In some other embodiments of the present application, the electronic device 700 can also use different interface connection methods or a combination of multiple interface connection methods in the above embodiments.

[0116] The electronic device 700 realizes the display function through the GPU, the display screen 794, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 794 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 710 can include one or more GPUs that execute program instructions to generate or change display information.

[0117] The display screen 794 is used to display images, videos, and the like. The display screen 794 includes a display panel. In some embodiments, the electronic device 700 can include one or N display screens 794, where N is a positive integer greater than 1.

[0118] The internal memory 721 can be used to store computer executable program codes, which include instructions. The processor 710 executes various functional applications and data processing of the electronic device 700 by running the instructions stored in the internal memory 721. The internal memory 721 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 700 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 721 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0119] Pressure sensor 780A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 780A can be located on display screen 794. There are many types of pressure sensors 780A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 780A, the capacitance between the electrodes changes. Electronic device 700 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 794, electronic device 700 detects the intensity of the touch operation using pressure sensor 780A. Electronic device 700 can also calculate the location of the touch based on the detection signal from pressure sensor 780A. In some embodiments, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, an instruction to create a new short message is executed.

[0120] The touch sensor 780K is also called a "touch panel." The touch sensor 780K can be provided on the display screen 794. The touch sensor 780K and the display screen 794 form a touch screen, also called a "touch screen." The touch sensor 780K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided through the display screen 794. In other embodiments, the touch sensor 780K can also be provided on the surface of the electronic device 700, at a location different from that of the display screen 794.

[0121] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0123] An embodiment of the present application further provides an electronic device, comprising: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, wherein the one or more processors execute the computer program, enabling the electronic device to implement the steps of any of the aforementioned methods. An embodiment of the present application further provides a computer-readable storage medium storing the computer program, wherein the computer program, when executed by the electronic device, implements the steps of each of the aforementioned method embodiments.

[0124] The computer-readable medium may include at least any entity or device capable of carrying computer program code to a camera / electronic device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Examples include USB flash drives, external hard drives, magnetic disks, or optical disks. In some jurisdictions, due to legislation and patent practice, computer-readable media cannot include electrical carrier signals or telecommunications signals.

[0125] The present application provides a computer program product comprising a computer program that, when executed by an electronic device, implements the steps of each of the above method embodiments. The computer program comprises computer program code, which may be in source code form, object code form, an executable file, or some intermediate form.

[0126] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0127] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0128] In the embodiments provided in this application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0129] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0130] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0131] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0132] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0133] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0134] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A screen capture method, characterized in that: include: Running a first application on the electronic device and displaying a first interface of the first application; In response to a first operation of the user on the screen capture control, displaying a permission request pop-up window, wherein the permission request pop-up window includes an authorization confirmation control, and the authorization confirmation control is used to determine whether to capture the content of the first interface; In response to a user clicking operation on the authorization confirmation control, obtaining a historical authorization record, wherein the historical authorization record is used to indicate whether the first application is allowed to perform screen capture; When the historical authorization record indicates that the first application is not allowed to capture the screen, a screen recording proxy project is created, and the created screen recording proxy project is used to take a screenshot or record the first interface, wherein the screen recording proxy project is used to create a virtual display screen on the first interface, and the virtual display screen is used to save the screen content of the first interface; or, when the historical authorization record indicates that the first application has been allowed to capture the screen, the created screen recording proxy project is used to take a screenshot or record the first interface.

2. The screen capture method according to claim 1, wherein: The method further comprises: Upon receiving the first operation, starting to block screenshots or screen recordings of the first interface; When it is detected that the virtual display screen is created, blocking of the screenshot or screen recording of the first interface is stopped.

3. The screen capture method according to claim 1, wherein: The method further comprises: Upon receiving the first operation, causing the main thread of the first application to sleep; When the click operation is received, the main thread of the first application is resumed.

4. The screen capture method according to claim 1, wherein: The step of obtaining a historical authorization record in response to a user clicking the authorization confirmation control, and taking a screenshot or recording a screen shot of the first interface according to the historical authorization record includes: Starting from the display of the permission application pop-up window, when the click operation is detected within a preset time period, an operation of obtaining historical authorization records is executed; When the click operation is not detected until the preset time period ends, the current round of screen capture is stopped.

5. The screen capture method according to claim 1, wherein: A countdown number is displayed on the permission application pop-up window, and the countdown number is used to prompt the user of the remaining time for operating the controls in the permission application pop-up window.

6. The screen capture method according to any one of claims 1 to 5, characterized in that: The permission application pop-up window further includes an authorization cancellation control, where the authorization cancellation control is used to cancel interception of the content of the first interface. The method further includes: In response to the user clicking the authorization cancellation control, the current round of screen capture is stopped.

7. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and is configured to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 6.

8. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes instructions, and when the instructions are executed on an electronic device, the electronic device is caused to perform the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Screen capturing method and screen capturing device as well as electronic device

    CN104407804A

  • Authority granting method and device, electronic equipment and readable storage medium

    CN112733097A