From 4c5c67ae582dd9ee0032ae4880430439f4d3d8b8 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Mon, 18 Dec 2023 16:10:01 +0100 Subject: [PATCH 1/3] Updated Boradcast reciever to do nothing if key is null --- .../ooniprobe/common/service/RunTestService.java | 3 +++ .../ooniprobe/receiver/TestRunBroadRequestReceiver.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java b/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java index d35a95798..d0ae9ddcc 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java @@ -209,6 +209,9 @@ public void onReceive(Context context, Intent intent) { ) { return; } + if (key == null) { + return; + } switch (key) { case TestAsyncTask.RUN: Log.d(TAG, "TestAsyncTask.RUN"); diff --git a/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java b/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java index 668d8933f..813fe82ef 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java @@ -49,6 +49,10 @@ public TestRunBroadRequestReceiver(PreferenceManager preferenceManager, EventLis public void onReceive(Context context, Intent intent) { String key = intent.getStringExtra("key"); String value = intent.getStringExtra("value"); + // If either key is null, do nothing + if (key == null) { + return; + } switch (key) { case TestAsyncTask.START: listener.onStart(service); From 04bace0a298ffebcf4e265b14584a9b2f5c8fcd1 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Mon, 18 Dec 2023 17:08:14 +0100 Subject: [PATCH 2/3] Update app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java --- .../ooniprobe/receiver/TestRunBroadRequestReceiver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java b/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java index 813fe82ef..bdf7455b6 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/receiver/TestRunBroadRequestReceiver.java @@ -49,7 +49,7 @@ public TestRunBroadRequestReceiver(PreferenceManager preferenceManager, EventLis public void onReceive(Context context, Intent intent) { String key = intent.getStringExtra("key"); String value = intent.getStringExtra("value"); - // If either key is null, do nothing + // If key is null, do nothing if (key == null) { return; } From 47c87d7f354e2602283851d783f5e19dea1cee6f Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Mon, 18 Dec 2023 17:08:52 +0100 Subject: [PATCH 3/3] Update app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java --- .../openobservatory/ooniprobe/common/service/RunTestService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java b/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java index d0ae9ddcc..d065b1f3b 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/common/service/RunTestService.java @@ -209,6 +209,7 @@ public void onReceive(Context context, Intent intent) { ) { return; } + // If key is null, do nothing if (key == null) { return; }