简体   繁体   English

Android:还原动态壁纸

[英]Android : Restoring a Live Wallpaper

I have to implement an app which temporary changes the wallpaper. 我必须实现一个临时更改墙纸的应用程序。 After some time the original wallpaper has to be restored. 一段时间后,必须还原原始墙纸。 This is easy to implement for static wallpapers. 对于静态墙纸,这很容易实现。 But I want to replace a live wallpaper by a static one and after some time i want to restore the live wallpaper. 但是我想用一个静态墙纸代替动态墙纸,过一段时间后我想恢复动态墙纸。

After setting my temporary wallpaper I see that wallpaperinfo of the previous live wallpaper is still present. 设置我的临时墙纸后,我看到以前的动态墙纸的wallpaperinfo仍然存在。 I tried to start the (android) live wallpaper service using this information but I got a security exception. 我尝试使用此信息启动(android)动态壁纸服务,但出现了安全异常。

What happens with live wallpaper service when I set a static wallpaper. 当我设置静态墙纸时,动态墙纸服务会怎样? I think it is implementation dependent. 我认为这取决于实现。 To restart the wallpaper service is not possable because the (android)live paper service does not set "export" attribute (my guess). 重新启动壁纸服务是不可能的,因为(android)动态文件服务未设置“导出”属性(我的猜测)。

Is there a possibility to simply remove my static wallpaper and let the wallpaper service continue its work ? 是否可以简单地删除我的静态墙纸并让墙纸服务继续工作?

Setting live wallpapers are reserved for platform applications, eg the live wallpaper picker bundled with the device (the permission android.permission.SET_WALLPAPER_COMPONENT is defined as signatureOrSystem ). 设置动态壁纸保留给平台应用程序,例如与设备捆绑在一起的动态壁纸选择器(将android.permission.SET_WALLPAPER_COMPONENT权限定义为signatureOrSystem )。

In short, you're not going to be able to do this without either rooting the device or building your own platform. 简而言之,如果不生根设备或构建自己的平台,您将无法做到这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM