From 862bd43c63bd797d1f4fcf4134b09f76e0ba2ba1 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Sun, 12 May 2024 16:06:38 +0200 Subject: [PATCH] Fix warning --- .../Plugins/TelephonyPlugin/TelephonyPlugin.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java b/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java index dd5e0cb7..36a07718 100644 --- a/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/TelephonyPlugin/TelephonyPlugin.java @@ -105,10 +105,11 @@ public class TelephonyPlugin extends Plugin { String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE); int intState = TelephonyManager.CALL_STATE_IDLE; - if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) + if (TelephonyManager.EXTRA_STATE_RINGING.equals(state)) { intState = TelephonyManager.CALL_STATE_RINGING; - else if (state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) + } else if (TelephonyManager.EXTRA_STATE_OFFHOOK.equals(state)) { intState = TelephonyManager.CALL_STATE_OFFHOOK; + } // We will get a second broadcast with the phone number https://developer.android.com/reference/android/telephony/TelephonyManager#ACTION_PHONE_STATE_CHANGED if (!intent.hasExtra(TelephonyManager.EXTRA_INCOMING_NUMBER)) @@ -332,7 +333,7 @@ public class TelephonyPlugin extends Plugin { } @Override - public PluginSettingsFragment getSettingsFragment(Activity activity) { + public PluginSettingsFragment getSettingsFragment(@NonNull Activity activity) { return PluginSettingsFragment.newInstance(getPluginKey(), R.xml.telephonyplugin_preferences); } }