We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d67ff5c + 9fe6cb5 commit 104f6a0Copy full SHA for 104f6a0
1 file changed
core/java/android/service/wallpaper/WallpaperService.java
@@ -36,6 +36,7 @@
36
import android.os.IBinder;
37
import android.os.Looper;
38
import android.os.Message;
39
+import android.os.PowerManager;
40
import android.os.Process;
41
import android.os.RemoteException;
42
import android.util.Log;
@@ -716,7 +717,9 @@ void attach(IWallpaperEngineWrapper wrapper) {
716
717
mSession = ViewRootImpl.getWindowSession(getMainLooper());
718
719
mWindow.setSession(mSession);
-
720
+
721
+ mScreenOn = ((PowerManager)getSystemService(Context.POWER_SERVICE)).isScreenOn();
722
723
IntentFilter filter = new IntentFilter();
724
filter.addAction(Intent.ACTION_SCREEN_ON);
725
filter.addAction(Intent.ACTION_SCREEN_OFF);
0 commit comments