From 1a5c9778a59a8cc5391230c273b4d8f842a46992 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Sun, 26 Jul 2020 12:01:53 +0200 Subject: JobIntentServices leak activity context in APIs < 25, use application context instead --- app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java | 6 +++--- app/src/main/java/se/leap/bitmaskclient/eip/EipCommand.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java b/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java index 9a0731cd..8de90af2 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderAPICommand.java @@ -19,14 +19,14 @@ public class ProviderAPICommand { private Provider provider; private ProviderAPICommand(@NotNull Context context, @NotNull String action, @NotNull Provider provider, ResultReceiver resultReceiver) { - this(context, action, Bundle.EMPTY, provider, resultReceiver); + this(context.getApplicationContext(), action, Bundle.EMPTY, provider, resultReceiver); } private ProviderAPICommand(@NotNull Context context, @NotNull String action, @NotNull Provider provider) { - this(context, action, Bundle.EMPTY, provider); + this(context.getApplicationContext(), action, Bundle.EMPTY, provider); } private ProviderAPICommand(@NotNull Context context, @NotNull String action, @NotNull Bundle parameters, @NotNull Provider provider) { - this(context, action, parameters, provider, null); + this(context.getApplicationContext(), action, parameters, provider, null); } private ProviderAPICommand(@NotNull Context context, @NotNull String action, @NotNull Bundle parameters, @NotNull Provider provider, @Nullable ResultReceiver resultReceiver) { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EipCommand.java b/app/src/main/java/se/leap/bitmaskclient/eip/EipCommand.java index 1f5b3741..1ee32654 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EipCommand.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EipCommand.java @@ -27,7 +27,7 @@ import static se.leap.bitmaskclient.Constants.EIP_RECEIVER; public class EipCommand { private static void execute(@NotNull Context context, @NotNull String action) { - execute(context, action, null, null); + execute(context.getApplicationContext(), action, null, null); } /** -- cgit v1.2.3