Floating window management method, device, equipment and readable storage medium
Patent Information
- Application Number
- CN202210308426.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2042-03-25
AI Technical Summary
[0003]目前,应用程序在展示悬浮窗之前,需要使用者手动授予权限,并且由于终端设备的开发系统的权限限制问题,默认不给予应用程序悬浮窗权限,使得终端设备无法弹出悬浮窗,降低了悬浮窗启动的成功率,甚至会出现应用程序崩溃的情况
[0016]本申请在终端设备的目标应用启动时,若目标应用的悬浮窗权限信息指示无权限,则获取终端设备的系统版本信息,以便于基于不同系统版本进行针对性的悬浮窗管理操作,以达到在系统无悬浮窗权限的情况下,也能在终端设备上正常使用悬浮窗功能。本申请在系统版本信息指示的版本低于目标版本时,生成目标应用对应的第一透明活动栈。在针对目标应用的操作事件触发时,获取操作事件的事件类型,再根据操作事件的事件类型以及第一透明活动栈,在终端设备的顶层窗口展示目标应用的悬浮窗,该悬浮窗是基于操作事件的事件类型生成的,实现了针对不同事件类型生成对应的悬浮窗。本申请通过生成第一透明活动栈,再基于第一透明活动栈和操作事件的事件类型生成悬浮窗,可以解决终端设备的开发系统设置的悬浮窗权限限制,提高了悬浮窗启动的成功率。
Smart Images

