mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-04-18 07:11:12 +02: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;
|
return;
|
||||||
}
|
}
|
||||||
PowerManager.WakeLock wakeLock = null;
|
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);
|
PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Payload.class.getSimpleName());
|
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Payload.class.getSimpleName());
|
||||||
wakeLock.acquire();
|
wakeLock.acquire();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user