From 1e6c1b4caa6421c2ac4250394d45fccb18ef6e9b Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 27 Oct 2024 07:14:39 -0400 Subject: [PATCH] add check to silence false positive lint warning The BootReceiver class is explicitly not exported so this won't improve anything but the lint expects it to be here. It didn't used to report an issue so it was likely a regression in the check. It makes more sense to add the check than silencing the lint in this case. --- app/src/main/java/app/attestation/auditor/BootReceiver.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/app/attestation/auditor/BootReceiver.java b/app/src/main/java/app/attestation/auditor/BootReceiver.java index b84d4614c..595a4ac5d 100644 --- a/app/src/main/java/app/attestation/auditor/BootReceiver.java +++ b/app/src/main/java/app/attestation/auditor/BootReceiver.java @@ -7,6 +7,9 @@ public class BootReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, final Intent intent) { + if (!Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + throw new IllegalStateException("invalid action"); + } RemoteVerifyJob.restore(context); } }