diff options
author | cyBerta <cyberta@riseup.net> | 2017-12-14 14:32:46 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2017-12-14 14:32:46 +0100 |
commit | b60de97967b7a252762640a8917c24e4211df7c1 (patch) | |
tree | dadca0710c678592dcae6f6464b42c742224151e | |
parent | 63d806d5e7de82526d9376925dcb17dac819aa45 (diff) |
#8742 fix lint issue in OnBootReceiver
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java | 6 |
1 files changed, 5 insertions, 1 deletions
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); |