diff options
Diffstat (limited to 'core/java/android/service/wallpaper')
-rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 39f9367..713bb91 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -36,6 +36,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.os.Message; +import android.os.PowerManager; import android.os.Process; import android.os.RemoteException; import android.util.Log; @@ -716,7 +717,9 @@ public abstract class WallpaperService extends Service { mSession = ViewRootImpl.getWindowSession(getMainLooper()); mWindow.setSession(mSession); - + + mScreenOn = ((PowerManager)getSystemService(Context.POWER_SERVICE)).isScreenOn(); + IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_ON); filter.addAction(Intent.ACTION_SCREEN_OFF); |