summaryrefslogtreecommitdiffstats
path: root/core/java/android/service/wallpaper
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-09-09 13:02:43 -0700
committerDianne Hackborn <hackbod@google.com>2011-09-09 13:02:43 -0700
commit9fe6cb5cc2cc86a370d47afc44d27fa7086a15be (patch)
tree859b4731c2d966d332cde5e1d023c817c710552f /core/java/android/service/wallpaper
parent4ee366690111e5f71a248a2af10301db425162d5 (diff)
downloadframeworks_base-9fe6cb5cc2cc86a370d47afc44d27fa7086a15be.zip
frameworks_base-9fe6cb5cc2cc86a370d47afc44d27fa7086a15be.tar.gz
frameworks_base-9fe6cb5cc2cc86a370d47afc44d27fa7086a15be.tar.bz2
Fix issue #5273986: The power usage of the mp3 background playback...
...increased from ~50mA to 260mA Change-Id: I24d7188185f4ec5ff9e1f29c15472ae56c851e5e
Diffstat (limited to 'core/java/android/service/wallpaper')
-rw-r--r--core/java/android/service/wallpaper/WallpaperService.java5
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);