From b60de97967b7a252762640a8917c24e4211df7c1 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 14 Dec 2017 14:32:46 +0100 Subject: #8742 fix lint issue in OnBootReceiver --- app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java index 70358580..b151f40a 100644 --- a/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java +++ b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java @@ -6,6 +6,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.util.Log; +import static android.content.Intent.ACTION_BOOT_COMPLETED; import static se.leap.bitmaskclient.eip.Constants.IS_ALWAYS_ON; import static se.leap.bitmaskclient.eip.Constants.RESTART_ON_BOOT; import static se.leap.bitmaskclient.eip.Constants.VPN_CERTIFICATE; @@ -14,10 +15,13 @@ public class OnBootReceiver extends BroadcastReceiver { SharedPreferences preferences; - // Debug: su && am broadcast -a android.intent.action.BOOT_COMPLETED @Override public void onReceive(Context context, Intent intent) { + //Lint complains if we're not checking the intent action + if (intent == null || !ACTION_BOOT_COMPLETED.equals(intent.getAction())) { + return; + } preferences = context.getSharedPreferences(Dashboard.SHARED_PREFERENCES, Context.MODE_PRIVATE); boolean providerConfigured = !preferences.getString(VPN_CERTIFICATE, "").isEmpty(); boolean startOnBoot = preferences.getBoolean(RESTART_ON_BOOT, false); -- cgit v1.2.3