Merge pull request #1280 from Xefir/fix-npe-wallpaper-service
Fix NPE on Wallpaper Service
This commit is contained in:
commit
895947578e
|
@ -115,12 +115,14 @@ public class NyanWallpaperService extends WallpaperService implements NyanConsta
|
|||
|
||||
private void updateHelperState() {
|
||||
final PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
|
||||
if (pm != null) {
|
||||
if (pm.isScreenOn()) {
|
||||
mHelper.start();
|
||||
} else {
|
||||
mHelper.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSurface() {
|
||||
if (mPreferences == null) return;
|
||||
|
|
Loading…
Reference in New Issue