Skip to content

Commit 104f6a0

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue #5273986: The power usage of the mp3 background playback..."
2 parents d67ff5c + 9fe6cb5 commit 104f6a0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

core/java/android/service/wallpaper/WallpaperService.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import android.os.IBinder;
3737
import android.os.Looper;
3838
import android.os.Message;
39+
import android.os.PowerManager;
3940
import android.os.Process;
4041
import android.os.RemoteException;
4142
import android.util.Log;
@@ -716,7 +717,9 @@ void attach(IWallpaperEngineWrapper wrapper) {
716717
mSession = ViewRootImpl.getWindowSession(getMainLooper());
717718

718719
mWindow.setSession(mSession);
719-
720+
721+
mScreenOn = ((PowerManager)getSystemService(Context.POWER_SERVICE)).isScreenOn();
722+
720723
IntentFilter filter = new IntentFilter();
721724
filter.addAction(Intent.ACTION_SCREEN_ON);
722725
filter.addAction(Intent.ACTION_SCREEN_OFF);

0 commit comments

Comments
 (0)