mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-24 18:16:24 +01:00
Land #381, check if context is null before applying wakelock
This commit is contained in:
commit
dbac98fed7
@ -110,7 +110,7 @@ public class Payload {
|
||||
return;
|
||||
}
|
||||
PowerManager.WakeLock wakeLock = null;
|
||||
if ((config.flags & Config.FLAG_WAKELOCK) != 0) {
|
||||
if ((config.flags & Config.FLAG_WAKELOCK) != 0 && context != null) {
|
||||
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Payload.class.getSimpleName());
|
||||
wakeLock.acquire();
|
||||
|
Loading…
x
Reference in New Issue
Block a user