Figure CN116841665B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a floating window management method, a floating window management device, a computer device, and a computer-readable storage medium. Background Technology
[0002] A floating window is an active window that floats on the surface of an application on a terminal device, providing users with quick and convenient operations. For example, a floating window can display a list of frequently used applications, allowing users to quickly jump to the application they need; it can also display system functions such as flashlight, Bluetooth switch, Wi-Fi, volume adjustment, and screen brightness adjustment.
[0003] Currently, applications require users to manually grant permissions before displaying a floating window. However, due to permission restrictions in the terminal device's development system, floating window permissions are not granted to applications by default, preventing the floating window from popping up and reducing its success rate. This can even lead to application crashes. Therefore, improving the success rate of floating window launches is a pressing issue that needs to be addressed. Summary of the Invention
[0004] This application provides a floating window management method, apparatus, device, and readable storage medium, which can improve the success rate of floating window startup.
[0005] Firstly, this application provides a method for managing floating windows, the method comprising:
[0006] When the target application on the terminal device starts, if the version indicated by the system version information of the terminal device is lower than the target version, a first transparent activity stack corresponding to the target application is generated.
[0007] When an operation event is triggered for the aforementioned target application, obtain the event type of the operation event;
[0008] Based on the event type of the aforementioned operation event and the aforementioned first transparent activity stack, a floating window of the aforementioned target application is displayed in the top-level window of the aforementioned terminal device.
[0009] Secondly, this application provides a floating window management device, which includes:
[0010] The processing module is used to generate a first transparent activity stack corresponding to the target application if the system version information of the terminal device indicates a version lower than the target version when the target application of the terminal device is started.
[0011] The aforementioned processing module is also used to obtain the event type of the operation event when an operation event for the aforementioned target application is triggered.
[0012] The display module is used to display the floating window of the target application in the top-level window of the terminal device according to the event type of the operation event and the first transparent activity stack.
[0013] Thirdly, this application provides a computer device, including: a processor, a storage device, and a communication interface, wherein the processor, the communication interface, and the storage device are interconnected, wherein the storage device stores executable program code, and the processor is used to call the executable program code to implement the above-mentioned floating window management method.
[0014] Fourthly, this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which are executed by a processor to implement the floating window management method described above.
[0015] Fifthly, this application provides a computer program product, which includes a computer program or computer instructions, which are executed by a processor to implement the above-described floating window management method.
[0016] This application, upon launching a target application on a terminal device, if the floating window permission information for the target application indicates insufficient permissions, obtains the system version information of the terminal device. This allows for targeted floating window management operations based on different system versions, ensuring the floating window function can still be used normally on the terminal device even when the system lacks floating window permissions. When the system version information indicates a version lower than the target version, this application generates a first transparent activity stack corresponding to the target application. When an operation event for the target application is triggered, the event type of the operation event is obtained. Then, based on the event type and the first transparent activity stack, a floating window for the target application is displayed in the top-level window of the terminal device. This floating window is generated based on the event type of the operation event, achieving the generation of corresponding floating windows for different event types. By generating a first transparent activity stack and then generating a floating window based on the first transparent activity stack and the event type of the operation event, this application can overcome the floating window permission restrictions set by the development system of the terminal device, improving the success rate of floating window launch. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the architecture of a floating window management system provided in an exemplary embodiment of this application;
[0019] Figure 2 This is a flowchart illustrating a floating window management method provided in an exemplary embodiment of this application;
[0020] Figure 3A This is a flowchart illustrating a floating window management process provided in an exemplary embodiment of this application;
[0021] Figure 3B This is a flowchart illustrating another floating window management process provided in an exemplary embodiment of this application;
[0022] Figure 4 This is a flowchart illustrating another floating window management method provided in an exemplary embodiment of this application;
[0023] Figure 5 This is a flowchart illustrating another floating window management process provided in an exemplary embodiment of this application;
[0024] Figure 6 This is a schematic block diagram of a floating window management device provided in an exemplary embodiment of this application;
[0025] Figure 7 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation
[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0027] It should be noted that the terms "first," "second," etc., used in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature specified with "first" or "second" may explicitly or implicitly include at least one of those features.
[0028] The embodiments of the present invention can be applied to various scenarios such as cloud computing, cloud IoT, cloud gaming, artificial intelligence, vehicle scenarios, smart transportation, and assisted driving. Several typical application scenarios will be introduced below.
[0029] Cloud computing refers to the delivery and usage model of IT infrastructure, meaning obtaining necessary resources in an on-demand and easily scalable manner through a network. In a broader sense, cloud computing also refers to the delivery and usage model of services, meaning obtaining necessary services in an on-demand and easily scalable manner through a network. These services can be IT and software related, internet-related, or other services. Cloud computing is a product of the convergence of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Driven by the development of the internet, real-time data streams, the diversification of connected devices, and the demands of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel and distributed computing, the emergence of cloud computing will fundamentally revolutionize the entire internet model and enterprise management model. This application can store configuration data, information objects, and other data on a cloud server. When these different data are needed, they can be directly retrieved from the cloud server, greatly improving data retrieval speed.
[0030] Cloud IoT aims to connect the information sensed and commands received by traditional IoT devices to the Internet, truly achieving networking. It also enables massive data storage and computation through cloud computing technology. Due to the nature of IoT, which involves connecting things to each other and sensing the current operating status of each "object" in real time, a large amount of data information is generated in this process. How to aggregate this information and how to sift out useful information from the massive amount of data to support decision-making for future development have become key issues affecting the development of IoT. As a result, IoT cloud based on cloud computing and cloud storage technology has become a powerful support for IoT technology and applications.
[0031] Cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing. It enables thin clients with relatively limited graphics processing and data processing capabilities to run high-quality games. In cloud gaming, the game does not reside on the player's terminal but runs on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's terminal via the network. The player's terminal does not need powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities and the ability to receive player input commands and send them to the cloud server. This application applies to cloud gaming. When there is a corresponding business need, a game pop-up window is generated using the method proposed in this application. The game pop-up window can include various functional controls, such as game content acceleration, game client download acceleration, mobile terminal acceleration, page redirection, etc., making it easy for users to trigger and quickly use its functions.
[0032] Intelligent Traffic Systems (ITS), also known as Intelligent Transportation Systems, effectively integrate advanced technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing. This strengthens the connection between vehicles, roads, and users, forming a comprehensive transportation system that ensures safety, improves efficiency, enhances the environment, and conserves energy. This application, applied to intelligent traffic systems, can enhance the intelligence of pop-up services and support the integration of various traffic monitoring services within pop-ups, thereby improving the efficiency of system usage for users.
[0033] Currently, smart terminal systems that do not grant third-party application download floating window permissions by default include: Huawei EMUI (a software system developed by Huawei), Xiaomi MIUI (an operating system developed by Xiaomi), Meizu series phones, and VIVO series phones. If an application with a floating window is installed on these smart terminals, an error will occur upon application launch, or even the application will crash, rendering its functionality unusable. Furthermore, users of some applications, lacking the relevant technical knowledge, often experience confusion about how to enable floating windows. Therefore, there is an urgent need for a method to enable floating windows on terminal devices that can improve the success rate of displaying floating windows while ensuring the security and stability of the terminal device.
[0034] Prior to Android 6.0, applications had floating window permission by default, which allowed them to display a floating view (floating window) on the desktop, achieving the purpose of a desktop pop-up. However, in Android 6.0 and later, floating window permission needs to be manually granted by the user, resulting in a significant decrease in the desktop pop-up rate of existing applications.
[0035] This application provides a hierarchical floating window launch method, a technique that allows applications to launch desktop pop-ups in the background without any permission restrictions. By bypassing manufacturer permissions and Google system restrictions, it can be widely used for floating window services in application software (or applications), such as the dynamic desktop pop-up module of App Store, including scenarios such as junk file cleanup pop-ups, application uninstallation pop-ups, application update pop-ups, and manual operation pop-ups. In addition, this technology can be extended to other application scenarios, such as overriding manufacturer installation blocking pages.
[0036] The method proposed in this application can also integrate virtual back buttons, home buttons, menu buttons, and shortcut settings for various system functions into a floating window on the terminal. By floating above all windows, it provides users with a convenient and quick operating experience. At the same time, the virtual button function implemented through the floating window can replace the system buttons of the terminal device, saving the number of times the system buttons of the terminal device are pressed and extending the service life of the system buttons of the terminal device.
[0037] It is understood that in the specific embodiments of this application, data related to floating window permission information is involved. When the above embodiments of this application are applied to specific products or technologies, the collection, use and processing of related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0038] This application will be specifically described through the following embodiments.
[0039] Please see Figure 1 , Figure 1 This is a schematic diagram of the architecture of a floating window management system provided in an exemplary embodiment of this application. Figure 1 As shown, the floating window management system may specifically include a terminal device 101 and a server 102. The terminal device 101 and the server 102 are connected via a network, such as a local area network (LAN), a wide area network (WAN), or the mobile internet. Users operate on the browser or client application of the terminal device 101, accessing various data sources. The server 102 can respond to these operations, providing various data access services to the users.
[0040] Specifically, the terminal device 101 has a browser or client application (such as the floating window management client of this application) installed. The user sends a data retrieval request to the server 102 through the browser or client application installed on the terminal device 101. The server 102 sends the requested data back to the terminal device 101, and the browser or client application installed on the terminal device 101 displays the received data. The terminal device 101 can also obtain the floating window configuration information of the target application from the server 102; then, based on the floating window configuration information, it generates multiple candidate configuration data, each of which is used to set the form, function, and content of the corresponding floating window.
[0041] Server 102 can be any server device capable of providing website services, application development, and / or data transmission services. Taking a client app development project as an example (i.e., considering the client app as terminal device 101), the following explanation is provided: During the development phase, various data (including multiple candidate configuration data) of the client app can be configured on server 102. Configuring the client app's data can include configuring the floating window manager, configuring the application's activity class, etc. During the client app's runtime phase, the client app can be installed and run on terminal device 101. A floating window can be displayed in the client app's user interface. Users can trigger operations on this floating window.
[0042] Terminal equipment 101 is also referred to as terminal, user equipment (UE), access terminal, user unit, mobile device, user terminal, wireless communication equipment, user agent, or user device. Terminal equipment can be smart home appliances, handheld devices with wireless communication capabilities (such as smartphones and tablets), computing devices (such as personal computers (PCs), in-vehicle terminals, smart voice interaction devices, wearable devices, or other smart devices, but is not limited to these).
[0043] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0044] It is understood that the system architecture diagrams described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. For example, the floating window management method provided in the embodiments of this application can also be executed by server 102. Correspondingly, the floating window management device provided in the embodiments of this application can also be set in server 102. The floating window management method provided in the embodiments of this application can also be executed by other servers or server clusters that are different from server 102 and can communicate with terminal device 101 and / or server 102. Correspondingly, the floating window management method provided in the embodiments of this application can also be partially executed by terminal device 101 and partially executed by server 102. Correspondingly, the floating window management client provided in the embodiments of this application can be partially set in terminal device 101 and partially set in server 102. As those skilled in the art will know, Figure 1 The number of terminal devices and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices and servers can be configured. Furthermore, as system architecture evolves and new business scenarios emerge, the technical solutions provided in this application are equally applicable to similar technical problems.
[0045] Please see Figure 2 , Figure 2 This is a flowchart illustrating a floating window management method provided in an exemplary embodiment of this application. Taking the application of this method to a floating window management client (which is configured on terminal device 101) as an example, the method may include the following steps:
[0046] S201. When the target application of the terminal device starts, if the version indicated by the system version information of the terminal device is lower than the target version, the first transparent activity stack corresponding to the target application is generated.
[0047] In this embodiment, the floating window management client can be integrated into the target application of the terminal device. In other words, the floating window management client is a functional module within the target application that performs floating window management operations. The floating window management client can obtain various information about the terminal device, including system version information and floating window permission information. When the floating window management client detects that the target application has started on the terminal device, it first performs a floating window permission acquisition operation. If the floating window permission information obtained by the floating window management client indicates no permission, it means that the terminal device manufacturer or development system has restricted the permissions of the target application, causing the terminal device to be unable to display the floating window. At this time, the floating window management client obtains the system version information of the terminal device and then performs targeted floating window management operations based on the system version information to enable the floating window of the target application to successfully pop up.
[0048] In one embodiment, the system version information of the terminal device can be multiple versions of the Android system, such as Android 1.0, Android 3.0, Android 6.0, Android 9.0, Android 10.0, Android 11.0, and Android 12.0. Each version iteration is a major update that optimizes the system from the bottom up, including vulnerability fixes, feature additions and updates, hardware support additions and updates, etc., improving the user experience while ensuring the security of the terminal device. The scope of permissions granted to each system version is also different. This application performs targeted floating window management operations based on different system versions to ensure that the floating window function can be used normally on the terminal device even when the system lacks floating window permissions.
[0049] In this embodiment, the floating window management client obtains system version information. When it detects that the version indicated by the system version information is lower than the target version, it generates a first transparent activity stack corresponding to the target application. The first transparent activity stack can be understood as a container that can store one or more interfaces included in the floating window. The interfaces in this container are accessed based on the last-in-first-out principle. By generating the transparent activity stack, the floating window can be generated subsequently by obtaining the corresponding configuration data according to the event type of the operation event.
[0050] In one embodiment, the target version can be a version number from the system version information of the terminal device. Testing revealed that Android versions below 10.0 (Android Q) can launch Activities in the background, but some manufacturers (e.g., OPPO, Vivo) have corresponding permission restrictions, resulting in a success rate of less than 30% for launching Activities directly from the background. Android versions above 10.0 (Android Q) cannot launch Activities in the background. Therefore, this application performs targeted processing based on the version indicated by the system version information to ensure that the floating window of the target application can successfully pop up even without permissions. Testing showed that the target version can be set to Android Q; that is, when the version indicated by the system version information is lower than Android Q, a first transparent activity stack corresponding to the target application is generated, and subsequent steps S202-S203 are executed.
[0051] S202. When an operation event is triggered for the target application, obtain the event type of the operation event.
[0052] In one embodiment, when the floating window management client detects an operation event triggered targeting a target application, it can determine the event type of the operation event through the operation event. An operation event is an action performed by an object on a terminal device targeting a target application, such as clicking the screen, double-clicking the screen, unlocking, pressing the back button, or shaking the terminal device. When an operation event targeting a target application is triggered, the event type of the operation event can be obtained. For example, when the floating window management client detects that an operation object triggers a cleanup control in the target application, it can determine that the event type of the operation event is junk file cleanup; when the floating window management client detects that an operation object triggers an update control in the target application, it can determine that the event type of the operation event is app update.
[0053] In one embodiment, the event type of the operation event can be preset, that is, multiple sets of mapping relationships between event types and operation events are set. Each set of mapping relationships includes the correspondence between one event type and one or more operation events. The floating window management client can determine the event type corresponding to the operation event of the operation object from multiple sets of mapping relationships by detecting the operation event of the operation object. For example, an event type (junk cleaning) can be mapped to an operation event (triggering the cleanup control on the target application's main page); or an event type (junk cleaning) can be mapped to multiple operation events (triggering the cleanup control on the target application's main page, and shaking the terminal device) as a set of mapping relationships.
[0054] S203. Based on the event type of the operation event and the first transparent activity stack, display the floating window of the target application in the top-level window of the terminal device.
[0055] In this embodiment, the target configuration data corresponding to the event type of the operation event can be determined according to the event type of the operation event. The first transparent activity stack is configured according to the target configuration data, and then the configured first transparent activity stack is displayed in the top-level window of the terminal device in the form of a floating window (or an activity window).
[0056] In one embodiment, the above-mentioned display of the target application's floating window in the top-level window of the terminal device based on the event type of the operation event and the first transparent activity stack can be achieved according to the following steps.
[0057] (1) Determine the target configuration data from multiple candidate configuration data based on the event type of the operation event.
[0058] In one embodiment, multiple candidate configuration data can be pre-set, and multiple sets of mapping relationships between event types and multiple candidate configuration data can be set. Each mapping relationship includes a correspondence between an event type and a candidate configuration data. The floating window management client can determine the candidate configuration data corresponding to the event type of the operation event from the multiple candidate configuration data by detecting the event type of the operation event of the operation object. For example, an event type (junk cleaning) and a candidate configuration data (configuration data corresponding to the junk cleaning floating window, including floating window card configuration data, function control configuration data, etc.) can be used as a mapping relationship.
[0059] (2) Configure the first transparent activity stack according to the target configuration data, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window.
[0060] In this embodiment of the application, after obtaining the target configuration data, the floating window management client can configure the first transparent activity stack according to the target configuration data, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window (or an activity window).
[0061] In one embodiment, when generating the first transparent activity stack corresponding to the target application, and when an operation event for the target application is triggered, the following steps may also be performed.
[0062] (1) Return the first transparent activity stack to the background.
[0063] (2) When an operation event for the target application is triggered, the first transparent activity stack is retrieved from the background to the foreground using the activity management service of the terminal device.
[0064] In this embodiment, the floating window management client moves the first transparent activity stack back to the background, ensuring that it does not affect the subsequent display of the target application's interface. When the floating window management client detects an operation event triggered against the target application, it uses the terminal device's activity management service to bring the first transparent activity stack from the background to the foreground. This method ensures that the user is unaware of the entire process of calling the first transparent activity stack, improving the user experience.
[0065] Please see Figure 3A , Figure 3AThis application provides a method for creating a transparent activity stack. During the target application startup phase (corresponding to step 3.1 in the figure), the target application will start the main interface, which is to perform application initialization (corresponding to step 3.2 in the figure). The floating window management client will create a transparent activity stack (corresponding to steps 3.3 and 3.4 in the figure). The transparent activity stack can automatically return to the background and wait for the operation event to be triggered (corresponding to step 3.5 in the figure).
[0066] Please see Figure 3B , Figure 3B This application provides a method for calling a transparent activity stack. During the operation event occurrence stage, assuming the operation event is application uninstallation, when the floating window management client detects the operation event (application uninstallation) (corresponding to step 3.6 in the figure), it will call the transparent activity stack from the background to the foreground (corresponding to steps 3.7 and 3.8 in the figure), and configure the transparent activity stack through the configuration data corresponding to the event type of the operation event (corresponding to step 3.9 in the figure), and finally display the floating window on the terminal device.
[0067] In one embodiment, the aforementioned transparent activity stack can be a DialogMainActivity in an Android Activity. The process of bringing the transparent activity stack from the background to the foreground can be handled using the moveTaskToFront method in the Android ActivityManager class. During target application initialization, a transparent Activity (i.e., a transparent independent stack) can be launched and moved to the background to wait. When an operation event is triggered, the Activity stack containing the transparent Activity is moved to the foreground using the moveTaskToFront method, at which point the application becomes a foreground application. Based on the foreground application, Activity windows can be created and displayed freely, achieving the purpose of displaying a floating window on the desktop.
[0068] In one embodiment, the method for generating a transparent independent stack for the floating window management client can be to add it to the stack where the target application's interface is located (that is, to add an interface for displaying the floating window to the stack where the target application's existing interface is located, i.e., singleask mode); or it can be to create a new stack outside the stack where the target application's interface is located (that is, to add an independent stack for displaying the floating window outside the stack where the target application's existing interface is located, i.e., singleinstance mode).
[0069] In the first scenario described above, moving the transparent independent stack to the foreground by the floating window management client also moves the existing interfaces of the target application within that stack to the foreground, failing to achieve user-unobtrusiveness and resulting in a poor user experience. In the second scenario, moving the transparent independent stack to the foreground does not affect the existing interfaces of the target application within that stack, and the user is unaware of the transparent independent stack's invocation process, thus improving the user experience. Therefore, in subsequent embodiments of this application, the transparent independent stack will be invoked using the second method described above, and will not be elaborated upon further in subsequent embodiments.
[0070] This application, upon launching a target application on a terminal device, if the floating window permission information for the target application indicates insufficient permissions, obtains the system version information of the terminal device. This allows for targeted floating window management operations based on different system versions, ensuring the floating window function can still be used normally on the terminal device even when the system lacks floating window permissions. When the system version information indicates a version lower than the target version, this application generates a first transparent activity stack corresponding to the target application. This transparent activity stack is used to subsequently obtain corresponding configuration data based on the event type of the operation event to generate the floating window. When an operation event for the target application is triggered, the event type of the operation event is obtained. Then, based on the event type, target configuration data is determined from multiple candidate configuration data. The first transparent activity stack is then configured based on the target configuration data, and finally, the floating window of the target application is displayed in the top-level window of the terminal device. This floating window is generated based on the event type of the operation event, realizing the generation of corresponding floating windows for different event types. This application pre-sets different operation events, corresponding event types, and mapping relationships between event types and corresponding configuration data. By detecting the operation events of the operation object, this application can determine the event type matching the operation event from the pre-set mapping relationship, and then determine the target configuration data based on the event type, thereby improving processing efficiency. When generating the first transparent activity stack, this application pushes the first transparent activity stack back to the background. When an operation event for the target application is triggered, the activity management service of the terminal device is used to retrieve the first transparent activity stack from the background to the foreground. Through this method, the first transparent activity stack does not affect the subsequent interface display of the target application, making the operation object unaware of the invocation process of the first transparent activity stack, thus improving the user experience of the operation object.
[0071] Please see Figure 4 , Figure 4 This is a flowchart illustrating a floating window management method provided in an exemplary embodiment of this application. Taking the application of this method to a floating window management client (which is configured on terminal device 101) as an example, the method may include the following steps:
[0072] S401. When the target application of the terminal device starts, if the version indicated by the system version information is equal to or higher than the target version, a second transparent activity stack corresponding to the target application is generated. The second transparent activity stack includes the original information object.
[0073] The specific implementation method for obtaining floating window permissions in step S401 is described in the relevant description of step S201 in the aforementioned embodiments, and will not be repeated here.
[0074] In one embodiment, when the floating window permission is enabled, the following steps can be performed.
[0075] (1) Obtain the system top-level window service of the terminal device.
[0076] In this embodiment, the system's top-level window service refers to Android's WindowManager service. Android's window mechanism is based on WindowManager, through which views can be added to and removed from the screen. The underlying implementation of Activity or Diolog (pop-up windows) in this embodiment is also implemented through WindowManager. WindowManager is mainly used to manage window state, attributes, view addition, view deletion, updates, window order, message collection and processing, etc.
[0077] (2) When an operation event for the target application is triggered, the target configuration data is determined from multiple candidate configuration data according to the event type of the operation event.
[0078] In this embodiment of the application, when the floating window management client detects that an operation event for the target application is triggered, it obtains the event type corresponding to the operation event based on the operation event, and then determines the target configuration data that matches the event type from multiple candidate configuration data based on the event type.
[0079] In one embodiment, multiple candidate configuration data can be pre-set, that is, multiple sets of mapping relationships between event types and multiple candidate configuration data can be set. Each mapping relationship includes a correspondence between an event type and a candidate configuration data. The floating window management client can determine the candidate configuration data corresponding to the event type of the operation event from the multiple candidate configuration data by detecting the event type of the operation event of the operation object. For example, an event type (junk cleaning) and a candidate configuration data (configuration data corresponding to the junk cleaning floating window, including floating window card configuration data, function control configuration data, etc.) can be used as a mapping relationship.
[0080] (3) The target configuration data is displayed in the top window of the terminal device in the form of a floating window through the service interface of the system's top window service.
[0081] The specific steps for displaying the target configuration data as a floating window in the top-level window of the terminal device through the service interface of the system's top-level window service are described in the relevant description of step S203 in the previous embodiment, and will not be repeated here.
[0082] In this embodiment, since the permission scope granted to each system version is different, this application performs targeted floating window management operations based on different system versions to ensure that the floating window function can be used normally on the terminal device even when the system does not have floating window permissions. When the version indicated by the system version information is equal to or higher than the target version, an alternative floating window management method different from the above steps S201 to S203 can be used, namely, using the system alarm clock service of the terminal device to enable the floating window to be launched without permissions.
[0083] In one embodiment, the original information object can be an Intent object in an Android Activity. An Intent can be used to launch another component in an app from within another component, or to launch a component of another app. Here, a component refers to an Activity, Service, or Broadcast.
[0084] S402. If the target vendor identifier set includes the vendor identifier of the terminal device, then the private attributes of the original information object are modified to obtain the target information object. The target information object is used by the terminal device's operating system to identify the second transparent activity stack as a system component.
[0085] In this embodiment, different terminal device manufacturers customize their systems based on a specific system version, resulting in different customized operating system versions for each manufacturer. These customized operating system versions can be distinguished by the manufacturer's identifier. Since different customized operating system versions grant different permission ranges, when implementing the method for launching a floating window without permission, corresponding processing should be performed for each customized operating system version to achieve the desired result.
[0086] In this embodiment, the manufacturer's customization logic is to only allow system components recognized as part of their own system to perform background startup actions. The purpose of modifying the private attributes in the original information object is to disguise the Activity startup behavior as an action initiated by a system component. If the target manufacturer identifier set includes the terminal device's manufacturer identifier (i.e., the terminal device's operating system version is customized by a manufacturer in the target manufacturer identifier set), the private attributes in the original information object need to be modified to obtain the target information object, so that the terminal device's operating system recognizes the second transparent activity stack as a system component, bypassing the floating window startup restriction.
[0087] In one embodiment, the above-mentioned modification of the private attributes of the original information object to obtain the target information object can be achieved according to the following steps.
[0088] (1) When the manufacturer identifier of the terminal device is the first manufacturer identifier in the target manufacturer identifier set, the value of the first flag bit in the private attribute of the original information object is set to the target value.
[0089] In one embodiment, the first manufacturer identifier is the MIUI system, the first flag is mMIUIFlags, and the value of the first flag is set to 0x02. Using the above method, this startup behavior can be considered to be performed by a system component of its own system, thus successfully launching the Activity in the background. The key code implementing the above method is shown below.
[0090]
[0091] In the code above, mMIUIFlags is the first flag bit, and 0x02 is the target value of the first flag bit.
[0092] (2) When the manufacturer identifier of the terminal device is the second manufacturer identifier in the target manufacturer identifier set, the value of the second flag bit in the private attribute of the original information object is set to the target logical value.
[0093] In one embodiment, the second vendor identifier is Funtouch system, the second flag is mIsVivoWidget, and the value of the second flag is set to true. Using the above method, this startup behavior can be considered to be performed by a system component of its own system, thus successfully launching the Activity in the background. The key code implementing the above method is shown below.
[0094]
[0095] In the code above, mIsVivoWidget is the second flag bit, and true is the target logical value of the second flag bit.
[0096] It should be noted that the method described above for modifying the private attributes of the original information object can be implemented based on reflection, which can be understood as a dynamic invocation process. Specifically, the attribute name of the flag is set through indirect reference, and the attribute name is obtained and assigned a value when used. It is understood that the method described above for modifying the private attributes of the original information object based on different vendor identifiers to obtain the target information object is merely exemplary. For any terminal device corresponding to any vendor identifier, the method proposed in this application can be applied to modify the flag in the private attributes of the original information object to make the operating system believe that the operation was initiated by its own system components, thereby successfully launching the floating window in the background.
[0097] (3) Encapsulate the modified original information object to obtain the target information object.
[0098] In this embodiment of the application, the target information object can be a Pendingintent object in an Android Activity. The above-mentioned encapsulation of the modified original information object to obtain the target information object can be achieved by using a system interface to construct a Pendingintent, using the Pendingintent as the target information object, and then using the system alarm clock service to start the Activity.
[0099] S403. When an operation event targeting the application is triggered, the system alarm clock service of the terminal device is invoked to start the timer.
[0100] In this embodiment, the system alarm clock service is the Android AlarmManagerService service. This service is started in other services of SystemServer and is a system-level reminder service in Android. It is mainly used to provide applications with timed triggering of activity pages or background services, but it is cleared when the system is shut down or restarted. Since this service is a system service, entrusting the task of starting the Activity to the system service and having the system service initiate the startup action can successfully bypass the floating window startup restriction in specific scenarios (such as the target manufacturer's terminal device). This application obtains the system service AlarmManagerService after constructing the target information object, sets a timer through the system interface, and when the timer is triggered, the system uses AlarmManagerService to start the Activity, bypassing the floating window restriction of the system version. The following shows the key code for constructing the target information object and starting the Activity through the system alarm clock service.
[0101]
[0102] In the code above, AlarmManager is the system alarm clock service interface, and pendingIntent is the encapsulated target information object.
[0103] S404. When the timer is triggered, based on the event type of the operation event and the second transparent activity stack, display the floating window of the target application in the top-level window of the terminal device.
[0104] The specific steps for displaying the floating window of the target application in the top-level window of the terminal device based on the event type of the operation event and the second transparent activity stack are described in the relevant description of step S203 in the previous embodiment, and will not be repeated here.
[0105] In one embodiment, displaying a floating window of the target application in the top-level window of the terminal device based on the event type of the operation event and the second transparent activity stack may include the following steps.
[0106] (1) Determine the target configuration data from multiple candidate configuration data based on the event type of the operation event.
[0107] (2) Configure the second transparent activity stack according to the target configuration data, and display the configured second transparent activity stack in the top window of the terminal device in the form of a floating window.
[0108] The specific implementation methods of steps (1) to (2) are described in the relevant description of step S203 in the aforementioned embodiments, and will not be repeated here.
[0109] In one embodiment, when determining the inclusion relationship between the target manufacturer identifier set and the manufacturer identifier of the terminal device, the following steps may also be performed.
[0110] (1) If the target vendor identifier set does not include the vendor identifier of the terminal device, then when the operation event for the target application is triggered, the system alarm clock service of the terminal device is called to start the timer.
[0111] (2) When the timer is triggered, the floating window of the target application is displayed in the top window of the terminal device according to the event type of the operation event and the second transparent activity stack.
[0112] In this case, the private attributes of the original information object are not modified, and the system alarm clock service of the terminal device is directly called to start the timer. The specific implementation of steps (1) to (2) is described in the relevant description of steps S403 to S404 in the aforementioned embodiments, and will not be repeated here.
[0113] In one embodiment, before determining the target configuration data from multiple candidate configuration data based on the event type of the operation event, multiple candidate configuration data corresponding to various event types can be preset. This is used to obtain the configuration data corresponding to the event type, and to configure the first transparent activity stack (or the second transparent activity stack) according to the obtained configuration data. This ensures that corresponding service pop-ups appear for different event types, guaranteeing a better user experience. Therefore, the above-mentioned steps before determining the target configuration data from multiple candidate configuration data based on the event type of the operation event also include the following steps.
[0114] (1) Obtain the floating window configuration information of the target application. The floating window configuration information includes one or more of the following: operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, and feedback information configuration information.
[0115] In this embodiment, the floating window configuration information can be either pre-configured in the target application where the floating window management client resides (e.g., configured in the target application during development) or obtained through the floating window configuration interface. This improves the flexibility of floating window configuration.
[0116] The operation event configuration information is used to configure different operation behaviors of the operation object, allowing the floating window management client to determine the corresponding operation event based on the operation object's behavior on the terminal device. The event type configuration information is used to determine the corresponding operation event type based on the operation event, so that the corresponding floating window can be displayed subsequently. Furthermore, the operation event configuration information and the event type configuration information have a corresponding relationship (in other words, one event type can match one or more operation events). For example, when the floating window management client detects that the operation object triggers a cleanup control in the target application (in this case, the operation event is triggered by the cleanup control in the target application), it can determine that the event type of this operation event is junk file cleanup; when the floating window management client detects that the operation object triggers an update control in the target application (in this case, the operation event is triggered by the update control in the target application), it can determine that the event type of this operation event is app update.
[0117] The function control configuration information is used to configure the function controls included in the floating window. For example, a frequently used application list jump control can be configured in the floating window, allowing the user to quickly jump to the desired application; a webpage jump control can also be configured; and a one-click cleanup control can also be configured. The floating window card configuration information is used to configure the shape, appearance, style, etc., of the floating window. The function controls included in the floating window are displayed in a graphical interface to improve the user experience.
[0118] The frequency control configuration information is used to detect the frequency of operations performed on the target object to determine whether the corresponding event type should be triggered. For example, when the event type is junk file cleaning, it could be set to trigger by shaking the terminal device. However, the terminal device might also be shaken during normal use, leading to accidental touches. Therefore, frequency control configuration can be implemented, which detects when the frequency of shaking the terminal device reaches a trigger condition (e.g., three shakes within three seconds) before determining to trigger the corresponding event type. This ensures stability and improves the intelligence of the floating window.
[0119] The data retrieval configuration information is used to retrieve the target configuration data from multiple candidate configuration data based on the operation event configuration information and the event type configuration information. The feedback information configuration information is used to send operation information back to the floating window management client after the operation object performs an operation, so that the floating window management client can analyze the operation event and event type based on the returned operation information.
[0120] In one embodiment, the floating window management client can display a floating window configuration interface on a terminal device; receive floating window configuration information on the floating window configuration interface; generate multiple candidate configuration data based on the received configuration information, each of the multiple candidate configuration data being used to set the form, function, and content of the floating window; wherein, the floating window configuration interface includes one or more of the following: a trigger event configuration interface, an event type configuration interface, a floating window card configuration interface, a function control configuration interface, a frequency control configuration interface, a data retrieval configuration interface, and a feedback information configuration interface.
[0121] (2) Generate multiple candidate configuration data based on the floating window configuration information. Each candidate configuration data is used to set one or more of the form, function and content of the corresponding floating window.
[0122] After configuring the above-mentioned operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, and feedback information configuration information, an event type and its corresponding other floating window configuration information are taken as candidate configuration data. This candidate configuration data can configure one or more of the floating window's form, function, and content, thereby generating the floating window corresponding to that event type.
[0123] Please see Figure 5 , Figure 5 This is a flowchart illustrating a floating window management process provided in this application embodiment. First, when the target application starts (i.e., the initial stage), it is determined whether the target application has floating window permissions (corresponding to step 5.1 in the figure). If the target application has floating window permissions, the floating window is started using the system's top-level window service method (corresponding to step 5.2 in the figure, i.e., the method described in step S401 of this application). If the target application does not have floating window permissions, it is determined whether the terminal device's system version information is the target version (the target version can be Android Q, corresponding to step 5.3 in the figure). If the terminal device's system version information is lower than the target version, the floating window is started by moving the transparent activity stack to the foreground (corresponding to step 5.4 in the figure, i.e., the method described in steps S202-S203 of this application). If the terminal device's system version information is equal to or higher than the target version (e.g., the target version is Android Q), the floating window is started using the system alarm clock service method (corresponding to step 5.5 in the figure, i.e., the method described in steps S402-S404 of this application). When the floating window is launched using the system alarm clock service, a timer is set and it is determined whether the timer has expired (corresponding to step 5.6 in the figure). If the timer expires (i.e., the timer is triggered), the floating window is launched (corresponding to step 5.7 in the figure); if the timer is not triggered (i.e., the timer is not triggered), the process ends.
[0124] By employing the aforementioned hierarchical floating window management method, different methods can be used to launch floating windows in different situations. This achieves a success rate of over 80% for floating windows even without granting them permissions, thus improving the reach of messages within the floating window. This application can be widely used in dynamic desktop pop-up modules such as those found in apps like Tencent App Store, including junk file cleanup pop-ups, app uninstallation pop-ups, app update pop-ups, and manual operation pop-ups.
[0125] When the target application is launched on the terminal device, if the floating window permission information of the target application indicates that it has permission, the application obtains the terminal device's system top-level window service and launches the floating window according to the terminal device's system top-level window service. If the target application's floating window permission information indicates that it does not have permission, the application obtains the terminal device's system version information to facilitate targeted floating window management operations based on different system versions, so as to achieve normal use of the floating window function on the terminal device even when the system does not have floating window permissions. When the version indicated by the system version information is equal to or higher than the target version, the application generates a second transparent activity stack corresponding to the target application, which includes the original information object. Since different operating system vendor customized versions grant different permission ranges, the application performs corresponding processing for different operating system vendor customized versions to achieve the purpose of launching the floating window without permission. If the terminal device's operating system version is customized by a certain vendor in the target vendor identifier set, the private attributes in the original information object are modified, and the modified original information object is encapsulated to obtain the target information object, so that the terminal device's operating system recognizes the second transparent activity stack as a system component, bypassing the floating window launch restriction and greatly improving the success rate of floating window launch. This application also provides strategies for modifying proprietary attributes for different manufacturers, offering a reference for the implementation and application of this application. After obtaining the target information object, when an operation event targeting the target application is triggered, a timer is started by calling the system alarm clock service of the terminal device. When the timer is triggered, the floating window is launched. The above process can be regarded as a spontaneous behavior of the system where the terminal device is located, avoiding the launch restrictions of the floating window and realizing the launch of the floating window without permission. Before determining the target configuration data, this application can also preset multiple candidate configuration data corresponding to the event types of various operation events, which are used to configure the generated transparent activity stack to achieve the corresponding business pop-up for different event types, ensuring the user experience. Among them, the operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, feedback information configuration information, etc. included in the target configuration data can be configured, which improves the flexibility of the floating window configuration and enhances the applicability of this application.
[0126] Please see Figure 6 , Figure 6 This is a schematic block diagram of a floating window management device provided in an embodiment of this application. Specifically, the floating window management device may include:
[0127] The processing module 601 is used to generate a first transparent activity stack corresponding to the target application if the system version information of the terminal device indicates a version lower than the target version when the target application of the terminal device is started.
[0128] The processing module 601 is further configured to obtain the event type of the operation event when an operation event for the target application is triggered;
[0129] Display module 602 is used to display a floating window of the target application in the top-level window of the terminal device according to the event type of the operation event and the first transparent activity stack.
[0130] Optionally, the above-mentioned processing module 601 is also used for:
[0131] If the version indicated by the system version information is equal to or higher than the target version, a second transparent activity stack corresponding to the target application is generated, and the second transparent activity stack includes the original information object;
[0132] If the target manufacturer identifier set includes the manufacturer identifier of the terminal device, then the private attributes of the original information object are modified to obtain the target information object. The target information object is used by the operating system of the terminal device to identify the second transparent activity stack as a system component.
[0133] When an operation event targeting the application is triggered, the system alarm clock service of the terminal device is invoked to start a timer.
[0134] When the timer is triggered, a floating window of the target application is displayed in the top-level window of the terminal device, based on the event type of the operation event and the second transparent activity stack.
[0135] Optionally, when the display module 602 displays the floating window of the target application in the top-level window of the terminal device according to the event type of the operation event and the first transparent activity stack, it is specifically used for:
[0136] The target configuration data is determined from multiple candidate configuration data based on the event type of the operation event;
[0137] Configure the first transparent activity stack according to the target configuration data, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window.
[0138] Optionally, the above-mentioned processing module 601 is also used for:
[0139] Return the first transparent activity stack to the background;
[0140] When an operation event is triggered for the target application, the first transparent activity stack is retrieved from the background to the foreground using the activity management service of the terminal device.
[0141] Optionally, when the processing module 601 modifies the private attributes of the original information object to obtain the target information object, it is specifically used for:
[0142] When the manufacturer identifier of the terminal device is the first manufacturer identifier in the target manufacturer identifier set, the value of the first flag bit in the private attribute of the original information object is set to the target value;
[0143] When the manufacturer identifier of the terminal device is the second manufacturer identifier in the target manufacturer identifier set, the value of the second flag bit in the private attribute of the original information object is set to the target logical value;
[0144] The modified original information object is encapsulated to obtain the target information object.
[0145] Optionally, the above-mentioned processing module 601 is also used for:
[0146] If the target manufacturer identifier set does not include the manufacturer identifier of the terminal device, then when an operation event for the target application is triggered, the system alarm clock service of the terminal device is invoked to start a timer.
[0147] When the timer is triggered, a floating window of the target application is displayed in the top-level window of the terminal device, based on the event type of the operation event and the second transparent activity stack.
[0148] Optionally, the above-mentioned processing module 601 is also used for:
[0149] Obtain the floating window configuration information of the target application. The floating window configuration information includes one or more of the following: operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, and feedback information configuration information.
[0150] Multiple candidate configuration data are generated based on the floating window configuration information. Each candidate configuration data is used to set one or more of the form, function and content of the corresponding floating window.
[0151] It should be noted that the functions of each functional module of the floating window management device in this application embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.
[0152] Please see Figure 7 , Figure 7This is a schematic block diagram of a computer device provided in an embodiment of this application. As shown in the figure, the smart terminal in this embodiment may include: a processor 701, a storage device 702, and a communication interface 703. The processor 701, the storage device 702, and the communication interface 703 can interact with each other.
[0153] The aforementioned storage device 702 may include volatile memory, such as random-access memory (RAM); the storage device 702 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the aforementioned storage device 702 may also include a combination of the above types of memory.
[0154] The processor 701 described above may be a central processing unit (CPU). In one embodiment, the processor 701 may also be a graphics processing unit (GPU). Alternatively, the processor 701 may be a combination of a CPU and a GPU. In one embodiment, the storage device 702 is used to store program instructions, which the processor 701 can invoke to perform the following operations:
[0155] When the target application on the terminal device is launched, if the system version information of the terminal device indicates a version lower than the target version, a first transparent activity stack corresponding to the target application is generated.
[0156] When an operation event is triggered for the target application, the event type of the operation event is obtained;
[0157] Based on the event type of the operation event and the first transparent activity stack, a floating window of the target application is displayed in the top-level window of the terminal device.
[0158] Optionally, the processor 701 described above is also used for:
[0159] If the version indicated by the system version information is equal to or higher than the target version, a second transparent activity stack corresponding to the target application is generated, and the second transparent activity stack includes the original information object;
[0160] If the target manufacturer identifier set includes the manufacturer identifier of the terminal device, then the private attributes of the original information object are modified to obtain the target information object. The target information object is used by the operating system of the terminal device to identify the second transparent activity stack as a system component.
[0161] When an operation event targeting the application is triggered, the system alarm clock service of the terminal device is invoked to start a timer.
[0162] When the timer is triggered, a floating window of the target application is displayed in the top-level window of the terminal device, based on the event type of the operation event and the second transparent activity stack.
[0163] Optionally, when the processor 701 displays the floating window of the target application in the top-level window of the terminal device according to the event type of the operation event and the first transparent activity stack, it is specifically used for:
[0164] The target configuration data is determined from multiple candidate configuration data based on the event type of the operation event;
[0165] Configure the first transparent activity stack according to the target configuration data, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window.
[0166] Optionally, the processor 701 described above is also used for:
[0167] Return the first transparent activity stack to the background;
[0168] When an operation event is triggered for the target application, the first transparent activity stack is retrieved from the background to the foreground using the activity management service of the terminal device.
[0169] Optionally, when the processor 701 modifies the private attributes of the original information object to obtain the target information object, it specifically performs the following:
[0170] When the manufacturer identifier of the terminal device is the first manufacturer identifier in the target manufacturer identifier set, the value of the first flag bit in the private attribute of the original information object is set to the target value;
[0171] When the manufacturer identifier of the terminal device is the second manufacturer identifier in the target manufacturer identifier set, the value of the second flag bit in the private attribute of the original information object is set to the target logical value;
[0172] The modified original information object is encapsulated to obtain the target information object.
[0173] Optionally, the processor 701 described above is also used for:
[0174] If the target manufacturer identifier set does not include the manufacturer identifier of the terminal device, then when an operation event for the target application is triggered, the system alarm clock service of the terminal device is invoked to start a timer.
[0175] When the timer is triggered, a floating window of the target application is displayed in the top-level window of the terminal device, based on the event type of the operation event and the second transparent activity stack.
[0176] Optionally, the processor 701 described above is also used for:
[0177] Obtain the floating window configuration information of the target application. The floating window configuration information includes one or more of the following: operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, and feedback information configuration information.
[0178] Multiple candidate configuration data are generated based on the floating window configuration information. Each candidate configuration data is used to set one or more of the form, function and content of the corresponding floating window.
[0179] In specific implementation, the processor 701, storage device 702, and communication interface 703 described in the embodiments of this application can execute the embodiments of this application. Figure 2 or Figure 4 The implementation methods described in the relevant embodiments of the provided floating window management method can also be implemented in the embodiments of this application. Figure 6 The implementation methods described in the relevant embodiments of the provided floating window management device will not be repeated here.
[0180] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0181] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium storing a computer program executed by the aforementioned floating window management device. This computer program includes program instructions, which, when executed by a processor, can execute the aforementioned... Figure 2 , Figure 4The methods described in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same methods will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.
[0182] According to one aspect of this application, a computer program product or computer program is provided, comprising 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 the aforementioned... Figure 2 , Figure 4 The methods described in the corresponding embodiments will not be repeated here.
[0183] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0184] The above-disclosed embodiments are merely some of the embodiments of this application, and should not be construed as limiting the scope of this application. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of this application still fall within the scope of the invention.
Claims
1. A method for managing floating windows, characterized in that, The method includes: When the target application on the terminal device is launched, if the system version information of the terminal device indicates a version lower than the target version, a first transparent activity stack corresponding to the target application is generated. When an operation event is triggered for the target application, the event type of the operation event is obtained; Configure the first transparent activity stack according to the event type of the operation event, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window; If the version indicated by the system version information is equal to or higher than the target version, then a second transparent activity stack corresponding to the target application is generated; When an operation event targeting the application is triggered, the system alarm clock service of the terminal device is invoked to start a timer. When the timer is triggered, the second transparent activity stack is configured according to the event type of the operation event, and the configured second transparent activity stack is displayed in the top-level window of the terminal device in the form of a floating window.
2. The method according to claim 1, characterized in that, The second transparent activity stack includes the original information object, and the method further includes: If the target manufacturer identifier set includes the manufacturer identifier of the terminal device, then the private attributes of the original information object are modified to obtain the target information object, and the step of calling the system alarm clock service of the terminal device to start the timer when the operation event for the target application is triggered is executed; the target information object is used by the operating system of the terminal device to identify the second transparent activity stack as a system component, and the original information object includes the Intent object in Android Activity.
3. The method according to claim 1, characterized in that, The step of configuring the first transparent activity stack according to the event type of the operation event, and displaying the configured first transparent activity stack as a floating window in the top-level window of the terminal device, includes: The target configuration data is determined from multiple candidate configuration data based on the event type of the operation event; Configure the first transparent activity stack according to the target configuration data, and display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window.
4. The method according to claim 1, characterized in that, The method further includes: Return the first transparent activity stack to the background; When an operation event is triggered for the target application, the first transparent activity stack is retrieved from the background to the foreground using the activity management service of the terminal device.
5. The method according to claim 2, characterized in that, The step of modifying the private attributes of the original information object to obtain the target information object includes: When the manufacturer identifier of the terminal device is the first manufacturer identifier in the target manufacturer identifier set, the value of the first flag bit in the private attribute of the original information object is set to the target value; When the manufacturer identifier of the terminal device is the second manufacturer identifier in the target manufacturer identifier set, the value of the second flag bit in the private attribute of the original information object is set to the target logical value; The modified original information object is encapsulated to obtain the target information object.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtain the floating window configuration information of the target application. The floating window configuration information includes one or more of the following: operation event configuration information, event type configuration information, floating window card configuration information, function control configuration information, frequency control configuration information, data retrieval configuration information, and feedback information configuration information. Multiple candidate configuration data are generated based on the floating window configuration information. Each candidate configuration data is used to set one or more of the form, function and content of the corresponding floating window.
7. The method according to claim 2 or 5, characterized in that, The method further includes: If the target vendor identifier set does not include the vendor identifier of the terminal device, then the step of calling the system alarm clock service of the terminal device to start the timer when the operation event for the target application is triggered is executed.
8. A floating window management device, characterized in that, The device includes: The processing module is used to generate a first transparent activity stack corresponding to the target application if the system version information of the terminal device indicates a version lower than the target version when the target application of the terminal device is started. The processing module is further configured to obtain the event type of the operation event when the operation event for the target application is triggered; The display module is used to configure the first transparent activity stack according to the event type of the operation event, and to display the configured first transparent activity stack in the top window of the terminal device in the form of a floating window. The processing module is further configured to generate a second transparent activity stack corresponding to the target application if the version indicated by the system version information is equal to or higher than the target version. The processing module is also configured to call the system alarm clock service of the terminal device to start a timer when an operation event for the target application is triggered. The display module is further configured to configure the second transparent activity stack according to the event type of the operation event when the timer is triggered, and display the configured second transparent activity stack in the top window of the terminal device in the form of a floating window.
9. A computer device, characterized in that, include: The system includes a processor, a storage device, and a communication interface, wherein the processor, the communication interface, and the storage device are interconnected, and the storage device stores executable program code. The processor is used to call the executable program code to implement the floating window management method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which are executed by a processor to implement the floating window management method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the floating window management method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Floating window display method and device and storage medium
CN109491753A