技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种壁纸显示方法及相关装置。The present application relates to the field of terminal technology, and in particular, to a wallpaper display method and related devices.
背景技术Background technique
随着终端技术的发展,终端所支持的壁纸种类和壁纸数量越来越多,为了满足用户的多样性需求,终端所支持的壁纸从静态的图片壁纸发展到动态的视频壁纸。With the development of terminal technology, the types and number of wallpapers supported by terminals are increasing. In order to meet the diverse needs of users, the wallpapers supported by terminals have evolved from static picture wallpapers to dynamic video wallpapers.
可能的实现中,在视频壁纸开发时,每套视频壁纸均需要在终端的软件框架中定制壁纸服务,当用户选择使用某一视频壁纸时,终端设备需要选择该视频壁纸对应的壁纸服务辅助实现该视频壁纸的显示。In a possible implementation, when developing video wallpapers, each set of video wallpapers needs to customize the wallpaper service in the terminal's software framework. When the user chooses to use a certain video wallpaper, the terminal device needs to select the wallpaper service corresponding to the video wallpaper to assist in implementation. Display of this video wallpaper.
但是,上述实现中,壁纸服务维护难度高,项目占用空间大,壁纸开发效率低,人工成本高。However, in the above implementation, wallpaper service maintenance is difficult, the project takes up a lot of space, wallpaper development efficiency is low, and labor costs are high.
发明内容Contents of the invention
本申请实施例提供一种壁纸显示方法及相关装置,该方法提供一种壁纸框架,可以根据壁纸的主题包,为该主题包适配壁纸服务,还能支持在用户更改壁纸导致壁纸类型发生变化时,自动切换到壁纸类型变化后对应的壁纸服务,并为壁纸配置锁屏透明等系统能力,从而可以简化开发流程,节省人力成本。Embodiments of the present application provide a wallpaper display method and related devices. The method provides a wallpaper framework, which can adapt wallpaper services to the theme package according to the theme package of the wallpaper, and can also support changes in the wallpaper type caused by the user changing the wallpaper. When the wallpaper type changes, it automatically switches to the corresponding wallpaper service, and configures system capabilities such as lock screen transparency for the wallpaper, which can simplify the development process and save labor costs.
第一方面,本申请实施例提供一种壁纸显示方法,方法包括:In a first aspect, embodiments of the present application provide a wallpaper display method. The method includes:
终端设备基于第一壁纸服务显示第一壁纸;终端设备接收到针对第二壁纸的标识的第一操作;响应于第一操作,终端设备得到第二壁纸对应的壁纸服务的标识;当第一壁纸服务与第二壁纸对应的壁纸服务为相同的服务时,终端设备基于第一壁纸服务实现第二壁纸的显示。这样,当壁纸改变时,改变后的壁纸对应的壁纸服务与改变前终端设备运行的壁纸服务相同时,终端设备可以基于改变前终端设备运行的壁纸服务显示改变后的壁纸,不需要为每个壁纸都定制壁纸服务,简化了开发流程,节省了人力成本。The terminal device displays the first wallpaper based on the first wallpaper service; the terminal device receives the first operation for the identification of the second wallpaper; in response to the first operation, the terminal device obtains the identification of the wallpaper service corresponding to the second wallpaper; when the first wallpaper When the service is the same as the wallpaper service corresponding to the second wallpaper, the terminal device implements display of the second wallpaper based on the first wallpaper service. In this way, when the wallpaper changes, and the wallpaper service corresponding to the changed wallpaper is the same as the wallpaper service running on the terminal device before the change, the terminal device can display the changed wallpaper based on the wallpaper service running on the terminal device before the change, without the need for each Wallpapers are all customized wallpaper services, which simplifies the development process and saves labor costs.
一种可能的实现方式中,终端设备得到第二壁纸对应的壁纸服务的标识,包括:终端设备获取第二壁纸的主题包;第二壁纸的主题包配置有第二壁纸对应的壁纸服务的标识;终端设备解析第二壁纸的主题包,得到第二壁纸对应的壁纸服务的标识。这样,终端设备可以通过解析壁纸的主题包,快速准确的得到壁纸对应的壁纸服务的标识。In one possible implementation, the terminal device obtains the identity of the wallpaper service corresponding to the second wallpaper, including: the terminal device obtains the theme package of the second wallpaper; the theme package of the second wallpaper is configured with the identity of the wallpaper service corresponding to the second wallpaper. ; The terminal device parses the theme package of the second wallpaper and obtains the identification of the wallpaper service corresponding to the second wallpaper. In this way, the terminal device can quickly and accurately obtain the identification of the wallpaper service corresponding to the wallpaper by parsing the theme package of the wallpaper.
一种可能的实现方式中,第二壁纸的主题包中还包括第二壁纸的壁纸资源,以及第二壁纸的配置文件;壁纸资源包括视频和图片,配置文件包括壁纸资源的帧数和壁纸资源的显示相关参数;终端设备基于第一壁纸服务实现第二壁纸的显示,包括:终端设备根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源;终端设备基于更新后的第一壁纸服务中的壁纸资源显示第二壁纸。这样,在壁纸改变、壁纸对应的壁纸服务不变的情况下,终端设备可以通过更新壁纸资源、基于原壁纸服务显示改变后的壁纸,节约人力成本、提升壁纸开发的效率。In one possible implementation, the theme package of the second wallpaper also includes the wallpaper resources of the second wallpaper, and the configuration file of the second wallpaper; the wallpaper resources include videos and pictures, and the configuration file includes the frame number and wallpaper resources of the wallpaper resources. display related parameters; the terminal device implements the display of the second wallpaper based on the first wallpaper service, including: the terminal device updates the wallpaper resources in the first wallpaper service based on the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper; the terminal device based on The updated wallpaper resource in the first wallpaper service displays the second wallpaper. In this way, when the wallpaper changes and the wallpaper service corresponding to the wallpaper remains unchanged, the terminal device can update the wallpaper resources and display the changed wallpaper based on the original wallpaper service, saving labor costs and improving the efficiency of wallpaper development.
一种可能的实现方式中,显示相关参数包括深色模式或浅色模式;终端设备根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源,包括:当第二壁纸对应于深色模式时,终端设备从第二壁纸的壁纸资源中获取深色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在深色模式对应的壁纸资源;或者,当第二壁纸对应于浅色模式时,终端设备从第二壁纸的壁纸资源中获取浅色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在浅色模式对应的壁纸资源。这样,终端设备可以基于显示相关参数,根据壁纸的配置文件和资源更新壁纸资源,使得壁纸服务更加智能、增强与用户的交互能力。In a possible implementation, the display-related parameters include dark mode or light mode; the terminal device updates the wallpaper resources in the first wallpaper service according to the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper, including: when the second wallpaper When the second wallpaper corresponds to dark mode, the terminal device obtains the wallpaper resource corresponding to dark mode from the wallpaper resource of the second wallpaper, and updates the wallpaper resource in the first wallpaper service to the wallpaper resource corresponding to the second wallpaper in dark mode. ; Or, when the second wallpaper corresponds to the light color mode, the terminal device obtains the wallpaper resource corresponding to the light color mode from the wallpaper resource of the second wallpaper, and updates the wallpaper resource in the first wallpaper service to the second wallpaper in the light color mode. The wallpaper resource corresponding to the mode. In this way, the terminal device can update the wallpaper resources according to the wallpaper's configuration file and resources based on display-related parameters, making the wallpaper service more intelligent and enhancing the ability to interact with users.
一种可能的实现方式中,终端设备根据第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源之前,还包括:终端设备的应用程序框架层的折叠壁纸框架FWK向应用层的应用程序包APK中的第一壁纸服务发送安卓壁纸再请求android wallpaper reapply指令。这样,在壁纸改变、对应的壁纸服务不变的情况下,终端设备可以通过发送androidwallpaper reapply指令,指示壁纸服务更新壁纸资源和配置,节约人力成本、提升壁纸开发的效率。In a possible implementation, before the terminal device updates the wallpaper resource in the first wallpaper service according to the wallpaper resource of the second wallpaper, it also includes: the folded wallpaper framework FWK of the application framework layer of the terminal device to the application package of the application layer. The first wallpaper service in the APK sends the Android wallpaper and then requests the android wallpaper reapply command. In this way, when the wallpaper changes and the corresponding wallpaper service remains unchanged, the terminal device can send the androidwallpaper reapply command to instruct the wallpaper service to update the wallpaper resources and configuration, saving labor costs and improving the efficiency of wallpaper development.
一种可能的实现方式中,还包括:当终端设备支持锁屏透明显示时,终端设备将第二壁纸的壁纸资源中的图片向锁屏显示相关模块复制。这样,终端设备可以提供动态的锁屏透明场景,使壁纸服务更加丰富有趣。One possible implementation further includes: when the terminal device supports lock screen transparent display, the terminal device copies the picture in the wallpaper resource of the second wallpaper to the lock screen display related module. In this way, the terminal device can provide dynamic lock screen transparent scenes, making the wallpaper service more rich and interesting.
一种可能的实现方式中,方法还包括:终端设备接收到针对第三壁纸的标识的第二操作;响应于第二操作,终端设备得到第三壁纸对应的壁纸服务的标识;当第一壁纸服务与第三壁纸对应的壁纸服务为不相同的服务时,终端设备启动第二壁纸服务,第二壁纸服务为第三壁纸对应的壁纸服务;终端设备基于第二壁纸服务实现第三壁纸的显示。这样,当壁纸改变时,改变后的壁纸对应的壁纸服务与改变前终端设备运行的壁纸服务不同时,终端设备可以启动改变后的壁纸对应的壁纸服务,基于改变后的壁纸对应的壁纸服务显示改变后的壁纸,不需要为每个壁纸都定制壁纸服务,简化了开发流程,节省了人力成本。In a possible implementation, the method further includes: the terminal device receives a second operation for the identification of the third wallpaper; in response to the second operation, the terminal device obtains the identification of the wallpaper service corresponding to the third wallpaper; when the first wallpaper When the service is different from the wallpaper service corresponding to the third wallpaper, the terminal device starts the second wallpaper service, and the second wallpaper service is the wallpaper service corresponding to the third wallpaper; the terminal device implements the display of the third wallpaper based on the second wallpaper service . In this way, when the wallpaper changes, and the wallpaper service corresponding to the changed wallpaper is different from the wallpaper service running on the terminal device before the change, the terminal device can start the wallpaper service corresponding to the changed wallpaper, and display the wallpaper service corresponding to the changed wallpaper. After changing the wallpaper, there is no need to customize wallpaper services for each wallpaper, which simplifies the development process and saves labor costs.
一种可能的实现方式中,终端设备基于第二壁纸服务实现第三壁纸的显示,包括:终端设备基于第二壁纸服务注册监听深色模式或浅色模式;终端设备解析第三壁纸的主题包;第三壁纸的主题包包括第三壁纸的壁纸资源和第三壁纸的配置文件;终端设备根据第三壁纸的配置文件和第三壁纸的壁纸资源向第二壁纸服务中写入壁纸资源;终端设备基于第二壁纸服务中写入的壁纸资源显示第三壁纸。这样,终端设备可以将改变后的壁纸对应的壁纸资源及壁纸配置文件,主动写入改变后的壁纸对应的壁纸服务中,终端设备基于写入的壁纸资源及配置文件显示改变后的壁纸,可以增强壁纸与用户操作的交互性,节约了人力成本。In one possible implementation, the terminal device implements display of the third wallpaper based on the second wallpaper service, including: the terminal device registers to monitor the dark mode or light mode based on the second wallpaper service; the terminal device parses the theme package of the third wallpaper ; The theme package of the third wallpaper includes the wallpaper resource of the third wallpaper and the configuration file of the third wallpaper; the terminal device writes wallpaper resources to the second wallpaper service according to the configuration file of the third wallpaper and the wallpaper resource of the third wallpaper; the terminal device The device displays the third wallpaper based on the wallpaper resource written in the second wallpaper service. In this way, the terminal device can actively write the wallpaper resources and wallpaper configuration files corresponding to the changed wallpaper into the wallpaper service corresponding to the changed wallpaper. The terminal device can display the changed wallpaper based on the written wallpaper resources and configuration files. Enhance the interactivity between wallpaper and user operations, saving labor costs.
一种可能的实现方式中,终端设备根据第三壁纸的配置文件和第三壁纸的壁纸资源向第二壁纸服务中写入壁纸资源,包括:当第三壁纸对应于深色模式时,终端设备从第三壁纸的壁纸资源中获取深色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在深色模式对应的壁纸资源;或者,当第三壁纸对应于浅色模式时,终端设备从第三壁纸的壁纸资源中获取浅色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在浅色模式对应的壁纸资源。这样,终端设备可以基于显示相关参数,根据壁纸的配置文件和资源更新壁纸资源,使得壁纸服务更加智能、增强与用户的交互能力。In a possible implementation, the terminal device writes wallpaper resources to the second wallpaper service according to the configuration file of the third wallpaper and the wallpaper resources of the third wallpaper, including: when the third wallpaper corresponds to the dark mode, the terminal device Obtain the wallpaper resources corresponding to the dark mode from the wallpaper resources of the third wallpaper, initialize the wallpaper playback implementation strategy to the frame-by-frame playback strategy, and write the wallpaper resources corresponding to the dark mode of the third wallpaper to the second wallpaper service; Or, when the third wallpaper corresponds to the light mode, the terminal device obtains the wallpaper resource corresponding to the light mode from the wallpaper resource of the third wallpaper, initializes the wallpaper playback implementation strategy to the frame-by-frame playback strategy, and serves the second wallpaper Write the wallpaper resources corresponding to the third wallpaper in light mode. In this way, the terminal device can update the wallpaper resources according to the wallpaper's configuration file and resources based on display-related parameters, making the wallpaper service more intelligent and enhancing the ability to interact with users.
一种可能的实现方式中,还包括:当终端设备的系统版本大于或等于预设版本时,终端设备从数据库中获取第三壁纸的壁纸资源;或者,当终端设备的系统版本小于预设版本时,终端设备从元数据meta data中获取第三壁纸的壁纸资源。这样,可以兼容系统版本小于预设版本的终端设备,提升用户的使用体验。A possible implementation also includes: when the system version of the terminal device is greater than or equal to the preset version, the terminal device obtains the wallpaper resource of the third wallpaper from the database; or, when the system version of the terminal device is less than the preset version When the terminal device obtains the wallpaper resource of the third wallpaper from the metadata. In this way, it can be compatible with terminal devices whose system version is smaller than the preset version, improving the user experience.
一种可能的实现方式中,还包括:当终端设备支持熄屏显示AOD时,终端设备为第三壁纸配置动画时长、AOD样式以及锁屏图片。这样,通过为超级壁纸进行相关的动效配置,可以使超级壁纸的显示效果更加丰富、有趣、个性化。One possible implementation method also includes: when the terminal device supports AOD display with the screen turned off, the terminal device configures the animation duration, AOD style and lock screen image for the third wallpaper. In this way, by configuring relevant dynamic effects for the super wallpaper, the display effect of the super wallpaper can be made more rich, interesting, and personalized.
第二方面,本申请实施例提供一种壁纸显示装置。该壁纸显示装置可以是终端设备,也可以是终端设备内的芯片或者芯片系统。该壁纸显示装置可以包括处理单元和显示单元。处理单元用于实现第一方面或第一方面的任意一种可能的实现方式中与处理相关的任意方法。当该壁纸显示装置是终端设备时,该处理单元可以是处理器。显示单元用于支持壁纸显示装置显示图像信息等。该壁纸显示装置还可以包括存储单元,该存储单元可以是存储器。该存储单元用于存储指令,该处理单元执行该存储单元所存储的指令,以使该终端设备实现第一方面或第一方面的任意一种可能的实现方式中描述的一种方法。当该壁纸显示装置是终端设备内的芯片或者芯片系统时,该处理单元可以是处理器。该处理单元执行存储单元所存储的指令,以使该终端设备实现第一方面或第一方面的任意一种可能的实现方式中描述的一种方法。该存储单元可以是该芯片内的存储单元(例如,寄存器、缓存等),也可以是该终端设备内的位于该芯片外部的存储单元(例如,只读存储器、随机存取存储器等)。In a second aspect, embodiments of the present application provide a wallpaper display device. The wallpaper display device may be a terminal device, or may be a chip or chip system in the terminal device. The wallpaper display device may include a processing unit and a display unit. The processing unit is used to implement any method related to processing in the first aspect or any possible implementation manner of the first aspect. When the wallpaper display device is a terminal device, the processing unit may be a processor. The display unit is used to support the wallpaper display device to display image information and the like. The wallpaper display device may also include a storage unit, and the storage unit may be a memory. The storage unit is used to store instructions, and the processing unit executes the instructions stored in the storage unit, so that the terminal device implements a method described in the first aspect or any possible implementation of the first aspect. When the wallpaper display device is a chip or chip system in a terminal device, the processing unit may be a processor. The processing unit executes instructions stored in the storage unit, so that the terminal device implements a method described in the first aspect or any possible implementation of the first aspect. The storage unit may be a storage unit within the chip (eg, register, cache, etc.), or may be a storage unit in the terminal device located outside the chip (eg, read-only memory, random access memory, etc.).
示例性的,显示单元,用于基于第一壁纸服务显示第一壁纸;处理单元,用于接收到针对第二壁纸的标识的第一操作;处理单元,还用于响应于第一操作,得到第二壁纸对应的壁纸服务的标识;显示单元,还用于当第一壁纸服务与第二壁纸对应的壁纸服务为相同的服务时,基于第一壁纸服务实现第二壁纸的显示。Exemplarily, the display unit is configured to display the first wallpaper based on the first wallpaper service; the processing unit is configured to receive the first operation for the identification of the second wallpaper; the processing unit is also configured to obtain in response to the first operation The identifier of the wallpaper service corresponding to the second wallpaper; the display unit is also used to display the second wallpaper based on the first wallpaper service when the first wallpaper service and the wallpaper service corresponding to the second wallpaper are the same service.
一种可能的实现中,处理单元,具体用于获取第二壁纸的主题包;第二壁纸的主题包配置有第二壁纸对应的壁纸服务的标识;处理单元,还用于解析第二壁纸的主题包,得到第二壁纸对应的壁纸服务的标识。In one possible implementation, the processing unit is specifically used to obtain the theme package of the second wallpaper; the theme package of the second wallpaper is configured with the identifier of the wallpaper service corresponding to the second wallpaper; the processing unit is also used to parse the second wallpaper's theme package. The theme package obtains the logo of the wallpaper service corresponding to the second wallpaper.
一种可能的实现中,第二壁纸的主题包中还包括第二壁纸的壁纸资源,以及第二壁纸的配置文件;壁纸资源包括视频和图片,配置文件包括壁纸资源的帧数和壁纸资源的显示相关参数;处理单元,还用于根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源;显示单元,还用于基于更新后的第一壁纸服务中的壁纸资源显示第二壁纸。In one possible implementation, the theme package of the second wallpaper also includes the wallpaper resources of the second wallpaper, and the configuration file of the second wallpaper; the wallpaper resources include videos and pictures, and the configuration file includes the number of frames of the wallpaper resources and the number of frames of the wallpaper resources. Display related parameters; the processing unit is also used to update the wallpaper resources in the first wallpaper service based on the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper; the display unit is also used to update the wallpaper resources in the first wallpaper service based on the updated The wallpaper resource displays the second wallpaper.
一种可能的实现中,显示相关参数包括深色模式或浅色模式;当第二壁纸对应于深色模式时,处理单元,具体用于从第二壁纸的壁纸资源中获取深色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在深色模式对应的壁纸资源;或者,当第二壁纸对应于浅色模式时,处理单元,具体用于从第二壁纸的壁纸资源中获取浅色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在浅色模式对应的壁纸资源。In a possible implementation, the display-related parameters include dark mode or light mode; when the second wallpaper corresponds to the dark mode, the processing unit is specifically configured to obtain the dark mode corresponding to the wallpaper resource of the second wallpaper. Wallpaper resources, and update the wallpaper resources in the first wallpaper service to the wallpaper resources corresponding to the second wallpaper in the dark mode; or, when the second wallpaper corresponds to the light mode, the processing unit is specifically used to obtain the wallpaper resources from the second wallpaper. Obtain the wallpaper resource corresponding to the light color mode from the wallpaper resource, and update the wallpaper resource in the first wallpaper service to the wallpaper resource corresponding to the second wallpaper in the light color mode.
一种可能的实现中,处理单元根据第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源之前,利用终端设备的应用程序框架层的折叠壁纸框架FWK向应用层的应用程序包APK中的第一壁纸服务发送安卓壁纸再请求android wallpaper reapply指令。In one possible implementation, before the processing unit updates the wallpaper resource in the first wallpaper service according to the wallpaper resource of the second wallpaper, it uses the folded wallpaper frame FWK of the application framework layer of the terminal device to the application package APK of the application layer. The first wallpaper service sends the Android wallpaper and then requests the android wallpaper reapply command.
一种可能的实现中,当终端设备支持锁屏透明显示时,处理单元,还用于将第二壁纸的壁纸资源中的图片向锁屏显示相关模块复制。In one possible implementation, when the terminal device supports transparent display on the lock screen, the processing unit is also used to copy the picture in the wallpaper resource of the second wallpaper to the lock screen display related module.
一种可能的实现中,处理单元,还用于接收到针对第三壁纸的标识的第二操作;响应于第二操作,处理单元,还用于得到第三壁纸对应的壁纸服务的标识;当第一壁纸服务与第三壁纸对应的壁纸服务为不相同的服务时,处理单元,还用于启动第二壁纸服务,第二壁纸服务为第三壁纸对应的壁纸服务;显示单元,还用于基于第二壁纸服务实现第三壁纸的显示。In a possible implementation, the processing unit is also configured to receive a second operation for the identification of the third wallpaper; in response to the second operation, the processing unit is also configured to obtain the identification of the wallpaper service corresponding to the third wallpaper; when When the first wallpaper service and the wallpaper service corresponding to the third wallpaper are different services, the processing unit is also used to start the second wallpaper service, and the second wallpaper service is the wallpaper service corresponding to the third wallpaper; the display unit is also used to The third wallpaper is displayed based on the second wallpaper service.
一种可能的实现中,处理单元,具体用于基于第二壁纸服务注册监听深色模式或浅色模式;处理单元,还用于解析第三壁纸的主题包;第三壁纸的主题包包括第三壁纸的壁纸资源和第三壁纸的配置文件;处理单元,还用于根据第三壁纸的配置文件和第三壁纸的壁纸资源向第二壁纸服务中写入壁纸资源;显示单元,还用于基于第二壁纸服务中写入的壁纸资源显示第三壁纸。In a possible implementation, the processing unit is specifically configured to monitor the dark mode or the light mode based on the second wallpaper service registration; the processing unit is also used to parse the theme package of the third wallpaper; the theme package of the third wallpaper includes the third wallpaper. The wallpaper resources of the third wallpaper and the configuration file of the third wallpaper; the processing unit is also used to write wallpaper resources into the second wallpaper service according to the configuration file of the third wallpaper and the wallpaper resources of the third wallpaper; the display unit is also used to Displaying the third wallpaper based on the wallpaper resource written in the second wallpaper service.
一种可能的实现中,当第三壁纸对应于深色模式时,处理单元,具体用于从第三壁纸的壁纸资源中获取深色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在深色模式对应的壁纸资源;或者,当第三壁纸对应于浅色模式时,处理单元,具体用于从第三壁纸的壁纸资源中获取浅色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在浅色模式对应的壁纸资源。In one possible implementation, when the third wallpaper corresponds to the dark mode, the processing unit is specifically configured to obtain the wallpaper resources corresponding to the dark mode from the wallpaper resources of the third wallpaper, and initialize the wallpaper playback implementation strategy to play by frame. policy, and write the wallpaper resources corresponding to the third wallpaper in the dark mode to the second wallpaper service; or, when the third wallpaper corresponds to the light mode, the processing unit is specifically used to obtain the wallpaper resources of the third wallpaper Obtain the wallpaper resources corresponding to the light color mode from , initialize the wallpaper playback implementation strategy to the frame-by-frame playback strategy, and write the wallpaper resources corresponding to the third wallpaper in the light color mode to the second wallpaper service.
一种可能的实现中,当终端设备的系统版本大于或等于预设版本时,处理单元,还用于从数据库中获取第三壁纸的壁纸资源;或者,当终端设备的系统版本小于预设版本时,处理单元,还用于从元数据meta data中获取第三壁纸的壁纸资源。In one possible implementation, when the system version of the terminal device is greater than or equal to the preset version, the processing unit is also used to obtain the wallpaper resource of the third wallpaper from the database; or, when the system version of the terminal device is less than the preset version At this time, the processing unit is also used to obtain the wallpaper resources of the third wallpaper from the meta data.
一种可能的实现中,当终端设备支持熄屏显示AOD时,处理单元,还用于为第三壁纸配置动画时长、AOD样式以及锁屏图片。In one possible implementation, when the terminal device supports AOD display with the screen turned off, the processing unit is also used to configure the animation duration, AOD style and lock screen image for the third wallpaper.
第三方面,本申请实施例提供一种电子设备,包括处理器和存储器,存储器用于存储代码指令,处理器用于运行代码指令,以执行第一方面或第一方面的任意一种可能的实现方式中描述的方法。In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory. The memory is used to store code instructions, and the processor is used to run the code instructions to execute the first aspect or any possible implementation of the first aspect. The method described in the method.
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机程序。计算机程序被处理器执行时实现如第一方面的方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium. The method of the first aspect is implemented when the computer program is executed by the processor.
第五方面,本申请实施例提供一种计算机程序产品,计算机程序产品包括计算机程序,当计算机程序被运行时,使得计算机执行如第一方面的方法。In a fifth aspect, embodiments of the present application provide a computer program product. The computer program product includes a computer program. When the computer program is run, it causes the computer to execute the method of the first aspect.
第六方面,本申请实施例提供了一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面的方法。In a sixth aspect, embodiments of the present application provide a chip. The chip includes a processor, and the processor is configured to call a computer program in a memory to execute the method of the first aspect.
应当理解的是,本申请的第二方面至第六方面与本申请的第一方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the second to sixth aspects of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects achieved by each aspect and corresponding feasible implementations are similar, and will not be described again.
附图说明Description of drawings
图1为本申请实施例提供的应用场景示意图;Figure 1 is a schematic diagram of an application scenario provided by an embodiment of this application;
图2为本申请实施例提供的电子设备的结构示意图;Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的一种电子设备的软件架构示意图;Figure 3 is a schematic diagram of the software architecture of an electronic device provided by an embodiment of the present application;
图4为本申请实施例提供的一种具体的壁纸显示方法的各模块交互图;Figure 4 is an interaction diagram of each module of a specific wallpaper display method provided by an embodiment of the present application;
图5为本申请实施例提供的另一种具体的壁纸显示方法的各模块交互图;Figure 5 is an interaction diagram of each module of another specific wallpaper display method provided by the embodiment of the present application;
图6A为本申请实施例提供的折叠壁纸显示实现的流程示意图;Figure 6A is a schematic flowchart of the implementation of folding wallpaper display provided by the embodiment of the present application;
图6B为本申请实施例提供的折叠壁纸显示控制的流程示意图;Figure 6B is a schematic flowchart of folded wallpaper display control provided by an embodiment of the present application;
图7为本申请实施例提供的结合熄屏显示的壁纸显示实现流程示意图;Figure 7 is a schematic flowchart of implementation of wallpaper display combined with screen-off display provided by an embodiment of the present application;
图8为本申请实施例提供的一种壁纸显示方法的流程示意图;Figure 8 is a schematic flowchart of a wallpaper display method provided by an embodiment of the present application;
图9为本申请实施例提供的一种壁纸显示装置的结构示意图;Figure 9 is a schematic structural diagram of a wallpaper display device provided by an embodiment of the present application;
图10为本申请实施例提供的一种电子设备的硬件结构示意图;Figure 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
图11为本申请实施例提供的一种芯片的结构示意图。Figure 11 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
为了便于清楚描述本申请实施例的技术方案,以下,对本申请实施例中所涉及的部分术语和技术进行简单介绍:In order to facilitate a clear description of the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
1、主题包:主题包是一组美化系统或者软件界面的数据包。本申请实施例中,不同壁纸对应于不同的主题包,主题包可以包括三个主要文件:livepaper.xml、livepaper_config.xml和资源。其中,livepaper.xml中存储有壁纸服务名称,壁纸服务可以指用于辅助实现壁纸显示等的服务(service);livepaper_config.xml中存储有壁纸的配置文件,配置文件包括下述的一项或多项:视频帧数、视频播放速度、深色模式的视频资源样式、浅色模式下的视频资源样式、折叠壁纸的折叠速率、熄屏显示(always on display,AOD)样式等;资源中存储有深色模式下视频壁纸的视频和图片,和/或,浅色模式下视频壁纸的视频和图片等。1. Theme package: The theme package is a set of data packages that beautify the system or software interface. In the embodiment of this application, different wallpapers correspond to different theme packages, and the theme package may include three main files: livepaper.xml, livepaper_config.xml, and resources. Among them, the wallpaper service name is stored in livepaper.xml, and the wallpaper service can refer to a service (service) used to assist in realizing wallpaper display, etc.; the configuration file of the wallpaper is stored in livepaper_config.xml, and the configuration file includes one or more of the following Items: video frame number, video playback speed, video resource style in dark mode, video resource style in light mode, folding rate of folded wallpaper, always on display (AOD) style, etc.; resources are stored in Videos and pictures of video wallpapers in dark mode, and/or, videos and pictures of video wallpapers in light mode, etc.
2、动态壁纸:可以应用在终端设备从灭屏状态到亮屏状态的过程中,动态壁纸中可以包括动画,动画也可以理解为连续的多帧图片。例如,唤醒手机由灭屏状态到亮屏状态时,可以先播放动态壁纸中的动画,动画播放完成之后,手机再显示桌面内容。2. Dynamic wallpaper: It can be used in the process of the terminal device changing from the off-screen state to the on-screen state. The dynamic wallpaper can include animation, and the animation can also be understood as a continuous multi-frame picture. For example, when waking up the phone from the screen off state to the screen on state, the animation in the dynamic wallpaper can be played first. After the animation is played, the phone can then display the desktop content.
3、折叠壁纸:可以应用于折叠屏手机中,折叠屏壁纸可以包括多帧图片,折叠壁纸的播放可以与折叠屏手机的折叠角度有关。例如,折叠屏手机的角度可以是从0度到180度之间的值,可以为每个折叠角度对应一帧折叠壁纸中的图片,当折叠屏手机的折叠角度为A时,显示折叠壁纸中该角度A对应的图片。3. Folding wallpaper: It can be applied to folding screen mobile phones. Folding screen wallpapers can include multiple frames of pictures, and the playback of folding wallpapers can be related to the folding angle of folding screen mobile phones. For example, the angle of a folding screen mobile phone can be a value from 0 degrees to 180 degrees. Each folding angle can correspond to a frame of a picture in the folding wallpaper. When the folding angle of the folding screen mobile phone is A, the folding wallpaper is displayed. The picture corresponding to angle A.
4、超级壁纸:可以应用于AOD、锁屏界面、桌面间的显示衔接,超级壁纸中可以包括多段动画。例如,当手机由AOD切换到锁屏界面时,可以播放超级壁纸中的第一段动画,手机由锁屏界面切换到桌面时,可以播放超级壁纸中的第二段动画,手机由桌面切换到AOD时,可以播放超级壁纸中的第三段动画。可以理解的是,上述第一段、第二段、第三段仅表示三段动画之间可以为不同的动画,三段动画之间可以有联动的动画效果,不作为对动画播放顺序的限定。4. Super wallpaper: It can be applied to the display connection between AOD, lock screen interface and desktop. Super wallpaper can include multiple animations. For example, when the phone switches from AOD to the lock screen, the first animation in the super wallpaper can be played. When the phone switches from the lock screen to the desktop, the second animation in the super wallpaper can be played. When the phone switches from the desktop to the During AOD, the third animation in Super Wallpaper can be played. It can be understood that the above first, second and third paragraphs only mean that the three animations can be different animations, and there can be linked animation effects between the three animations. They do not limit the order of animation playback. .
5、浅色模式和深色模式:浅色模式(light)和深色模式(night)为两种不同的显示方式,两种模式主要涉及终端设备的屏幕显示颜色和亮度的不同。其中,浅色模式适用于较明亮的环境,浅色模式下的屏幕显示的颜色可以较浅、亮度较亮;深色模式适用于较黑暗的环境,深色模式下的屏幕显示的颜色可以较深、亮度较暗。5. Light mode and dark mode: Light mode (light) and dark mode (night) are two different display modes. The two modes mainly involve the difference in screen display color and brightness of the terminal device. Among them, the light mode is suitable for a brighter environment. The screen display in the light mode can have lighter colors and brighter brightness; the dark mode is suitable for a darker environment. The screen display in the dark mode can have lighter colors. Deeper and darker.
6、其他术语6. Other terms
在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一芯片和第二芯片仅仅是为了区分不同的芯片,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。In the embodiments of the present application, words such as “first” and “second” are used to distinguish identical or similar items with basically the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their sequence is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not limit the number and execution order.
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "such as" is not intended to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the words "exemplary" or "such as" is intended to present the concept in a concrete manner.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of this application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple .
7、终端设备7. Terminal equipment
本申请实施例的终端设备也可以为任意形式的电子设备,例如,电子设备可以包括具有图像处理功能的手持式设备、车载设备等。例如,一些电子设备为:手机(mobilephone)、平板电脑、掌上电脑、笔记本电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端、蜂窝电话、无绳电话、会话启动协议(session initiation protocol,SIP)电话、无线本地环路(wireless local loop,WLL)站、个人数字助理(personal digital assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备,5G网络中的终端设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端设备等,本申请实施例对此并不限定。The terminal device in the embodiment of the present application may also be any form of electronic device. For example, the electronic device may include a handheld device with an image processing function, a vehicle-mounted device, etc. For example, some electronic devices are: mobile phones, tablets, PDAs, laptops, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (Augmented) reality, AR) equipment, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grid Terminals, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) ) telephones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communications capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, Wearable devices, terminal devices in the 5G network or terminal devices in the future evolved public land mobile communication network (public land mobile network, PLMN), etc., are not limited in the embodiments of the present application.
作为示例而非限定,在本申请实施例中,该电子设备还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。As an example and not a limitation, in the embodiment of the present application, the electronic device may also be a wearable device. Wearable devices can also be called wearable smart devices. It is a general term for applying wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes, etc. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly defined wearable smart devices include full-featured, large-sized devices that can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, and those that only focus on a certain type of application function and need to cooperate with other devices such as smartphones. Use, such as various types of smart bracelets, smart jewelry, etc. for physical sign monitoring.
此外,在本申请实施例中,电子设备还可以是物联网(internet of things,IoT)系统中的终端设备,IoT是未来信息技术发展的重要组成部分,其主要技术特点是将物品通过通信技术与网络连接,从而实现人机互连,物物互连的智能化网络。In addition, in the embodiments of this application, the electronic device may also be a terminal device in the Internet of things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to transfer items through communication technology. Connect with the network to realize an intelligent network of human-computer interconnection and physical-object interconnection.
本申请实施例中的电子设备也可以称为:终端设备、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置等。The electronic equipment in the embodiment of the present application may also be called: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (mobile terminal, MT), access terminal, user unit, User station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
在本申请实施例中,电子设备或各个网络设备包括硬件层、运行在硬件层之上的操作系统层,以及运行在操作系统层上的应用层。该硬件层包括中央处理器(centralprocessing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。该操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。该应用层包含浏览器、通讯录、文字处理软件、即时通信软件等应用。In this embodiment of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. This hardware layer includes hardware such as central processing unit (CPU), memory management unit (MMU) and memory (also called main memory). The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system or windows operating system, etc. This application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
图1为本申请实施例提供的一种应用场景示意图。在图1对应的实施例中,以终端设备为折叠屏手机为例,进行示例说明,该示例并不构成对本申请实施例的限定。Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present application. In the embodiment corresponding to Figure 1, the terminal device is a folding screen mobile phone as an example for illustration. This example does not constitute a limitation on the embodiment of the present application.
如图1中的a所示,主界面上可以包括壁纸101、设置应用图标102等。当折叠屏手机接收到用户点击设置应用图标102的操作时,折叠屏手机的显示界面由主界面跳转至设置界面,设置界面如图1中的b所示。当折叠屏手机接收到用户点击桌面和壁纸设置项103的操作时,折叠屏手机的显示界面由设置界面跳转至桌面和壁纸界面,桌面和壁纸界面如图1中的c所示。当折叠屏手机接收到用户点击主题设置项104的操作时,由桌面和壁纸界面跳转至主题界面,主题界面如图1中的d所示。As shown in a in Figure 1, the main interface may include wallpaper 101, setting application icon 102, etc. When the folding screen mobile phone receives the operation of the user clicking on the setting application icon 102, the display interface of the folding screen mobile phone jumps from the main interface to the setting interface. The setting interface is shown as b in Figure 1. When the folding screen mobile phone receives the operation of the user clicking on the desktop and wallpaper setting item 103, the display interface of the folding screen mobile phone jumps from the setting interface to the desktop and wallpaper interface. The desktop and wallpaper interface is shown as c in Figure 1. When the folding screen mobile phone receives the operation of the user clicking on the theme setting item 104, it jumps from the desktop and wallpaper interface to the theme interface, as shown in d in Figure 1.
如图1中的d所示,主题界面中可以包括多个预先设置的壁纸,如命名为绽放的动态壁纸105、命名为泡沫的动态壁纸106、命名为冥想的折叠壁纸107以及命名为极限的超级壁纸108。需要说明的是,以上壁纸命名为示例说明,并不构成对本申请实施例的限定。As shown in d in Figure 1, the theme interface can include multiple preset wallpapers, such as a dynamic wallpaper named Bloom 105, a dynamic wallpaper named Bubbles 106, a folded wallpaper 107 named Meditation, and a named Limit. Super wallpaper 108. It should be noted that the above wallpaper names are examples and do not constitute a limitation on the embodiments of the present application.
可以理解的是,本申请实施例所指的壁纸可以包括锁屏界面显示的壁纸,也可以包括解锁后的主界面显示的壁纸。其中,壁纸可以为图片壁纸,也可以为视频壁纸。视频壁纸的视频可以包括风景视频、游戏录屏、电影片段等,视频壁纸的视频可以单次播放,也可以循环播放,当一个视频播放完后,可以按播放列表中视频的顺序,切换到下一个视频播放,本申请实施例对此不做具体限定。It can be understood that the wallpapers referred to in the embodiments of this application may include wallpapers displayed on the lock screen interface, and may also include wallpapers displayed on the home interface after unlocking. Among them, the wallpaper can be a picture wallpaper or a video wallpaper. The videos of the video wallpaper can include landscape videos, game screen recordings, movie clips, etc. The videos of the video wallpaper can be played once or in a loop. After a video is played, you can switch to the next video in the order of the videos in the playlist. A video is played, which is not specifically limited in the embodiment of this application.
一些实现中,在壁纸的开发过程中,由于不同壁纸对应的壁纸服务不能通用,每一代终端产品都需要重新开发壁纸,每套视频壁纸都需要定制壁纸服务,增大了壁纸服务的维护难度和壁纸项目体积,增加了人工成本,存在一定的风险。In some implementations, during the development process of wallpapers, because the wallpaper services corresponding to different wallpapers cannot be universal, each generation of terminal products needs to re-develop wallpapers, and each set of video wallpapers requires customized wallpaper services, which increases the difficulty and difficulty of maintaining wallpaper services. The size of the wallpaper project increases labor costs and involves certain risks.
有鉴于此,本申请实施例提供一种壁纸显示方法,该方法提供一种壁纸框架,壁纸框架能够根据壁纸的主题包,为该主题包适配壁纸服务,还能支持在用户更改壁纸导致壁纸类型发生变化时,自动切换到壁纸类型变化后对应的壁纸服务。这样,当壁纸资源改变时,不需要为每个壁纸都定制壁纸服务,简化了开发流程,节省了人力成本。In view of this, embodiments of the present application provide a wallpaper display method, which provides a wallpaper framework. The wallpaper framework can adapt wallpaper services to the theme package according to the theme package of the wallpaper, and can also support the wallpaper caused by the user changing the wallpaper. When the type changes, it will automatically switch to the corresponding wallpaper service after the wallpaper type changes. In this way, when wallpaper resources change, there is no need to customize wallpaper services for each wallpaper, which simplifies the development process and saves labor costs.
示例性的,图2示出了电子设备100的结构示意图。For example, FIG. 2 shows a schematic structural diagram of the electronic device 100.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light. Sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or Universal serial bus (USB) interface, etc.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。The display screen 194 is used to display images, videos, etc. Display 194 includes a display panel.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。Internal memory 121 may be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。本申请实施例中,终端设备的深色模式和浅色模式可以基于环境光传感器180L实现。The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. In this embodiment of the present application, the dark mode and light mode of the terminal device can be implemented based on the ambient light sensor 180L.
指纹传感器180H用于采集指纹。温度传感器180J用于检测温度。触摸传感器180K,也称“触控器件”。骨传导传感器180M可以获取振动信号。Fingerprint sensor 180H is used to collect fingerprints. Temperature sensor 180J is used to detect temperature. Touch sensor 180K, also known as "touch device". Bone conduction sensor 180M can acquire vibration signals.
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. This embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
图3为本申请实施例提供的一种电子设备的软件架构示意图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。FIG. 3 is a schematic diagram of the software architecture of an electronic device provided by an embodiment of the present application. The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime (Android runtime) and system libraries, and kernel layer.
应用程序层可以包括一系列应用程序包(android application package,APK)。如图3所示,应用程序包可以包括相机,图库,日历,通话,WLAN,蓝牙,视频,短信,主题,熄屏显示,壁纸服务模块,服务调起模块等应用程序。可以理解的是,主题的应用程序、熄屏显示的应用程序、壁纸服务模块的应用程序、服务调起模块的应用程序可以单独存在,也可以为应用程序层中任意的应用程序的一部分,例如,壁纸服务模块可以存在于主题应用程序中,本申请实施例对此不作具体限定。The application layer can include a series of application packages (android application packages, APKs). As shown in Figure 3, the application package can include applications such as camera, gallery, calendar, call, WLAN, Bluetooth, video, text message, theme, screen-off display, wallpaper service module, service calling module, etc. It can be understood that the theme application, the screen-off display application, the wallpaper service module application, and the service calling module application can exist independently, or can be part of any application in the application layer, for example , the wallpaper service module may exist in the theme application, and the embodiment of the present application does not specifically limit this.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图3所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器,壁纸框架模块,系统界面模块等。As shown in Figure 3, the application framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, wallpaper framework module, system interface module, etc.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make this data accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls that display text, controls that display pictures, etc. A view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide communication functions of the electronic device 100 . For example, call status management (including connected, hung up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
壁纸框架模块用于根据用户选择的壁纸标识,判断用户选择的壁纸标识对应的壁纸服务名称与当前运行的壁纸服务对应的壁纸服务名称是否相同。The wallpaper framework module is used to determine, based on the wallpaper identification selected by the user, whether the wallpaper service name corresponding to the wallpaper identification selected by the user is the same as the wallpaper service name corresponding to the currently running wallpaper service.
系统界面模块用于读取存储于数据库中的壁纸配置文件,根据配置文件判断是否配置AOD、锁屏透明等。The system interface module is used to read the wallpaper configuration file stored in the database, and determine whether to configure AOD, lock screen transparency, etc. based on the configuration file.
安卓运行时Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime Android Runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and application framework layer into binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。System libraries can include multiple functional modules. For example: surface manager, media libraries, three-dimensional graphics processing library (for example: OpenGL ES), two-dimensional graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D Graphics Engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
示例性的,结合图3,图4示出了本申请实施例的一种具体的壁纸显示方法的各模块交互图。如图4所示,具体步骤如下:Exemplarily, in conjunction with Figure 3, Figure 4 shows an interaction diagram of each module of a specific wallpaper display method according to the embodiment of the present application. As shown in Figure 4, the specific steps are as follows:
S401、终端设备接收到用户对设置应用中主题设置项的操作。S401. The terminal device receives the user's operation on the theme setting item in the setting application.
用户可以按照如图1所示的方式,对设置应用中的主题设置项进行操作,此处不再赘述。The user can operate the theme setting items in the settings application as shown in Figure 1, which will not be described again here.
可能的实现中,主题设置项中可以包括多个壁纸的标识,每个壁纸的标识可以对应一个壁纸的主题包。终端设备接收到用户对某一壁纸的标识的触发时,可以基于服务调起模块获取该壁纸的标识对应的主题包。其中,主题包的文件格式本申请实施例不作具体限定。In a possible implementation, the theme setting item may include the identifiers of multiple wallpapers, and each wallpaper identifier may correspond to a wallpaper theme package. When the terminal device receives the user's trigger for the identification of a certain wallpaper, it can obtain the theme package corresponding to the identification of the wallpaper based on the service calling module. The file format of the theme package is not specifically limited in this embodiment of the application.
可能的实现中,主题包可以是以压缩形式存储的,这样可以节约存储空间。当然,主题包也可以不压缩存储,本申请实施例对此不作具体限定。In a possible implementation, the theme package can be stored in a compressed form, which can save storage space. Of course, the theme package may also be stored without compression, which is not specifically limited in the embodiments of this application.
S402、服务调起模块解压主题包到data/themes/0目录,得到三个主要文件。S402. The service call module decompresses the theme package to the data/themes/0 directory and obtains three main files.
以主题包以压缩形式存储为例,服务调起模块可以解压主题包,并将解压后的主题包存储于终端设备的data/themes/0目录中。解压后的主题包可以包括livepaper.xml、livepaper_config.xml和资源三个主要文件。Taking the theme package stored in compressed form as an example, the service calling module can decompress the theme package and store the decompressed theme package in the data/themes/0 directory of the terminal device. The decompressed theme package can include three main files: livepaper.xml, livepaper_config.xml and resources.
S403、服务调起模块从livepaper.xml解析得到壁纸服务名称,通过壁纸管理服务(wallpaper manager service,WMS)启动该服务。S403. The service calling module parses livepaper.xml to obtain the wallpaper service name, and starts the service through wallpaper manager service (WMS).
其中,壁纸服务名称可以包括三种:超级壁纸服务(dynamic wallpaperservice)、动态壁纸服务(dynamic wallpaper service)、折叠壁纸服务(foldablewallpaper service)。WMS可以根据解析到的壁纸服务名称启动对应的壁纸服务。The wallpaper service names may include three types: super wallpaper service (dynamic wallpaper service), dynamic wallpaper service (dynamic wallpaper service), and foldable wallpaper service (foldable wallpaper service). WMS can start the corresponding wallpaper service based on the resolved wallpaper service name.
示例性的,WMS根据解析到的壁纸服务名称启动对应的壁纸服务可以基于下述的S404-S406实现。For example, WMS can start the corresponding wallpaper service based on the parsed wallpaper service name based on the following S404-S406.
S404、服务调起模块通过WMS判断壁纸服务名称是否相同。S404. The service calling module determines whether the wallpaper service names are the same through WMS.
WMS根据解析得到的壁纸服务名称,判断用户选择的壁纸标识对应的壁纸服务名称与当前运行的壁纸服务对应的壁纸服务名称是否相同。可以理解的是,当前运行的壁纸服务可以指终端设备接收到用户对某一壁纸的标识的触发时,终端设备运行的壁纸服务。Based on the wallpaper service name obtained through analysis, WMS determines whether the wallpaper service name corresponding to the wallpaper logo selected by the user is the same as the wallpaper service name corresponding to the currently running wallpaper service. It can be understood that the currently running wallpaper service may refer to the wallpaper service run by the terminal device when the terminal device receives a trigger of the user's identification of a certain wallpaper.
S405、在用户选择的壁纸标识对应的壁纸服务名称与当前运行的壁纸服务对应的壁纸服务名称为同一个壁纸服务名称的情况下,WMS发送android wallpaper reapply指令至APK。S405. When the wallpaper service name corresponding to the wallpaper logo selected by the user and the wallpaper service name corresponding to the currently running wallpaper service are the same wallpaper service name, WMS sends the android wallpaper reapply instruction to the APK.
如果用户选择的壁纸标识对应的壁纸服务名称,与当前运行的壁纸服务对应的壁纸服务名称相同,WMS向APK中正在运行的壁纸服务发送android wallpaper reapply指令。其中,android wallpaper reapply指令用于指示壁纸服务更新壁纸配置及壁纸资源,将壁纸配置和壁纸资源更新为用户选择的壁纸标识对应的壁纸配置和壁纸资源。If the wallpaper service name corresponding to the wallpaper logo selected by the user is the same as the wallpaper service name corresponding to the currently running wallpaper service, WMS sends the android wallpaper reapply instruction to the wallpaper service running in the APK. Among them, the android wallpaper reapply instruction is used to instruct the wallpaper service to update the wallpaper configuration and wallpaper resources, and update the wallpaper configuration and wallpaper resources to the wallpaper configuration and wallpaper resources corresponding to the wallpaper identification selected by the user.
S406、APK中的壁纸服务收到指令。S406. The wallpaper service in the APK receives the instruction.
APK中正在运行的壁纸服务收到android wallpaper reapply指令,壁纸服务基于该指令从data/themes/0目录中获取与用户选择的壁纸标识对应的壁纸配置及资源。The wallpaper service running in the APK receives the android wallpaper reapply command. Based on this command, the wallpaper service obtains the wallpaper configuration and resources corresponding to the wallpaper logo selected by the user from the data/themes/0 directory.
S407、壁纸服务更新配置及资源。S407. Wallpaper service updates configuration and resources.
可能的实现中,壁纸服务获取到与用户选择的壁纸标识对应的壁纸配置及资源后,在数据库中更新壁纸配置及资源。In a possible implementation, after the wallpaper service obtains the wallpaper configuration and resources corresponding to the wallpaper identification selected by the user, it updates the wallpaper configuration and resources in the database.
S408、系统界面模块的StatusBar监听数据库。S408. The StatusBar of the system interface module monitors the database.
由于壁纸的配置和资源更新,数据库中存储的信息会发生变化。可以通过StatusBar监听数据库的变化。本申请实施例中,StatusBar可以理解为SystemUI的总入口。Due to wallpaper configuration and resource updates, the information stored in the database will change. Database changes can be monitored through StatusBar. In the embodiment of this application, StatusBar can be understood as the general entrance of SystemUI.
当StatusBar监听到数据库中存储的信息发生变化时,StatusBar可以从数据库中提取对应的资源文件和配置文件,根据用户选择的壁纸标识对应的服务进行配置。When StatusBar detects changes in the information stored in the database, StatusBar can extract the corresponding resource files and configuration files from the database, and configure them according to the services corresponding to the wallpaper logo selected by the user.
其中,配置的内容可以包括:AOD相关aod_switchstyle_name;锁屏图片lock_image_path;手机模式相关new_simple_mode等。Among them, the configuration content may include: AOD-related aod_switchstyle_name; lock screen image lock_image_path; mobile phone mode-related new_simple_mode, etc.
S409、系统界面模块判断壁纸服务是否支持实现锁屏透明。S409. The system interface module determines whether the wallpaper service supports lock screen transparency.
以手机为例,在一些实现中,手机可以支持锁屏透明,锁屏透明可以理解为:手机接收到用户上滑锁屏界面的操作后,手机的界面可以显示解锁界面,解锁界面可以包括图案解锁界面、个人身份识别码(personal identification number,PIN)解锁界面或密码解锁界面等,解锁界面的背景可以是模糊的透明或半透明背景。Take mobile phones as an example. In some implementations, mobile phones can support lock screen transparency. Lock screen transparency can be understood as: after the mobile phone receives the user's operation of sliding up the lock screen interface, the mobile phone's interface can display the unlock interface, and the unlock interface can include patterns. Unlocking interface, personal identification number (PIN) unlocking interface or password unlocking interface, etc. The background of the unlocking interface can be a blurry transparent or translucent background.
本申请实施例中,锁屏透明可以是动态的锁屏透明。动态的锁屏透明可以指手机接收到用户上滑锁屏界面的操作显示解锁界面后,解锁界面的背景为模糊的动态壁纸。In this embodiment of the present application, the lock screen transparency may be dynamic lock screen transparency. Dynamic lock screen transparency can mean that after the mobile phone receives the user's operation of sliding up the lock screen to display the unlock interface, the background of the unlock interface is a blurred dynamic wallpaper.
壁纸服务是否支持实现锁屏透明与终端设备芯片的能力有关,例如,可以通过用于控制锁屏透明的开关控制是否开启锁屏透明。一些终端设备的芯片不具备支持锁屏透明的能力,默认控制锁屏透明的开关关闭,终端设备不能实现锁屏透明;一些终端设备的芯片具备支持锁屏透明的能力,默认控制锁屏透明的开关打开,终端设备可以实现锁屏透明。壁纸服务是否支持实现锁屏透明还可以与壁纸支持的动画效果有关。例如,壁纸服务均为动态壁纸服务的两种壁纸,一种壁纸可以支持实现锁屏透明的上滑场景,一种壁纸不可以支持实现锁屏透明的上滑场景。Whether the wallpaper service supports lock screen transparency is related to the capability of the terminal device chip. For example, you can control whether to turn on lock screen transparency through the switch used to control lock screen transparency. The chips of some terminal devices do not have the ability to support lock screen transparency. The switch that controls the lock screen transparency is turned off by default, and the terminal device cannot achieve lock screen transparency. The chips of some terminal devices have the ability to support lock screen transparency. The switch that controls the lock screen transparency is turned off by default. When the switch is turned on, the terminal device can achieve transparent lock screen. Whether the wallpaper service supports lock screen transparency may also be related to the animation effects supported by the wallpaper. For example, the wallpaper service is two kinds of wallpapers of the dynamic wallpaper service. One wallpaper can support the sliding up scene of the lock screen being transparent, and the other wallpaper cannot support the sliding up scene of the lock screen being transparent.
S410、在壁纸服务支持锁屏透明的情况下,系统界面模块判断从壁纸复制图片到锁屏是否复制成功。S410. When the wallpaper service supports the lock screen transparency, the system interface module determines whether the image copied from the wallpaper to the lock screen is successfully copied.
可能的实现中,如果读写文件的IO(Input/Output)流出现错误或者data/themes/0目录中没有可供复制的图片,可能出现从壁纸复制图片到锁屏复制失败的情况。如果从壁纸复制图片到锁屏失败,此时锁屏透明的效果为静态的锁屏透明,锁屏界面的背景为静态壁纸。In a possible implementation, if there is an error in the IO (Input/Output) stream of reading and writing files or there are no images available for copying in the data/themes/0 directory, copying images from wallpaper to lock screen may fail. If copying the picture from the wallpaper to the lock screen fails, the lock screen transparency effect will be static lock screen transparency, and the background of the lock screen interface will be static wallpaper.
可能的实现中,如果从壁纸复制图片到锁屏成功,可以设置图片的透明度,例如将图片都设置为0,此时图片对应于全透明状态;启动一个窗口,对窗口进行高斯模糊,将高斯模糊后的窗口覆盖于图片上,再将图片覆盖于解锁界面的壁纸上,用户通过模糊的透明图片可以看到动态的壁纸,实现动态的锁屏透明场景。In a possible implementation, if the picture is copied from the wallpaper to the lock screen successfully, the transparency of the picture can be set, for example, setting all pictures to 0, at which time the picture corresponds to the fully transparent state; start a window, perform Gaussian blur on the window, and apply Gaussian blur to the window. The blurred window is overlaid on the picture, and then the picture is overlaid on the wallpaper of the unlock interface. The user can see the dynamic wallpaper through the blurred transparent picture, realizing a dynamic lock screen transparent scene.
S411、在复制图片成功的情况下,系统界面模块中的AppHandler发送壁纸服务变化新消息。S411. When the picture is copied successfully, the AppHandler in the system interface module sends a new message about changes to the wallpaper service.
本申请实施例中,AppHandler可以用于传递壁纸服务相关的数据信息。根据步骤S409-S410,在壁纸服务支持锁屏透明且从壁纸服务图片到锁屏成功的情况下,AppHandler可以发送壁纸服务新消息,壁纸服务变化新消息用于通知SystemUI运行锁屏相关业务、更新锁屏界面。In the embodiment of this application, AppHandler can be used to transfer data information related to the wallpaper service. According to steps S409-S410, when the wallpaper service supports lock screen transparency and the transfer from the wallpaper service picture to the lock screen is successful, the AppHandler can send a new wallpaper service message, and the new wallpaper service change message is used to notify SystemUI to run lock screen related services and updates. Lock screen interface.
S412、SystemUI运行锁屏相关业务。S412, SystemUI runs lock screen related services.
SystemUI可以为系统提供显示界面,比如锁屏界面,充电界面,状态栏,导航栏,多任务栏等。锁屏相关业务可以包括:锁屏透明、动态的锁屏壁纸等。SystemUI can provide display interfaces for the system, such as lock screen interface, charging interface, status bar, navigation bar, multi-tasking bar, etc. Lock screen related services can include: lock screen transparency, dynamic lock screen wallpaper, etc.
本申请实施例中,基于AppHandler发送的动态壁纸服务变化新消息,SystemUI可以运行锁屏透明等锁屏业务。In the embodiment of this application, based on the new dynamic wallpaper service change message sent by AppHandler, SystemUI can run lock screen services such as lock screen transparency.
可以理解的是,步骤S404-S407可以与步骤S408-S412同步进行,不限定顺序。It can be understood that steps S404-S407 can be performed synchronously with steps S408-S412, and the order is not limited.
这样,当壁纸服务不变、壁纸资源、配置等发生改变时,终端设备可以基于壁纸改变前运行的壁纸服务显示改变后的壁纸,壁纸服务无需改变,简化了壁纸开发流程、提升了壁纸开发效率、节约了存储空间和人力成本。In this way, when the wallpaper service remains unchanged and wallpaper resources and configurations change, the terminal device can display the changed wallpaper based on the wallpaper service running before the wallpaper change. The wallpaper service does not need to be changed, which simplifies the wallpaper development process and improves wallpaper development efficiency. , saving storage space and labor costs.
当然,在用户选择新的壁纸时,壁纸的服务也可以发生变化,例如,用户选择新的壁纸前,终端设备运行的壁纸服务为动态壁纸,用户选择的壁纸为折叠壁纸或超级壁纸,此时壁纸的服务发生变化。Of course, when the user selects a new wallpaper, the wallpaper service can also change. For example, before the user selects a new wallpaper, the wallpaper service running on the terminal device is dynamic wallpaper, and the wallpaper selected by the user is folded wallpaper or super wallpaper. At this time, Wallpaper service changes.
示例性的,结合图3,图5示出了本申请实施例的另一种具体的壁纸显示方法的各模块交互图。如图5所示,具体步骤如下:Exemplarily, in conjunction with Figure 3, Figure 5 shows an interaction diagram of each module of another specific wallpaper display method according to the embodiment of the present application. As shown in Figure 5, the specific steps are as follows:
S501、终端设备接收到用户对设置应用中主题设置项的操作。S501. The terminal device receives the user's operation on the theme setting item in the setting application.
S502、服务调起模块解压主题包到data/themes/0目录,得到三个主要文件。S502. The service call module decompresses the theme package to the data/themes/0 directory and obtains three main files.
S503、服务调起模块从livepaper.xml解析得到壁纸服务名称,通过WMS启动该服务。S503. The service calling module parses livepaper.xml to obtain the wallpaper service name, and starts the service through WMS.
示例性的,WMS根据解析到的壁纸服务名称启动对应的壁纸服务可以基于下述的S504-S506实现。For example, WMS starts the corresponding wallpaper service based on the parsed wallpaper service name, which can be implemented based on the following S504-S506.
S504、服务调起模块通过WMS判断壁纸服务名称是否相同。S504. The service calling module determines whether the wallpaper service names are the same through WMS.
步骤S501-S504的具体描述可以参照对步骤S401-S404的描述,此处不再赘述。For detailed description of steps S501-S504, reference may be made to the description of steps S401-S404, which will not be described again here.
S505、在用户选择的壁纸标识对应的壁纸服务名称与当前运行的壁纸服务对应的壁纸服务名称为不同壁纸服务名称的情况下,WMS绑定(bind)新服务。S505. When the wallpaper service name corresponding to the wallpaper logo selected by the user and the wallpaper service name corresponding to the currently running wallpaper service are different wallpaper service names, WMS binds the new service.
由于用户选择的壁纸标识对应的壁纸服务名称与当前运行的壁纸服务对应的壁纸服务名称不同,WMS准备启动新的壁纸服务,新的壁纸服务即用户选择的壁纸标识对应的壁纸服务。Since the wallpaper service name corresponding to the wallpaper ID selected by the user is different from the wallpaper service name corresponding to the currently running wallpaper service, WMS is preparing to start a new wallpaper service. The new wallpaper service is the wallpaper service corresponding to the wallpaper ID selected by the user.
S506、壁纸服务模块启动壁纸服务。S506. The wallpaper service module starts the wallpaper service.
壁纸服务模块通过调用onCreate函数开始壁纸的生命周期,启动新的壁纸服务。The wallpaper service module starts the wallpaper life cycle by calling the onCreate function and starts a new wallpaper service.
S507、壁纸服务模块通过注册监听深色/浅色模式。S507, the wallpaper service module monitors the dark/light mode through registration.
注册主要包括注册传感器和监听器。监听器可以包括:深色模式和浅色模式的监听器、用户切换的监听器、简易模式的监听器、折叠壁纸场景下折叠角度的监听器等。Registration mainly includes registering sensors and listeners. Listeners can include: dark mode and light mode listeners, user switching listeners, simple mode listeners, folding angle listeners in folding wallpaper scenes, etc.
例如,壁纸服务模块注册深色模式和浅色模式的监听器后,当监听器监听到终端设备的显示模式由深色模式切换为浅色模式时,通知壁纸服务针对深色模式切换为浅色模式这一事件进行处理,将深色的视频资源更新为浅色的视频资源。For example, after the wallpaper service module registers the listeners for dark mode and light mode, when the listener detects that the display mode of the terminal device is switched from dark mode to light mode, it notifies the wallpaper service to switch to light mode for dark mode. Mode event is processed and the dark video resources are updated to light video resources.
S508、壁纸服务模块解析livepaper_config.xml。S508. The wallpaper service module parses livepaper_config.xml.
壁纸服务模块根据现机主用户解析data/themes/0目录下的livepaper_config.xml,得到livepaper_config.xml下存储的配置文件,如视频帧数、视频播放速度、深色模式的视频资源样式、浅色模式的视频资源样式等。The wallpaper service module parses the livepaper_config.xml in the data/themes/0 directory according to the current host user, and obtains the configuration file stored under livepaper_config.xml, such as the number of video frames, video playback speed, dark mode video resource style, light color Mode video resource style, etc.
可以理解的是,步骤S508和步骤S509之间没有先后,不限定顺序。It can be understood that there is no sequence between step S508 and step S509, and the order is not limited.
S509、壁纸服务模块校验配置文件。S509. The wallpaper service module verifies the configuration file.
壁纸服务模块校验解析得到的配置文件的准确性、判断配置文件是否异常。The wallpaper service module verifies the accuracy of the parsed configuration file and determines whether the configuration file is abnormal.
如果配置文件错误,例如一个视频壁纸的视频帧数为1秒钟60帧,解析得到的视频壁纸的视频帧数为0帧,可以认为配置文件出现异常,结束壁纸服务流程。If the configuration file is wrong, for example, the video frame number of a video wallpaper is 60 frames per second, and the video frame number of the parsed video wallpaper is 0 frames, it can be considered that the configuration file is abnormal and the wallpaper service process ends.
S510、壁纸服务模块解析配置文件,转换为代码可用的配置。S510, the wallpaper service module parses the configuration file and converts it into a configuration usable by the code.
当校验配置文件的结果为正确后,壁纸服务模块通过解析配置文件将配置文件转换为代码可识别的配置文件,这一过程也可以称为配置文件代码化。When the result of verifying the configuration file is correct, the wallpaper service module converts the configuration file into a code-recognizable configuration file by parsing the configuration file. This process can also be called configuration file coding.
进一步的,壁纸服务模块可以根据壁纸资源的路径获取对应的资源。壁纸资源的路径可以包括视频资源的路径和图片资源的路径。其中,视频资源的路径分为深色模式下视频资源的路径和浅色模式下视频资源的路径;图片资源的路径可以包括锁屏时的锁屏图片的路径,分为深色模式下图片资源的路径和浅色模式下图片资源的路径。同时,壁纸服务模块可以授予系统用户界面SystemUI读取图片资源路径的权限。Further, the wallpaper service module can obtain the corresponding resources according to the path of the wallpaper resources. The path of wallpaper resources can include the path of video resources and the path of picture resources. Among them, the path of video resources is divided into the path of video resources in dark mode and the path of video resources in light mode; the path of image resources can include the path of the lock screen image when locking the screen, which is divided into the path of image resources in dark mode. The path and the path of the image resource in light mode. At the same time, the wallpaper service module can grant the system user interface SystemUI the permission to read the image resource path.
S511、壁纸服务模块初始化壁纸播放实现策略。S511. The wallpaper service module initializes the wallpaper playback implementation strategy.
本申请实施例中,壁纸播放实现策略与媒体播放器media palyer相关,传统的media palyer可以支持按时间播放的策略,但不能支持逐帧播放的策略。本申请实施例中,通过mediacodec与物理弹性动画SpringAnimation结合,初始化壁纸播放实现策略以实现逐帧播放的壁纸播放策略。In the embodiment of this application, the wallpaper playback implementation strategy is related to the media player. The traditional media player can support the time-based playback strategy, but cannot support the frame-by-frame playback strategy. In the embodiment of this application, the wallpaper playback implementation strategy is initialized by combining mediacodec with the physical elastic animation SpringAnimation to implement the wallpaper playback strategy of frame-by-frame playback.
S512、壁纸服务模块将配置写入数据库。S512. The wallpaper service module writes the configuration into the database.
基于步骤S508-S511,壁纸服务模块通过解析livepaper_config.xml,获得壁纸资源的路径,壁纸服务模块根据壁纸资源的路径获取壁纸资源,将获取到的壁纸资源及壁纸配置文件写入存储于data/themes/0目录下的数据库中。Based on steps S508-S511, the wallpaper service module obtains the path of the wallpaper resource by parsing livepaper_config.xml. The wallpaper service module obtains the wallpaper resource according to the path of the wallpaper resource, and writes the obtained wallpaper resource and wallpaper configuration file into data/themes. /0 directory in the database.
S513、壁纸服务模块初始化壁纸界面。S513. The wallpaper service module initializes the wallpaper interface.
壁纸服务模块根据数据库的配置初始化壁纸界面。可能的实现中,在初始化壁纸界面时,手机显示界面可以弹出toast消息弹窗,用于提示用户:手机正在进行壁纸界面的初始化。The wallpaper service module initializes the wallpaper interface according to the configuration of the database. In a possible implementation, when initializing the wallpaper interface, a toast message pop-up window can pop up on the mobile phone display interface to remind the user that the mobile phone is initializing the wallpaper interface.
S514、系统界面模块的StatusBar收到壁纸服务变化广播。S514. The StatusBar of the system interface module receives the wallpaper service change broadcast.
由于用户选择的壁纸标识对应的壁纸服务类型与当前运行的壁纸服务不同,壁纸服务发生改变,StatusBar收到壁纸服务变化广播。Since the wallpaper service type corresponding to the wallpaper logo selected by the user is different from the currently running wallpaper service, the wallpaper service changes and the StatusBar receives the wallpaper service change broadcast.
S515、系统界面模块默认初始化为静态壁纸类型。S515. The system interface module is initialized to the static wallpaper type by default.
由于系统界面模块与壁纸服务模块并行运行,壁纸服务模块中的数据库配置写入可能有延迟情况发生,系统界面模块不能及时获知变化后的壁纸服务类型,为保证程序的顺利运行,可以先默认初始化为静态壁纸类型。Since the system interface module and the wallpaper service module run in parallel, there may be a delay in writing the database configuration in the wallpaper service module. The system interface module cannot learn the changed wallpaper service type in time. To ensure the smooth operation of the program, it can be initialized by default first. It is a static wallpaper type.
S516、系统界面模块判断Wallpaperinfo是否为空。S516. The system interface module determines whether Wallpaperinfo is empty.
本申请实施例中,Wallpaperinfo为空代表壁纸服务变化广播为静态壁纸广播,Wallpaperinfo不为空,代表壁纸服务变化广播不是静态壁纸广播。In the embodiment of this application, if Wallpaperinfo is empty, it means that the wallpaper service change broadcast is a static wallpaper broadcast. If Wallpaperinfo is not empty, it means that the wallpaper service change broadcast is not a static wallpaper broadcast.
S517、当Wallpaperinfo不为空时,系统界面模块判断壁纸meta数据是否有livewallpaper配置,并为数据库的live_wallpaper_effect赋值。S517. When Wallpaperinfo is not empty, the system interface module determines whether the wallpaper meta data has a livewallpaper configuration, and assigns a value to the live_wallpaper_effect of the database.
其中,livewallpaper配置用于表示壁纸是否支持缩放。缩放可以指当手机接收到用户解锁手机的操作后,手机界面由锁屏界面切换到桌面、锁屏界面显示的壁纸切换至桌面显示的壁纸时,壁纸的大小可以发生改变,例如锁屏界面的壁纸切换至桌面的壁纸时有1.1倍渐变至1.0倍的动效。Among them, the livewallpaper configuration is used to indicate whether the wallpaper supports scaling. Zooming can mean that when the phone receives the user's operation to unlock the phone, the phone interface switches from the lock screen interface to the desktop, and the wallpaper displayed on the lock screen interface switches to the wallpaper displayed on the desktop, the size of the wallpaper can change, such as the lock screen interface. When the wallpaper is switched to the desktop wallpaper, there is a 1.1x gradient to 1.0x animation.
由于视频壁纸不支持缩放的动效,当壁纸为视频壁纸时,即壁纸为超级壁纸、折叠壁纸、动态壁纸中的任意一种时,数据库写值live_wallpaper_effect:0,表示不支持缩放;当壁纸为除视频壁纸以外的其他壁纸时,数据库写值live_wallpaper_effect:1,表示支持缩放。Since the video wallpaper does not support the animation effect of zooming, when the wallpaper is a video wallpaper, that is, when the wallpaper is any one of super wallpaper, folding wallpaper, and dynamic wallpaper, the database writes the value live_wallpaper_effect: 0, indicating that zooming is not supported; when the wallpaper is When using wallpapers other than video wallpapers, the database writes the value live_wallpaper_effect: 1, indicating that scaling is supported.
S518、系统界面模块判断壁纸服务是否支持实现锁屏透明。S518. The system interface module determines whether the wallpaper service supports lock screen transparency.
S519、在壁纸服务支持锁屏透明的情况下,系统界面模块判断从壁纸复制图片到锁屏是否复制成功。S519. When the wallpaper service supports the lock screen transparency, the system interface module determines whether the image copied from the wallpaper to the lock screen is successfully copied.
步骤S518-S519的具体描述可以参考步骤S409-S410的描述,此处不再赘述。For detailed description of steps S518-S519, reference may be made to the description of steps S409-S410, which will not be described again here.
S520、系统界面模块判断终端设备是否使用归一壁纸方案开关。S520: The system interface module determines whether the terminal device uses the normalized wallpaper scheme switch.
其中,本申请实施例提供的壁纸显示方法也可以称为归一壁纸方案,系统界面模块根据终端设备的系统版本判断终端设备是否支持使用归一壁纸方案。例如,系统版本为7.0及以上的终端设备可以支持归一壁纸方案,则打开归一壁纸方案开关;系统版本为7.0以下的终端设备不可以支持归一壁纸方案,则关闭归一壁纸方案开关。Among them, the wallpaper display method provided by the embodiment of the present application can also be called the normalized wallpaper solution. The system interface module determines whether the terminal device supports the use of the normalized wallpaper solution according to the system version of the terminal device. For example, if a terminal device with a system version of 7.0 or above can support the unified wallpaper solution, turn on the unified wallpaper solution switch; if a terminal device with a system version of 7.0 or below cannot support the unified wallpaper solution, turn off the normalized wallpaper solution switch.
如果终端设备打开归一壁纸方案的开关,终端设备可以从数据库中复制图片,获取锁屏图片。如果终端设备关闭归一壁纸方案开关,终端设备可以从meta-data中获取锁屏图片。If the terminal device turns on the switch of the unified wallpaper scheme, the terminal device can copy the image from the database to obtain the lock screen image. If the terminal device turns off the normalized wallpaper scheme switch, the terminal device can obtain the lock screen image from meta-data.
S521、判断终端设备是否支持配置熄屏显示。S521. Determine whether the terminal device supports configuration of screen-off display.
熄屏显示是指当手机处于锁定状态时,不用点亮屏幕,一些重要信息可以始终显示在手机上。例如,屏幕部分区域可以显示时间、来电、消息、电池信息、推送消息等内容,用户可以直观看到需要的信息,减少用户操作手机的步骤。超级壁纸可以支持AOD功能。Screen-off display means that when the phone is locked, some important information can always be displayed on the phone without turning on the screen. For example, some areas of the screen can display time, incoming calls, messages, battery information, push messages, etc. Users can intuitively see the information they need, reducing the number of steps for users to operate their phones. Super wallpaper can support AOD function.
可能的实现中,如果壁纸不支持配置AOD,说明该壁纸不是超级壁纸,此时需清空超级壁纸相关配置,并接管power灭屏属性。其中,power灭屏属性可以指终端设备接收到用户对power键的操作时,屏幕直接由亮屏状态切换至灭屏状态,亮屏状态切换至灭屏状态的过程中不再提供熄屏显示服务。In a possible implementation, if the wallpaper does not support the configuration of AOD, it means that the wallpaper is not a super wallpaper. At this time, the relevant configuration of the super wallpaper needs to be cleared and the power screen off attribute is taken over. Among them, the power screen-off attribute can mean that when the terminal device receives the user's operation of the power key, the screen directly switches from the on-screen state to the off-screen state. During the process of switching the on-screen state to the off-screen state, the screen-off display service is no longer provided. .
S522、配置超级壁纸动画时长、AOD样式、锁屏图片。S522. Configure super wallpaper animation duration, AOD style, and lock screen image.
如果壁纸支持配置AOD,说明该壁纸为超级壁纸,为超级壁纸配置动画时长、AOD样式、锁屏图片。If the wallpaper supports configuring AOD, it means that the wallpaper is a super wallpaper. Configure the animation duration, AOD style, and lock screen image for the super wallpaper.
其中,AOD样式可以包括AOD的显示内容、AOD的动画效果等。Among them, the AOD style may include AOD display content, AOD animation effects, etc.
S523、BackDrop界面设置透明。S523 and BackDrop interface settings are transparent.
当终端设备接收到用户向上滑动终端设备锁屏界面的操作时,终端设备可以显示解锁界面,BackDrop界面设置透明可以用于解锁界面的背景模糊显示,以实现锁屏透明的功能。When the terminal device receives the user's operation of sliding up the lock screen interface of the terminal device, the terminal device can display the unlock interface. The BackDrop interface setting transparency can be used to blur the background of the unlock interface to achieve the lock screen transparent function.
S524、AppHandler发送动态壁纸服务变化新消息。S524. AppHandler sends a new message about changes in the dynamic wallpaper service.
S525、SystemUI运行锁屏相关业务。S525, SystemUI runs lock screen related services.
步骤S524-S525的具体描述可以参考步骤S411-S412的描述,此处不再赘述。可以理解的是,步骤S504-S513可以与步骤S514-S523同步进行,不限定顺序。For detailed description of steps S524-S525, reference may be made to the description of steps S411-S412, which will not be described again here. It can be understood that steps S504-S513 can be performed synchronously with steps S514-S523, and the order is not limited.
上面图4和图5说明了基于本申请实施例的壁纸框架实现的壁纸配置更新相关流程,在壁纸配置完成后,在一些场景中可以结合本申请提供的壁纸配置实现壁纸显示。示例性的,图6A和图6B为本申请实施例提供的折叠壁纸显示的实现流程示意图。图7为结合AOD的壁纸显示实现流程示意图。Figures 4 and 5 above illustrate the related processes of wallpaper configuration update implemented based on the wallpaper framework of the embodiment of the present application. After the wallpaper configuration is completed, wallpaper display can be implemented in some scenarios in combination with the wallpaper configuration provided by the present application. Exemplarily, FIG. 6A and FIG. 6B are schematic flow diagrams of the implementation of folding wallpaper display provided by embodiments of the present application. Figure 7 is a schematic diagram of the implementation process of wallpaper display combined with AOD.
如图6A所示,折叠屏手机由大屏折叠为小屏的过程中,折叠角度传感器的值会发生变化,调用onSensorChange监听折叠角度传感器的值;调用animateToFinalPosition启动SpringAnimation;SpringAnimation启动后,可以通过调用onAnimationUpdate监听壁纸动画的变化,通过sendframe发送壁纸动画相关数据,调用media.seekto获取壁纸动画播放的进度。As shown in Figure 6A, when the folding screen mobile phone is folded from a large screen to a small screen, the value of the folding angle sensor will change. Call onSensorChange to monitor the value of the folding angle sensor; call animateToFinalPosition to start SpringAnimation; after SpringAnimation is started, you can call onAnimationUpdate monitors changes in wallpaper animation, sends wallpaper animation related data through sendframe, and calls media.seekto to obtain the progress of wallpaper animation playback.
其中,SpringAnimation可以指接近真实物理世界的动画,本申请实施例中,折叠壁纸服务调用SpringAnimation可以使得折叠屏动画的播放速率根据折叠屏手机的折叠速度变化。例如,当折叠屏手机折叠速率较慢时,折叠屏动画的播放速率也可以较慢;当折叠屏手机折叠速率较快时,折叠屏动画的播放速率也可以较快。Among them, SpringAnimation can refer to animation that is close to the real physical world. In the embodiment of this application, the folding wallpaper service calls SpringAnimation so that the playback rate of the folding screen animation changes according to the folding speed of the folding screen mobile phone. For example, when the folding speed of the folding screen mobile phone is slow, the playing speed of the folding screen animation can also be slow; when the folding speed of the folding screen mobile phone is fast, the playing speed of the folding screen animation can also be fast.
如图6B所示,折叠屏手机由大屏折叠为小屏的过程中,当手机屏幕发生变化时,如果需要程序以屏幕改变前的状态继续运行,需要通过调用onConfigurationChanged,获取当前的屏幕信息;当Surface发生变化时,调用onSurfaceChanged,由于折叠屏手机处于由大屏折叠为小屏的过程中,screen由大屏变为小屏,调用screenChange(isSmall),并根据screenChange(isSmall)调用seekto(small/large),获取小屏下的surface参数,触发回调函数onSurfaceRedrawNeeded以通知SurfaceHolder的使用者,调用redrawSurface重新绘制surface,并调用reConfig更新配置文件。As shown in Figure 6B, during the process of folding the folding screen mobile phone from a large screen to a small screen, when the screen of the mobile phone changes, if you need the program to continue running in the state before the screen change, you need to obtain the current screen information by calling onConfigurationChanged; When the Surface changes, onSurfaceChanged is called. Since the folding screen phone is in the process of folding from a large screen to a small screen, and the screen changes from a large screen to a small screen, screenChange(isSmall) is called, and seekto(small) is called based on screenChange(isSmall). /large), obtains the surface parameter under the small screen, triggers the callback function onSurfaceRedrawNeeded to notify the user of SurfaceHolder, calls redrawSurface to redraw the surface, and calls reConfig to update the configuration file.
通过图6A和图6B所示的方式,折叠屏手机可以实现折叠壁纸的显示。Through the method shown in Figure 6A and Figure 6B, the folding screen mobile phone can realize the display of folding wallpaper.
如图7所示,以手机为例,当手机接收到用户进行的与手机亮灭屏相关的操作时,Power开始亮灭屏流程时,调用KeyguardService执行亮灭屏流程。熄屏显示AOD主要发生在灭屏阶段。其中,用户进行的与手机亮灭屏相关操作可以包括:按压电源键、指纹解锁、人脸解锁、抬手、一键锁屏等。As shown in Figure 7, taking a mobile phone as an example, when the mobile phone receives an operation related to turning on and off the screen of the mobile phone, and Power starts the on and off screen process, it calls KeyguardService to execute the on and off screen process. Screen-off display AOD mainly occurs during the screen-off stage. Among them, the user's operations related to turning on and off the phone's screen can include: pressing the power button, fingerprint unlocking, face unlocking, raising hands, one-click screen lock, etc.
KeyguardService调用onStartedGoingToSleep,执行灭屏流程;调用onFinishGoingToSleep,灭屏流程执行结束;调用onDreamingStarted,开始准备显示AOD;调用onScreenTurnedOff,开始显示AOD。KeyguardService calls onStartedGoingToSleep to execute the screen-off process; calls onFinishGoingToSleep to complete the screen-off process; calls onDreamingStarted to start preparing to display AOD; calls onScreenTurnedOff to start displaying AOD.
同时,同步执行DreamController这一AOD控制流程。启动DozeService,进行AOD各种配置初始化,例如AOD的显示状态、显示方式等。判断当前应用壁纸是否为超级壁纸:如果是超级壁纸,需要获取壁纸动效,包括桌面到AOD的时长、锁屏界面到AOD的时长,DreamController开始执行超级壁纸灭屏动效及衔接AOD界面逐渐显示的流程;如果不是超级壁纸,则初始化普通壁纸的AOD界面的绘制流程。At the same time, the AOD control process of DreamController is executed synchronously. Start DozeService and initialize various AOD configurations, such as AOD display status and display mode. Determine whether the current application wallpaper is a super wallpaper: If it is a super wallpaper, you need to obtain the wallpaper animation, including the duration from the desktop to AOD, and the duration from the lock screen interface to AOD. DreamController starts to execute the super wallpaper screen-off animation and gradually displays the connected AOD interface. The process; if it is not a super wallpaper, the drawing process of the AOD interface of the ordinary wallpaper is initialized.
调用DozeServiceonDreamingStarted,开始准备显示AOD。调用Enable TP,用于AOD支持触摸显示,其中,TP为触摸屏(touch panel,TP);判断是否支持超级壁纸,如果不支持超级壁纸,则执行灭屏操作后直接进行进入Doze。Call DozeServiceonDreamingStarted to start preparing to display AOD. Call Enable TP for AOD to support touch display, where TP is the touch panel (TP); determine whether super wallpaper is supported. If super wallpaper is not supported, perform the screen-off operation and then directly enter Doze.
KeyguardService还可以执行亮屏流程,KeyguardService调用doFaceRecognize人脸识别用于唤醒手机;调用onStartedWakingUp,唤醒手机;调用onDreamingStopped,停止AOD显示;调用onScreenTurningOn,开始执行亮屏显示;调用onScreenTurnedOn,执行亮屏显示;调用startKeyguardExitAnimation,开始播放退出锁屏界面的动画。KeyguardService can also perform the screen brightening process. KeyguardService calls doFaceRecognize face recognition to wake up the phone; calls onStartedWakingUp to wake up the phone; calls onDreamingStopped to stop the AOD display; calls onScreenTurningOn to start the bright screen display; calls onScreenTurnedOn to execute the bright screen display; calls startKeyguardExitAnimation, starts playing the animation for exiting the lock screen interface.
在KeyguardService执行灭屏的过程中,终端设备调用onScreenTurnedOff,开始显示AOD后;或者在KeyguardService执行亮屏的过程中,终端设备调用startKeyguardExitAnimation,开始播放退出锁屏界面的动画后;或者DozeService启动后,如果终端设备支持超级壁纸,则AOD调用WMS指令携带AOD当前屏幕位置等AOD相关状态,上述三种情况均可以基于WallpaperManager发送指令sendWallpaperCommand至壁纸服务,壁纸服务基于收到的指令实现对应的壁纸显示。When KeyguardService executes the screen turning off, the terminal device calls onScreenTurnedOff and starts to display AOD; or when KeyguardService executes the screen turning on, the terminal device calls startKeyguardExitAnimation and starts playing the animation for exiting the lock screen interface; or after DozeService is started, if If the terminal device supports super wallpaper, the AOD calls the WMS command to carry the AOD current screen position and other AOD-related status. In the above three cases, the command sendWallpaperCommand can be sent to the wallpaper service based on the WallpaperManager. The wallpaper service implements the corresponding wallpaper display based on the received command.
可以理解的是,上述实施例是以安卓系统中的具体实现为例,示例性说明本申请实施例的壁纸框架的具体运行方式,在其它操作系统中可以基于该构思适应修改相关的函数和执行模块。且上述实现中的一些步骤可以为可选步骤,本申请实施例不作具体限定。It can be understood that the above embodiment takes the specific implementation in the Android system as an example to illustrate the specific operation mode of the wallpaper framework in the embodiment of the present application. In other operating systems, relevant functions and execution can be adapted and modified based on this concept. module. And some steps in the above implementation may be optional steps, which are not specifically limited in the embodiments of this application.
下面将结合场景说明本申请实施例的壁纸显示方法。The wallpaper display method according to the embodiment of the present application will be described below in conjunction with scenarios.
示例性的,图8示出了本申请实施例的一种壁纸显示方法。方法包括:Exemplarily, FIG. 8 shows a wallpaper display method according to an embodiment of the present application. Methods include:
S801、终端设备基于第一壁纸服务显示第一壁纸。S801. The terminal device displays the first wallpaper based on the first wallpaper service.
第一壁纸服务用于运行壁纸服务类型为第一壁纸服务的壁纸。本申请实施例中,壁纸服务可以分为三类,包括:动态壁纸服务、折叠壁纸服务和超级壁纸服务。The first wallpaper service is used to run wallpapers whose wallpaper service type is the first wallpaper service. In the embodiment of this application, wallpaper services can be divided into three categories, including: dynamic wallpaper service, folding wallpaper service and super wallpaper service.
第一壁纸可以理解为图1中的d所示的壁纸,例如,第一壁纸可以对应于图1中的d所示的命名为绽放的动态壁纸105,此时,第一壁纸服务对应于动态壁纸服务,终端设备基于动态壁纸服务显示动态壁纸。The first wallpaper can be understood as the wallpaper shown as d in Figure 1. For example, the first wallpaper can correspond to the dynamic wallpaper 105 named Bloom as shown in d in Figure 1. At this time, the first wallpaper service corresponds to the dynamic wallpaper 105 shown in d in Figure 1. Wallpaper service, the terminal device displays dynamic wallpaper based on the dynamic wallpaper service.
S802、终端设备接收到针对第二壁纸的标识的第一操作。S802. The terminal device receives the first operation for the identification of the second wallpaper.
本申请实施例中,第二壁纸的标识可以是第二壁纸对应的壁纸名称、壁纸标号等,壁纸的标识可以用文字、数字、字母、符号等表示,本申请实施例对此不做具体限定。第一操作可以是用户触发的、选择第二壁纸的标识的操作。In the embodiment of the present application, the identification of the second wallpaper may be the name of the wallpaper corresponding to the second wallpaper, the wallpaper label, etc. The identification of the wallpaper may be represented by words, numbers, letters, symbols, etc., which is not specifically limited in the embodiment of the application. . The first operation may be a user-triggered operation of selecting the logo of the second wallpaper.
其中,第二壁纸的标识可以理解为如图1中的d所示的壁纸名称:绽放(动态)、泡沫(动态)、冥想(折叠)、极限(超级)等。第一操作可以理解为终端设备接收到的用户选择图1中的d所示的某一壁纸标识的操作。例如,用户点击图1中的d所示的“绽放(动态)”这一壁纸标识,终端设备接收到用户选择“绽放(动态)”这一壁纸标识的操作。Among them, the logo of the second wallpaper can be understood as the name of the wallpaper as shown in d in Figure 1: bloom (dynamic), bubble (dynamic), meditation (folded), extreme (super), etc. The first operation can be understood as the user's operation of selecting a certain wallpaper logo shown in d in Figure 1 received by the terminal device. For example, the user clicks the wallpaper logo "Blooming (Dynamic)" shown in d in Figure 1, and the terminal device receives the user's operation of selecting the wallpaper logo "Blooming (Dynamic)".
S803、响应于第一操作,终端设备得到第二壁纸对应的壁纸服务的标识。S803. In response to the first operation, the terminal device obtains the identification of the wallpaper service corresponding to the second wallpaper.
本申请实施例中,壁纸服务的标识可以理解为步骤S403中的超级壁纸服务、动态壁纸服务、折叠壁纸服务,壁纸服务的标识还可以用其他的文字、数字、字母、符号等表示,本申请实施例对此不做具体限定。In the embodiment of this application, the logo of the wallpaper service can be understood as the super wallpaper service, dynamic wallpaper service, and folding wallpaper service in step S403. The logo of the wallpaper service can also be represented by other words, numbers, letters, symbols, etc. This application The embodiment does not specifically limit this.
例如,以动态壁纸为例,终端设备响应于用户选择图1中的d所示的“绽放(动态)”这一壁纸标识的操作,终端设备对绽放(动态)壁纸相关的壁纸文件进行解析,得到用户所选壁纸对应的壁纸服务的标识,即动态壁纸服务。For example, taking dynamic wallpaper as an example, the terminal device responds to the user's operation of selecting the wallpaper logo "Blooming (Dynamic)" shown in d in Figure 1, and the terminal device parses the wallpaper file related to the Blooming (Dynamic) wallpaper, Obtain the identification of the wallpaper service corresponding to the wallpaper selected by the user, that is, the dynamic wallpaper service.
S804、当第一壁纸服务与第二壁纸对应的壁纸服务为相同的服务时,终端设备基于第一壁纸服务实现第二壁纸的显示。S804. When the first wallpaper service and the wallpaper service corresponding to the second wallpaper are the same service, the terminal device implements display of the second wallpaper based on the first wallpaper service.
终端设备根据得到的第二壁纸对应的壁纸服务的标识,判断与第一壁纸服务的标识是否相同,标识相同则说明第二壁纸对应的壁纸服务为第一壁纸服务,终端设备可以基于第一壁纸服务显示第二壁纸。The terminal device determines whether the obtained identifier of the wallpaper service corresponding to the second wallpaper is the same as the identifier of the first wallpaper service. If the identifiers are the same, it means that the wallpaper service corresponding to the second wallpaper is the first wallpaper service. The terminal device can be based on the first wallpaper. The service displays the second wallpaper.
可以理解的是,标识相同可以是两个壁纸服务的标识完全相同,例如,第一壁纸服务名称为折叠壁纸服务,第二壁纸对应的壁纸服务名称为折叠壁纸服务、则判断出第一壁纸服务与第二壁纸对应的壁纸服务为相同的服务。It can be understood that the same identifier can mean that the identifiers of two wallpaper services are exactly the same. For example, if the name of the first wallpaper service is Folding Wallpaper Service, and the name of the wallpaper service corresponding to the second wallpaper is Folding Wallpaper Service, then it is determined that the first wallpaper service The wallpaper service corresponding to the second wallpaper is the same service.
也可以是两个壁纸服务的标识大于一定的相似度。例如,第一壁纸服务名称为“动态壁纸1.0”,第二壁纸对应的壁纸服务名称为“动态壁纸2.0”,可以认为两个壁纸服务的标识大于一定的相似度,第一壁纸服务与第二壁纸对应的壁纸服务为相同的服务。It can also be that the logos of the two wallpaper services are more similar than a certain degree. For example, the name of the first wallpaper service is "Dynamic Wallpaper 1.0", and the name of the wallpaper service corresponding to the second wallpaper is "Dynamic Wallpaper 2.0". It can be considered that the logos of the two wallpaper services are greater than a certain degree of similarity. The wallpaper service corresponding to the wallpaper is the same service.
这样,当壁纸改变时,改变后的壁纸对应的壁纸服务与改变前终端设备运行的壁纸服务相同时,终端设备可以基于改变前终端设备运行的壁纸服务显示改变后的壁纸,不需要为每个壁纸都定制壁纸服务,简化了开发流程,节省了人力成本。In this way, when the wallpaper changes, and the wallpaper service corresponding to the changed wallpaper is the same as the wallpaper service running on the terminal device before the change, the terminal device can display the changed wallpaper based on the wallpaper service running on the terminal device before the change, without the need for each Wallpapers are all customized wallpaper services, which simplifies the development process and saves labor costs.
可选的,终端设备得到第二壁纸对应的壁纸服务的标识,包括:Optionally, the terminal device obtains the identification of the wallpaper service corresponding to the second wallpaper, including:
终端设备获取第二壁纸的主题包;第二壁纸的主题包配置有第二壁纸对应的壁纸服务的标识;终端设备解析第二壁纸的主题包,得到第二壁纸对应的壁纸服务的标识。The terminal device obtains the theme package of the second wallpaper; the theme package of the second wallpaper is configured with the identifier of the wallpaper service corresponding to the second wallpaper; the terminal device parses the theme package of the second wallpaper to obtain the identifier of the wallpaper service corresponding to the second wallpaper.
也就是说,终端设备基于用户触发的第一操作获取第二壁纸的主题包,通过解析主题包得到第二壁纸对应的壁纸服务的标识。具体方式可以参照步骤S401-S403的描述,终端设备接收到用户选择主题设置项中某一壁纸标识的操作后,获取到该壁纸标识对应的主题包。主题包可以以压缩形式存储,也可以不压缩存储,终端设备可以通过解压或直接读取的方式得到主题包中的文件,文件中可以包括livepaper.xml,终端设备解析livepaper.xml,可以得到壁纸对应的壁纸服务的标识。That is to say, the terminal device obtains the theme package of the second wallpaper based on the first operation triggered by the user, and obtains the identification of the wallpaper service corresponding to the second wallpaper by parsing the theme package. For a specific method, please refer to the description of steps S401-S403. After the terminal device receives the user's operation of selecting a certain wallpaper identification in the theme setting item, it obtains the theme package corresponding to the wallpaper identification. The theme package can be stored in compressed form or uncompressed. The terminal device can obtain the files in the theme package by decompressing or directly reading it. The file can include livepaper.xml. The terminal device parses livepaper.xml and can obtain the wallpaper. The identification of the corresponding wallpaper service.
这样,终端设备可以通过解析壁纸的主题包,快速准确的得到壁纸对应的壁纸服务的标识。In this way, the terminal device can quickly and accurately obtain the identification of the wallpaper service corresponding to the wallpaper by parsing the theme package of the wallpaper.
可选的,第二壁纸的主题包中还包括第二壁纸的壁纸资源,以及第二壁纸的配置文件;壁纸资源包括视频和图片,配置文件包括壁纸资源的帧数和壁纸资源的显示相关参数。Optionally, the theme package of the second wallpaper also includes the wallpaper resources of the second wallpaper, and the configuration file of the second wallpaper; the wallpaper resources include videos and pictures, and the configuration file includes the frame number of the wallpaper resource and the display-related parameters of the wallpaper resource. .
终端设备基于第一壁纸服务实现第二壁纸的显示,包括:终端设备根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源;终端设备基于更新后的第一壁纸服务中的壁纸资源显示第二壁纸。The terminal device realizes the display of the second wallpaper based on the first wallpaper service, including: the terminal device updates the wallpaper resources in the first wallpaper service according to the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper; the terminal device based on the updated first wallpaper The wallpaper resource in the wallpaper service displays the second wallpaper.
本申请实施例中,第二壁纸的壁纸资源可以存储于主题包的资源文件中,第二壁纸的配置文件可以存储于主题包的livepaper_config.xml中。In the embodiment of this application, the wallpaper resource of the second wallpaper can be stored in the resource file of the theme package, and the configuration file of the second wallpaper can be stored in livepaper_config.xml of the theme package.
终端设备根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源及配置,具体方式可以参照步骤S407,根据步骤S407,当用户选择的壁纸标识为第二壁纸的标识时,第一壁纸服务获取到第二壁纸标识对应的壁纸配置和资源后,在data/themes/0目录下的数据库中更新壁纸资源和壁纸配置。The terminal device updates the wallpaper resources and configuration in the first wallpaper service according to the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper. The specific method may refer to step S407. According to step S407, when the wallpaper selected by the user is identified as the second wallpaper When identifying, after obtaining the wallpaper configuration and resources corresponding to the second wallpaper identification, the first wallpaper service updates the wallpaper resources and wallpaper configuration in the database under the data/themes/0 directory.
终端设备基于更新后的第一壁纸服务中的壁纸资源及配置显示第二壁纸。例如,第一壁纸服务为超级壁纸服务,终端设备基于更新后的超级壁纸服务中的壁纸资源及配置显示超级壁纸,终端设备播放超级壁纸的动画;第一壁纸服务为折叠壁纸服务,终端设备基于更新后的折叠壁纸服务中的壁纸资源及配置显示折叠壁纸,终端设备播放折叠壁纸的动画;第一壁纸服务为动态壁纸服务,终端设备基于更新后的动态壁纸服务中的壁纸资源及配置显示动态壁纸,终端设备播放动态壁纸的动画。The terminal device displays the second wallpaper based on the wallpaper resources and configuration in the updated first wallpaper service. For example, the first wallpaper service is a super wallpaper service, the terminal device displays the super wallpaper based on the wallpaper resources and configuration in the updated super wallpaper service, and the terminal device plays the animation of the super wallpaper; the first wallpaper service is a folding wallpaper service, and the terminal device is based on The wallpaper resources and configuration in the updated folding wallpaper service display the folded wallpaper, and the terminal device plays the animation of the folding wallpaper; the first wallpaper service is a dynamic wallpaper service, and the terminal device displays the dynamic wallpaper based on the wallpaper resources and configuration in the updated dynamic wallpaper service. Wallpaper, the terminal device plays the animation of the dynamic wallpaper.
这样,在壁纸改变、壁纸对应的壁纸服务不变的情况下,终端设备可以通过更新壁纸资源、基于原壁纸服务显示改变后的壁纸,节约人力成本、提升壁纸开发的效率。In this way, when the wallpaper changes and the wallpaper service corresponding to the wallpaper remains unchanged, the terminal device can update the wallpaper resources and display the changed wallpaper based on the original wallpaper service, saving labor costs and improving the efficiency of wallpaper development.
可选的,显示相关参数包括深色模式或浅色模式;终端设备根据第二壁纸的配置文件和第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源,包括:Optionally, display related parameters include dark mode or light mode; the terminal device updates the wallpaper resources in the first wallpaper service according to the configuration file of the second wallpaper and the wallpaper resources of the second wallpaper, including:
当第二壁纸对应于深色模式时,终端设备从第二壁纸的壁纸资源中获取深色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在深色模式对应的壁纸资源;When the second wallpaper corresponds to the dark mode, the terminal device obtains the wallpaper resource corresponding to the dark mode from the wallpaper resource of the second wallpaper, and updates the wallpaper resource in the first wallpaper service to the wallpaper resource corresponding to the second wallpaper in the dark mode. Wallpaper resources;
或者,当第二壁纸对应于浅色模式时,终端设备从第二壁纸的壁纸资源中获取浅色模式对应的壁纸资源,并更新第一壁纸服务中的壁纸资源为第二壁纸在浅色模式对应的壁纸资源。Or, when the second wallpaper corresponds to the light mode, the terminal device obtains the wallpaper resource corresponding to the light mode from the wallpaper resource of the second wallpaper, and updates the wallpaper resource in the first wallpaper service to the second wallpaper in the light mode. Corresponding wallpaper resources.
可以理解的是,终端设备由深色模式切换为浅色模式时,终端设备可以实时更新第一壁纸服务中的壁纸资源为第二壁纸在浅色模式对应的壁纸资源。或者,终端设备由浅色模式切换为深色模式时,终端设备可以实时更新第一壁纸服务中的壁纸资源为第二壁纸在深色模式对应的壁纸资源。It can be understood that when the terminal device switches from the dark mode to the light mode, the terminal device can update the wallpaper resources in the first wallpaper service in real time to the wallpaper resources corresponding to the second wallpaper in the light mode. Alternatively, when the terminal device switches from the light mode to the dark mode, the terminal device can update the wallpaper resources in the first wallpaper service in real time to the wallpaper resources corresponding to the second wallpaper in the dark mode.
这样,终端设备可以基于显示相关参数,根据壁纸的配置文件和资源更新壁纸资源,使得壁纸服务更加智能、增强与用户的交互能力。In this way, the terminal device can update the wallpaper resources according to the wallpaper's configuration file and resources based on display-related parameters, making the wallpaper service more intelligent and enhancing the ability to interact with users.
可选的,终端设备根据第二壁纸的壁纸资源更新第一壁纸服务中的壁纸资源之前,还包括:终端设备的应用程序框架层的折叠壁纸框架FWK向应用层的应用程序包APK的第一壁纸服务发送安卓壁纸再请求android wallpaper reapply指令。Optionally, before the terminal device updates the wallpaper resource in the first wallpaper service according to the wallpaper resource of the second wallpaper, it also includes: the folded wallpaper frame FWK of the application framework layer of the terminal device to the first application package APK of the application layer. The wallpaper service sends the Android wallpaper and then requests the android wallpaper reapply command.
其中,折叠壁纸框架(foldable wallpaper framework)可以位于应用程序框架层的壁纸服务模块中,android wallpaper reapply指令可以参照步骤S405中的描述,此处不再赘述。Wherein, the foldable wallpaper framework may be located in the wallpaper service module of the application framework layer, and the android wallpaper reapply instruction may refer to the description in step S405, which will not be described again here.
对应于步骤S405,运行于FWK中的WMS向APK中正在运行的壁纸服务,即第一壁纸服务发送android wallpaper reapply,第一壁纸服务可以基于该指令将第一壁纸服务中的壁纸配置和资源更新为第二壁纸对应的壁纸配置和资源。Corresponding to step S405, the WMS running in the FWK sends android wallpaper reapply to the wallpaper service running in the APK, that is, the first wallpaper service. The first wallpaper service can update the wallpaper configuration and resources in the first wallpaper service based on this instruction. Wallpaper configuration and resources corresponding to the second wallpaper.
这样,在壁纸改变、对应的壁纸服务不变的情况下,终端设备可以通过发送android wallpaper reapply指令,指示壁纸服务更新壁纸资源和配置,节约人力成本、提升壁纸开发的效率。In this way, when the wallpaper changes and the corresponding wallpaper service remains unchanged, the terminal device can instruct the wallpaper service to update the wallpaper resources and configuration by sending the android wallpaper reapply command, saving labor costs and improving the efficiency of wallpaper development.
可选的,当终端设备支持锁屏透明显示时,终端设备将第二壁纸的壁纸资源中的图片向锁屏显示相关模块复制。Optionally, when the terminal device supports transparent display on the lock screen, the terminal device copies the image in the wallpaper resource of the second wallpaper to the lock screen display related module.
其中,锁屏透明的具体描述可以参照步骤S409中对锁屏透明的描述,此处不再赘述。For a specific description of lock screen transparency, please refer to the description of lock screen transparency in step S409, which will not be described again here.
锁屏显示相关模块可以用于显示锁屏透明等锁屏相关业务。当终端设备将第二壁纸的壁纸资源中的图片向锁屏显示相关模块复制后,对应于步骤S410,锁屏显示相关模块可以通过对图片进行透明度设置,并将图片覆盖于动态的锁屏壁纸上,以实现动态的锁屏透明场景。The lock screen display related module can be used to display lock screen transparency and other lock screen related services. After the terminal device copies the image in the wallpaper resource of the second wallpaper to the lock screen display related module, corresponding to step S410, the lock screen display related module can set the transparency of the image and cover the image on the dynamic lock screen wallpaper. to achieve dynamic lock screen transparent scenes.
这样,终端设备可以提供动态的锁屏透明场景,使壁纸服务更加丰富有趣。In this way, the terminal device can provide dynamic lock screen transparent scenes, making the wallpaper service more rich and interesting.
示例性的,本申请实施例还提供另一种壁纸显示方法,包括:Exemplarily, the embodiment of the present application also provides another wallpaper display method, including:
终端设备接收到针对第三壁纸的标识的第二操作;响应于第二操作,终端设备得到第三壁纸对应的壁纸服务的标识;当第一壁纸服务与第三壁纸对应的壁纸服务为不相同的服务时,终端设备启动第二壁纸服务,第二壁纸服务为第三壁纸对应的壁纸服务;终端设备基于第二壁纸服务实现第三壁纸的显示。The terminal device receives the second operation for the identification of the third wallpaper; in response to the second operation, the terminal device obtains the identification of the wallpaper service corresponding to the third wallpaper; when the first wallpaper service and the wallpaper service corresponding to the third wallpaper are different When the service is provided, the terminal device starts the second wallpaper service, and the second wallpaper service is the wallpaper service corresponding to the third wallpaper; the terminal device implements the display of the third wallpaper based on the second wallpaper service.
本申请实施例中,第二操作可以是用户触发的、选择第三壁纸的标识的操作。第二壁纸服务用于运行壁纸服务类型为第二壁纸服务的壁纸。In this embodiment of the present application, the second operation may be a user-triggered operation of selecting the logo of the third wallpaper. The second wallpaper service is used to run wallpapers whose wallpaper service type is the second wallpaper service.
对应于步骤S501-S506,终端设备接收到的用户选择主题设置项中第三壁纸的标识的第二操作,响应于第二操作,终端设备获取到第三壁纸对应的主题包,终端设备对主题包中的文件进行解析得到第三壁纸对应的壁纸服务的标识。终端设备中的服务调起模块可以通过WMS判断第一壁纸服务的标识与第三壁纸对应的壁纸服务的标识是否相同,进而判断第一壁纸服务与第三壁纸对应的壁纸是否相同。当第三壁纸对应的壁纸服务为第二壁纸服务时,第二壁纸服务与第一壁纸服务不同,终端设备启动第二壁纸服务,基于第二壁纸服务实现第三壁纸的显示。Corresponding to steps S501-S506, the terminal device receives the second operation of the user selecting the identification of the third wallpaper in the theme setting item. In response to the second operation, the terminal device obtains the theme package corresponding to the third wallpaper, and the terminal device selects the theme The files in the package are parsed to obtain the identity of the wallpaper service corresponding to the third wallpaper. The service calling module in the terminal device can determine through WMS whether the identifier of the first wallpaper service and the identifier of the wallpaper service corresponding to the third wallpaper are the same, and then determine whether the wallpapers corresponding to the first wallpaper service and the third wallpaper are the same. When the wallpaper service corresponding to the third wallpaper is the second wallpaper service, and the second wallpaper service is different from the first wallpaper service, the terminal device starts the second wallpaper service and realizes the display of the third wallpaper based on the second wallpaper service.
例如,第一壁纸服务可以对应于动态壁纸服务,第三壁纸的标识可以对应于图1中的d所示的“极限(超级)”壁纸标识。终端设备响应于用户选择“极限(超级)”这一壁纸标识的操作,终端设备对极限(超级)壁纸相关的壁纸文件进行解析,得到用户所选壁纸对应的壁纸服务的标识,即超级壁纸服务。超级壁纸服务与用户选择“极限(超级)”壁纸标识时,系统正在运行的动态壁纸服务不同,终端设备启动超级壁纸服务,基于超级壁纸服务显示“极限(超级)”这一超级壁纸。For example, the first wallpaper service may correspond to the dynamic wallpaper service, and the logo of the third wallpaper may correspond to the "extreme (super)" wallpaper logo shown in d in FIG. 1 . In response to the user's operation of selecting the wallpaper logo "Extreme (Super)", the terminal device parses the wallpaper file related to the Extreme (Super) wallpaper and obtains the logo of the wallpaper service corresponding to the wallpaper selected by the user, that is, the Super Wallpaper Service . The super wallpaper service is different from the dynamic wallpaper service running on the system when the user selects the "Extreme (Super)" wallpaper logo. The terminal device starts the super wallpaper service and displays the "Extreme (Super)" super wallpaper based on the super wallpaper service.
这样,当壁纸改变时,改变后的壁纸对应的壁纸服务与改变前终端设备运行的壁纸服务不同时,终端设备可以启动改变后的壁纸对应的壁纸服务,基于改变后的壁纸对应的壁纸服务显示改变后的壁纸,不需要为每个壁纸都定制壁纸服务,简化了开发流程,节省了人力成本。In this way, when the wallpaper changes, and the wallpaper service corresponding to the changed wallpaper is different from the wallpaper service running on the terminal device before the change, the terminal device can start the wallpaper service corresponding to the changed wallpaper, and display the wallpaper service corresponding to the changed wallpaper. After changing the wallpaper, there is no need to customize wallpaper services for each wallpaper, which simplifies the development process and saves labor costs.
可选的,终端设备基于第二壁纸服务实现第三壁纸的显示,包括:终端设备基于第二壁纸服务注册监听深色模式或浅色模式;终端设备解析第三壁纸的主题包;第三壁纸的主题包包括第三壁纸的壁纸资源和第三壁纸的配置文件;终端设备根据第三壁纸的配置文件和第三壁纸的壁纸资源向第二壁纸服务中写入壁纸资源;终端设备基于第二壁纸服务中写入的壁纸资源显示第三壁纸。Optionally, the terminal device realizes the display of the third wallpaper based on the second wallpaper service, including: the terminal device registers and monitors the dark mode or light mode based on the second wallpaper service; the terminal device parses the theme package of the third wallpaper; the third wallpaper The theme package includes the wallpaper resources of the third wallpaper and the configuration file of the third wallpaper; the terminal device writes wallpaper resources to the second wallpaper service based on the configuration file of the third wallpaper and the wallpaper resources of the third wallpaper; the terminal device writes wallpaper resources based on the second wallpaper The wallpaper resource written in the wallpaper service displays the third wallpaper.
对应于步骤S507,终端设备可以注册传感器、监听器,当终端设备的显示模式由深色模式切换为浅色模式时,或者,当终端设备的显示模式由浅色模式切换为深色模式时,注册的深色模式和浅色模式的监听器监听到终端设备显示模式的变化,通知终端设备基于当前的显示模式切换更新壁纸资源。Corresponding to step S507, the terminal device can register sensors and listeners. When the display mode of the terminal device switches from dark mode to light mode, or when the display mode of the terminal device switches from light mode to dark mode, register The dark mode and light mode listeners monitor changes in the display mode of the terminal device and notify the terminal device to switch and update wallpaper resources based on the current display mode.
对应于步骤S508,终端设备解析第三壁纸的主题包,得到第三壁纸的壁纸资源和第三壁纸的配置文件。Corresponding to step S508, the terminal device parses the theme package of the third wallpaper, and obtains the wallpaper resource of the third wallpaper and the configuration file of the third wallpaper.
可能的实现中,对应于步骤S510,终端设备解析第三壁纸的配置文件,将配置文件转化为代码可识别的配置文件。In a possible implementation, corresponding to step S510, the terminal device parses the configuration file of the third wallpaper and converts the configuration file into a code-recognizable configuration file.
可能的实现中,对应于步骤S509,终端设备还可以对第三壁纸的配置文件的准确性进行检验,当配置文件的不准确时,结束运行壁纸服务。In a possible implementation, corresponding to step S509, the terminal device may also check the accuracy of the configuration file of the third wallpaper, and when the configuration file is inaccurate, end running the wallpaper service.
对应于步骤S512-S513,终端设备基于解析第三壁纸的配置文件得到的壁纸资源的路径,获取壁纸资源,将获取到的第三壁纸资源及第三壁纸配置文件写入第二壁纸服务中,终端设备基于第二壁纸服务中写入的壁纸资源及壁纸配置文件初始化壁纸界面,终端设备显示第三壁纸。Corresponding to steps S512-S513, the terminal device obtains the wallpaper resource based on the path of the wallpaper resource obtained by parsing the configuration file of the third wallpaper, and writes the obtained third wallpaper resource and the third wallpaper configuration file into the second wallpaper service, The terminal device initializes the wallpaper interface based on the wallpaper resources and wallpaper configuration files written in the second wallpaper service, and the terminal device displays the third wallpaper.
这样,终端设备可以将改变后的壁纸对应的壁纸资源及壁纸配置文件,主动写入改变后的壁纸对应的壁纸服务中,终端设备基于写入的壁纸资源及配置文件显示改变后的壁纸,可以增强壁纸与用户操作的交互性,节约了人力成本。In this way, the terminal device can actively write the wallpaper resources and wallpaper configuration files corresponding to the changed wallpaper into the wallpaper service corresponding to the changed wallpaper. The terminal device can display the changed wallpaper based on the written wallpaper resources and configuration files. Enhance the interactivity between wallpaper and user operations, saving labor costs.
可选的,终端设备根据第三壁纸的配置文件和第三壁纸的壁纸资源向第二壁纸服务中写入壁纸资源,包括:Optionally, the terminal device writes wallpaper resources to the second wallpaper service according to the configuration file of the third wallpaper and the wallpaper resources of the third wallpaper, including:
当第三壁纸对应于深色模式时,终端设备从第三壁纸的壁纸资源中获取深色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在深色模式对应的壁纸资源。When the third wallpaper corresponds to the dark mode, the terminal device obtains the wallpaper resources corresponding to the dark mode from the wallpaper resources of the third wallpaper, initializes the wallpaper playback implementation strategy to the frame-by-frame playback strategy, and writes to the second wallpaper service Enter the wallpaper resources corresponding to the third wallpaper in dark mode.
或者,当第三壁纸对应于浅色模式时,终端设备从第三壁纸的壁纸资源中获取浅色模式对应的壁纸资源,初始化壁纸播放实现策略为按帧播放的策略,并向第二壁纸服务中写入第三壁纸在浅色模式对应的壁纸资源。Or, when the third wallpaper corresponds to the light mode, the terminal device obtains the wallpaper resource corresponding to the light mode from the wallpaper resource of the third wallpaper, initializes the wallpaper playback implementation strategy to the frame-by-frame playback strategy, and serves the second wallpaper Write the wallpaper resources corresponding to the third wallpaper in light mode.
对应于步骤S510,终端设备可以基于壁纸资源的路径,获取对应的资源。深色模式对应的壁纸资源可以包括深色模式下的视频资源和图片资源;浅色模式对应的壁纸资源可以包括浅色模式下的视频资源和图片资源。Corresponding to step S510, the terminal device may obtain the corresponding resource based on the path of the wallpaper resource. Wallpaper resources corresponding to dark mode may include video resources and picture resources in dark mode; wallpaper resources corresponding to light mode may include video resources and picture resources in light mode.
对应于步骤S511,壁纸播放实现策略可以包括按时间播放和逐帧播放两种策略,本申请实施例中,可以通过mediacodec与物理弹性动画SpringAnimation结合,初始化壁纸播放实现策略为按帧播放的策略,基于媒体播放器media palyer逐帧播放壁纸中的动画。Corresponding to step S511, the wallpaper playback implementation strategy may include two strategies: time-based playback and frame-by-frame playback. In the embodiment of the present application, mediacodec can be combined with the physical elastic animation SpringAnimation to initialize the wallpaper playback implementation strategy to a frame-by-frame playback strategy. Play the animation in the wallpaper frame by frame based on the media player.
其中,向第二壁纸服务中写入第三壁纸在浅色模式对应的壁纸资源,或者,向第二壁纸服务中写入第三壁纸在深色模式对应的壁纸资源,可以对应于步骤S512,终端设备中的壁纸服务模块将壁纸的配置和资源写入数据库中。Wherein, writing the wallpaper resources corresponding to the third wallpaper in the light mode to the second wallpaper service, or writing the wallpaper resources corresponding to the third wallpaper in the dark mode to the second wallpaper service may correspond to step S512, The wallpaper service module in the terminal device writes the wallpaper configuration and resources into the database.
这样,终端设备可以基于显示相关参数,根据壁纸的配置文件和资源更新壁纸资源,使得壁纸服务更加智能、增强与用户的交互能力。In this way, the terminal device can update the wallpaper resources according to the wallpaper's configuration file and resources based on display-related parameters, making the wallpaper service more intelligent and enhancing the ability to interact with users.
可选的,当终端设备的系统版本大于或等于预设版本时,终端设备从数据库中获取第三壁纸的壁纸资源;或者,当终端设备的系统版本小于预设版本时,终端设备从元数据meta data中获取第三壁纸的壁纸资源。Optionally, when the system version of the terminal device is greater than or equal to the preset version, the terminal device obtains the wallpaper resource of the third wallpaper from the database; or, when the system version of the terminal device is less than the preset version, the terminal device obtains the wallpaper resource from the metadata Get the wallpaper resources of the third wallpaper in meta data.
对应于步骤S520,不同系统版本的终端设备壁纸资源的获取途径不同。本申请实施例中,当终端设备的系统版本大于或等于预设版本时,终端设备可以通过数据库获取第三壁纸的壁纸资源;当终端设备的系统版本小于预设版本时,数据库中没有存储第三壁纸的壁纸资源,终端设备需要从meta data中获取壁纸资源。Corresponding to step S520, terminal devices with different system versions have different ways of obtaining wallpaper resources. In the embodiment of the present application, when the system version of the terminal device is greater than or equal to the preset version, the terminal device can obtain the wallpaper resources of the third wallpaper through the database; when the system version of the terminal device is less than the preset version, the third wallpaper is not stored in the database. For wallpaper resources of three wallpapers, the terminal device needs to obtain wallpaper resources from meta data.
这样,可以兼容系统版本小于预设版本的终端设备,提升用户的使用体验。In this way, it can be compatible with terminal devices whose system version is smaller than the preset version, improving the user experience.
可选的,当终端设备支持熄屏显示AOD时,终端设备为第三壁纸配置动画时长、AOD样式以及锁屏图片。Optionally, when the terminal device supports AOD display with the screen turned off, the terminal device configures the animation duration, AOD style and lock screen image for the third wallpaper.
对应于步骤S521-S522,当终端设备支持熄屏显示AOD时,第三壁纸可以对应于超级壁纸,为超级壁纸配置壁纸的动画时长、AOD样式及锁屏图片等。Corresponding to steps S521-S522, when the terminal device supports AOD display with the screen turned off, the third wallpaper can correspond to the super wallpaper, and the animation duration, AOD style, lock screen image, etc. of the wallpaper can be configured for the super wallpaper.
这样,通过为超级壁纸进行相关的动效配置,可以使超级壁纸的显示效果更加丰富、有趣、个性化。In this way, by configuring relevant dynamic effects for the super wallpaper, the display effect of the super wallpaper can be made more rich, interesting, and personalized.
上面结合图4-图10,对本申请实施例提供的方法进行了说明,下面对本申请实施例提供的执行上述方法的装置进行描述。如图9所示,图9为本申请实施例提供的一种壁纸显示装置的结构示意图,该壁纸显示装置可以是本申请实施例中的电子设备,也可以是电子设备内的芯片或芯片系统。The method provided by the embodiment of the present application has been described above with reference to Figures 4 to 10. The device for performing the above method provided by the embodiment of the present application will be described below. As shown in Figure 9, Figure 9 is a schematic structural diagram of a wallpaper display device provided by an embodiment of the present application. The wallpaper display device may be the electronic device in the embodiment of the present application, or may be a chip or chip system in the electronic device. .
如图9所示,壁纸显示装置900可以用于电路、硬件组件或者芯片中,该壁纸显示装置包括处理单元901和显示单元902。其中,处理单元901用于支持壁纸显示装置执行的步骤,例如,处理单元用于处理图8中的S801至S804的步骤。显示单元902用于显示支持壁纸显示装置显示图像信息,如壁纸等。As shown in FIG. 9 , the wallpaper display device 900 may be used in a circuit, a hardware component, or a chip. The wallpaper display device includes a processing unit 901 and a display unit 902 . The processing unit 901 is used to support the steps performed by the wallpaper display device. For example, the processing unit 901 is used to process steps S801 to S804 in FIG. 8 . The display unit 902 is used to display image information that supports the wallpaper display device to display, such as wallpaper.
一种可能的实现方式中,该壁纸显示装置还可以包括:存储单元904。其中,存储单元904可以包括一个或者多个存储器,存储器可以是一个或者多个设备、电路中用于存储程序或者数据的器件。In a possible implementation, the wallpaper display device may further include: a storage unit 904. The storage unit 904 may include one or more memories, and the memories may be devices used to store programs or data in one or more devices or circuits.
存储单元904可以独立存在,通过通信总线与处理单元901相连。存储单元904也可以和处理单元901集成在一起。The storage unit 904 may exist independently and be connected to the processing unit 901 through a communication bus. The storage unit 904 can also be integrated with the processing unit 901.
以壁纸显示装置可以是本申请实施例中的终端设备的芯片或芯片系统为例,存储单元904可以存储终端设备的方法的计算机执行指令,以使处理单元901执行上述实施例中终端设备的方法。存储单元904可以是寄存器、缓存或者随机存取存储器(random accessmemory,RAM)等,存储单元904可以和处理单元901集成在一起。存储单元904可以是只读存储器(read-only memory,ROM)或者可存储静态信息和指令的其他类型的静态存储设备,存储单元904可以与处理单元901相独立。Taking the wallpaper display device as an example, the chip or chip system of the terminal device in the embodiment of the present application can be used. The storage unit 904 can store computer execution instructions for the method of the terminal device, so that the processing unit 901 executes the method of the terminal device in the above embodiment. . The storage unit 904 can be a register, a cache, a random access memory (RAM), etc., and the storage unit 904 can be integrated with the processing unit 901 . The storage unit 904 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, and the storage unit 904 may be independent from the processing unit 901 .
一种可能的实现方式中,壁纸显示装置还可以包括:通信单元903。其中,通信单元903用于支持壁纸显示装置与其它设备交互。示例性的,当该壁纸显示装置是终端设备时,该通信单元903可以是通信接口或接口电路。当该壁纸显示装置是终端设备内的芯片或芯片系统时,该通信单元903可以是通信接口。例如通信接口可以为输入/输出接口、管脚或电路等。In a possible implementation, the wallpaper display device may also include: a communication unit 903. Among them, the communication unit 903 is used to support the wallpaper display device to interact with other devices. For example, when the wallpaper display device is a terminal device, the communication unit 903 may be a communication interface or an interface circuit. When the wallpaper display device is a chip or chip system in a terminal device, the communication unit 903 may be a communication interface. For example, the communication interface may be an input/output interface, a pin or a circuit, etc.
本实施例的装置对应地可用于执行上述方法实施例中执行的步骤,其实现原理和技术效果类似,此处不再赘述。The device of this embodiment can be used to perform the steps performed in the above method embodiment. The implementation principles and technical effects are similar and will not be described again here.
图10为本申请实施例提供的一种电子设备的硬件结构示意图,如图10所示,该电子设备包括处理器1001,通信线路1004以及至少一个通信接口(图10中示例性的以通信接口1003为例进行说明)。Figure 10 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application. As shown in Figure 10, the electronic device includes a processor 1001, a communication line 1004 and at least one communication interface (exemplarily shown as a communication interface in Figure 10 1003 as an example).
处理器1001可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 1001 may be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more processors used to control the execution of the program of the present application. integrated circuit.
通信线路1004可包括在上述组件之间传送信息的电路。Communication lines 1004 may include circuitry that communicates information between the above-described components.
通信接口1003,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线局域网(wireless local area networks,WLAN)等。The communication interface 1003 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, wireless local area networks (WLAN), etc.
可能的,该电子设备还可以包括存储器1002。Possibly, the electronic device may also include a memory 1002 .
存储器1002可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compactdisc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路1004与处理器相连接。存储器也可以和处理器集成在一起。The memory 1002 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory (RAM)) or other type that can store information and instructions. The dynamic storage device can also be electrically erasable programmable read-only memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disk storage, optical disk storage ( Including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be stored by a computer. any other medium, but not limited to this. The memory may exist independently and be connected to the processor through a communication line 1004 . Memory can also be integrated with the processor.
其中,存储器1002用于存储执行本申请方案的计算机执行指令,并由处理器1001来控制执行。处理器1001用于执行存储器1002中存储的计算机执行指令,从而实现本申请实施例所提供的方法。Among them, the memory 1002 is used to store computer execution instructions for executing the solution of the present application, and the processor 1001 controls the execution. The processor 1001 is used to execute computer execution instructions stored in the memory 1002, thereby implementing the method provided by the embodiment of the present application.
可能的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Possibly, the computer execution instructions in the embodiments of the present application may also be called application codes, which are not specifically limited in the embodiments of the present application.
在具体实现中,作为一种实施例,处理器1001可以包括一个或多个CPU,例如图10中的CPU0和CPU1。In specific implementation, as an embodiment, the processor 1001 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 10 .
在具体实现中,作为一种实施例,电子设备可以包括多个处理器,例如图10中的处理器1001和处理器1005。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In specific implementation, as an embodiment, the electronic device may include multiple processors, such as the processor 1001 and the processor 1005 in FIG. 10 . Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
示例性的,图11为本申请实施例提供的一种芯片的结构示意图。芯片1100包括一个或两个以上(包括两个)处理器1120和通信接口1130。For example, FIG. 11 is a schematic structural diagram of a chip provided by an embodiment of the present application. The chip 1100 includes one or more (including two) processors 1120 and a communication interface 1130.
在一些实施方式中,存储器1140存储了如下的元素:可执行模块或者数据结构,或者他们的子集,或者他们的扩展集。In some embodiments, memory 1140 stores the following elements: executable modules or data structures, or subsets thereof, or extensions thereof.
本申请实施例中,存储器1140可以包括只读存储器和随机存取存储器,并向处理器1120提供指令和数据。存储器1140的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。In this embodiment of the present application, the memory 1140 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1120 . A portion of memory 1140 may also include non-volatile random access memory (NVRAM).
本申请实施例中,存储器1140、通信接口1130以及处理器1120通过总线系统1110耦合在一起。其中,总线系统1110除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。为了便于描述,在图11中将各种总线都标为总线系统1110。In this embodiment of the present application, the memory 1140, the communication interface 1130 and the processor 1120 are coupled together through the bus system 1110. In addition to the data bus, the bus system 1110 may also include a power bus, a control bus, a status signal bus, etc. For ease of description, various buses are labeled as bus system 1110 in FIG. 11 .
上述本申请实施例描述的方法可以应用于处理器1120中,或者由处理器1120实现。处理器1120可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1120中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1120可以是通用处理器(例如,微处理器或常规处理器)、数字信号处理器(digitalsignal processing,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门、晶体管逻辑器件或分立硬件组件,处理器1120可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。The method described in the above embodiment of the present application can be applied to the processor 1120 or implemented by the processor 1120. The processor 1120 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 1120 . The above-mentioned processor 1120 may be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array. (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components, the processor 1120 can implement or execute the disclosed methods, steps and logical block diagrams in the embodiments of this application.
结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。其中,软件模块可以位于随机存储器、只读存储器、可编程只读存储器或带电可擦写可编程存储器(electricallyerasable programmable read only memory,EEPROM)等本领域成熟的存储介质中。该存储介质位于存储器1140,处理器1120读取存储器1140中的信息,结合其硬件完成上述方法的步骤。The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a storage medium mature in this field such as random access memory, read-only memory, programmable read-only memory, or electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 1140. The processor 1120 reads the information in the memory 1140 and completes the steps of the above method in combination with its hardware.
在上述实施例中,存储器存储的供处理器执行的指令可以以计算机程序产品的形式实现。其中,计算机程序产品可以是事先写入在存储器中,也可以是以软件形式下载并安装在存储器中。In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be written in the memory in advance, or may be downloaded and installed in the memory in the form of software.
计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。例如,可用介质可以包括磁性介质(例如,软盘、硬盘或磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。A computer program product includes one or more computer instructions. When computer program instructions are loaded and executed on a computer, processes or functions according to embodiments of the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., computer instructions may be transmitted from a website, computer, server or data center via a wired link (e.g. Coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (such as infrared, wireless, microwave, etc.) means to transmit to another website, computer, server or data center. The computer-readable storage medium can be Any available media that a computer can store or is a data storage device such as a server, data center, or other integrated server that includes one or more available media. For example, available media may include magnetic media (eg, floppy disks, hard disks, or tapes), optical media (eg, Digital versatile disc (digital versatile disc, DVD)), or semiconductor media (for example, solid state disk (solid state disk, SSD)), etc.
本申请实施例还提供了一种计算机可读存储介质。上述实施例中描述的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。计算机可读介质可以包括计算机存储介质和通信介质,还可以包括任何可以将计算机程序从一个地方传送到另一个地方的介质。存储介质可以是可由计算机访问的任何目标介质。An embodiment of the present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer-readable media may include computer storage media and communication media and may include any medium that can transfer a computer program from one place to another. The storage media can be any target media that can be accessed by the computer.
作为一种可能的设计,计算机可读介质可以包括紧凑型光盘只读储存器(compactdisc read-only memory,CD-ROM)、RAM、ROM、EEPROM或其它光盘存储器;计算机可读介质可以包括磁盘存储器或其它磁盘存储设备。而且,任何连接线也可以被适当地称为计算机可读介质。例如,如果使用同轴电缆,光纤电缆,双绞线,DSL或无线技术(如红外,无线电和微波)从网站,服务器或其它远程源传输软件,则同轴电缆,光纤电缆,双绞线,DSL或诸如红外,无线电和微波之类的无线技术包括在介质的定义中。如本文所使用的磁盘和光盘包括光盘(CD),激光盘,光盘,数字通用光盘(digital versatile disc,DVD),软盘和蓝光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光光学地再现数据。As a possible design, the computer-readable medium may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer-readable medium may include magnetic disk storage or other disk storage device. Furthermore, any connection line is also properly termed a computer-readable medium. For example, if coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies (such as infrared, radio and microwave) are used to transmit the Software from a website, server or other remote source, then coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and optical disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Reproduce data.
上述的组合也应包括在计算机可读介质的范围内。以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。Combinations of the above should also be included within the scope of computer-readable media. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, and all of them should be covered. within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN202211118962.8ACN116743908B (en) | 2022-09-13 | 2022-09-13 | Wallpaper display method and related device | 
| Application Number | Priority Date | Filing Date | Title | 
|---|---|---|---|
| CN202211118962.8ACN116743908B (en) | 2022-09-13 | 2022-09-13 | Wallpaper display method and related device | 
| Publication Number | Publication Date | 
|---|---|
| CN116743908Atrue CN116743908A (en) | 2023-09-12 | 
| CN116743908B CN116743908B (en) | 2024-03-26 | 
| Application Number | Title | Priority Date | Filing Date | 
|---|---|---|---|
| CN202211118962.8AActiveCN116743908B (en) | 2022-09-13 | 2022-09-13 | Wallpaper display method and related device | 
| Country | Link | 
|---|---|
| CN (1) | CN116743908B (en) | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| WO2025148685A1 (en)* | 2024-01-10 | 2025-07-17 | 荣耀终端股份有限公司 | Interface always on display method, electronic device, and computer-readable storage medium | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN101032184A (en)* | 2004-09-29 | 2007-09-05 | 株式会社爱可信 | Mobile communication device, application execution environment software for mobile communication device | 
| CN103037105A (en)* | 2012-12-24 | 2013-04-10 | 广东欧珀移动通信有限公司 | A method for automatically changing the theme of a user terminal device and the user terminal device | 
| US20140108951A1 (en)* | 2012-10-11 | 2014-04-17 | Motorola Mobility Llc | Method and Apparatus for Providing Adaptive Wallpaper Display for a Device Having Multiple Operating System Environments | 
| WO2016168961A1 (en)* | 2015-04-20 | 2016-10-27 | 华为技术有限公司 | Theme replacement method and apparatus for intelligent terminal | 
| CN109739590A (en)* | 2018-05-14 | 2019-05-10 | 北京字节跳动网络技术有限公司 | A kind of desktop wallpaper replacing options, device and equipment | 
| CN110187808A (en)* | 2019-05-30 | 2019-08-30 | 努比亚技术有限公司 | Dynamic wallpaper setting method, device and computer readable storage medium | 
| CN110209460A (en)* | 2019-06-10 | 2019-09-06 | Oppo广东移动通信有限公司 | A kind of implementation method of dynamic wallpaper, device, storage medium and terminal | 
| CN110688179A (en)* | 2019-08-30 | 2020-01-14 | 华为技术有限公司 | A display method and terminal device | 
| CN111209065A (en)* | 2019-12-31 | 2020-05-29 | Oppo广东移动通信有限公司 | Dynamic wallpaper setting method and device, storage medium and electronic equipment | 
| CN111209063A (en)* | 2018-11-22 | 2020-05-29 | 珠海格力电器股份有限公司 | Desktop theme preview method and system and intelligent terminal | 
| CN111240776A (en)* | 2019-12-31 | 2020-06-05 | Oppo广东移动通信有限公司 | Dynamic wallpaper setting method and device, storage medium and electronic equipment | 
| CN111240777A (en)* | 2019-12-31 | 2020-06-05 | Oppo广东移动通信有限公司 | Dynamic wallpaper generation method, device, storage medium and electronic device | 
| CN114510307A (en)* | 2022-01-28 | 2022-05-17 | 统信软件技术有限公司 | Dynamic wallpaper implementation method, computing device and storage medium | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| CN101032184A (en)* | 2004-09-29 | 2007-09-05 | 株式会社爱可信 | Mobile communication device, application execution environment software for mobile communication device | 
| US20140108951A1 (en)* | 2012-10-11 | 2014-04-17 | Motorola Mobility Llc | Method and Apparatus for Providing Adaptive Wallpaper Display for a Device Having Multiple Operating System Environments | 
| CN103037105A (en)* | 2012-12-24 | 2013-04-10 | 广东欧珀移动通信有限公司 | A method for automatically changing the theme of a user terminal device and the user terminal device | 
| WO2016168961A1 (en)* | 2015-04-20 | 2016-10-27 | 华为技术有限公司 | Theme replacement method and apparatus for intelligent terminal | 
| CN109739590A (en)* | 2018-05-14 | 2019-05-10 | 北京字节跳动网络技术有限公司 | A kind of desktop wallpaper replacing options, device and equipment | 
| CN111209063A (en)* | 2018-11-22 | 2020-05-29 | 珠海格力电器股份有限公司 | Desktop theme preview method and system and intelligent terminal | 
| CN110187808A (en)* | 2019-05-30 | 2019-08-30 | 努比亚技术有限公司 | Dynamic wallpaper setting method, device and computer readable storage medium | 
| CN110209460A (en)* | 2019-06-10 | 2019-09-06 | Oppo广东移动通信有限公司 | A kind of implementation method of dynamic wallpaper, device, storage medium and terminal | 
| CN110688179A (en)* | 2019-08-30 | 2020-01-14 | 华为技术有限公司 | A display method and terminal device | 
| CN111209065A (en)* | 2019-12-31 | 2020-05-29 | Oppo广东移动通信有限公司 | Dynamic wallpaper setting method and device, storage medium and electronic equipment | 
| CN111240776A (en)* | 2019-12-31 | 2020-06-05 | Oppo广东移动通信有限公司 | Dynamic wallpaper setting method and device, storage medium and electronic equipment | 
| CN111240777A (en)* | 2019-12-31 | 2020-06-05 | Oppo广东移动通信有限公司 | Dynamic wallpaper generation method, device, storage medium and electronic device | 
| CN114510307A (en)* | 2022-01-28 | 2022-05-17 | 统信软件技术有限公司 | Dynamic wallpaper implementation method, computing device and storage medium | 
| Title | 
|---|
| 樊旭峰;: "壁纸自动换 每天都有新感觉", 电脑迷, no. 16* | 
| Publication number | Priority date | Publication date | Assignee | Title | 
|---|---|---|---|---|
| WO2025148685A1 (en)* | 2024-01-10 | 2025-07-17 | 荣耀终端股份有限公司 | Interface always on display method, electronic device, and computer-readable storage medium | 
| Publication number | Publication date | 
|---|---|
| CN116743908B (en) | 2024-03-26 | 
| Publication | Publication Date | Title | 
|---|---|---|
| CN114518817B (en) | Display method, electronic device and storage medium | |
| CN115543159B (en) | Wallpaper display method, device, equipment and storage medium | |
| CN112767231A (en) | Layer composition method and device | |
| CN116302291B (en) | Application display method, electronic device and storage medium | |
| WO2023005751A1 (en) | Rendering method and electronic device | |
| CN117827300A (en) | Display method, graphic interface and related device | |
| CN116743908B (en) | Wallpaper display method and related device | |
| WO2024099206A1 (en) | Graphical interface processing method and apparatus | |
| CN116719587B (en) | Screen display method, electronic device and computer readable storage medium | |
| CN116737037B (en) | Stack management method in interface display and related device | |
| WO2023169276A1 (en) | Screen projection method, terminal device, and computer-readable storage medium | |
| CN115017487B (en) | Switching method for login account of electronic equipment and electronic equipment | |
| CN118113190A (en) | Window display method, electronic device and readable storage medium when application is started | |
| CN118363691A (en) | A window management method and electronic device | |
| CN116708888B (en) | Video recording method and related device | |
| CN116737291B (en) | Desktop application processing method and electronic equipment | |
| EP4610822A1 (en) | Interface display method and related apparatus | |
| CN119271316A (en) | Interface display method and related device | |
| CN116077940B (en) | Drawing processing method and related device in game application | |
| CN117762545A (en) | Wallpaper processing method and device, storage medium and electronic equipment | |
| WO2025167740A1 (en) | Display method, user interface, and related apparatus | |
| WO2024094046A1 (en) | Application display method, electronic device, and storage medium | |
| WO2025001279A1 (en) | Method for controlling terminal device by means of voice, and terminal device | |
| WO2024055875A1 (en) | Method for adding service card, and electronic device and computer-readable storage medium | |
| CN118502850A (en) | Data processing method and electronic equipment | 
| Date | Code | Title | Description | 
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address | ||
| CP03 | Change of name, title or address | Address after:Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after:Honor Terminal Co.,Ltd. Country or region after:China Address before:3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before:Honor Device Co.,Ltd. Country or region before:China |