2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 05:07:40 +00:00

Make linter happy: keep nullable/nonnull annotations

This commit is contained in:
Albert Vaca Cintora 2023-03-06 00:01:05 +01:00
parent 00f3fc43d0
commit cef68db2a6
12 changed files with 22 additions and 15 deletions

View File

@ -19,6 +19,7 @@ import android.util.Base64;
import android.util.Log;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
import androidx.core.app.NotificationCompat;
@ -112,6 +113,7 @@ public class Device implements BaseLink.PacketReceiver {
return Computer; //Default
}
@NonNull
public String toString() {
switch (this) {
case Tablet:

View File

@ -10,6 +10,7 @@ import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceViewHolder;
@ -24,7 +25,7 @@ public class LongSummaryPreferenceCategory extends PreferenceCategory {
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
TextView summary = (TextView) holder.findViewById(android.R.id.summary);
summary.setMaxLines(3);

View File

@ -420,6 +420,7 @@ public class TelephonyHelper {
this.subscriptionID = subscriptionID;
}
@NonNull
@Override
public String toString() {
return number;

View File

@ -128,8 +128,9 @@ public class SftpSettingsFragment
}
}
@NonNull
@Override
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
protected RecyclerView.Adapter onCreateAdapter(@NonNull PreferenceScreen preferenceScreen) {
if (savedActionModeState != null) {
getListView().post(this::restoreActionMode);
}
@ -162,7 +163,7 @@ public class SftpSettingsFragment
}
@Override
public void onDisplayPreferenceDialog(Preference preference) {
public void onDisplayPreferenceDialog(@NonNull Preference preference) {
if (preference instanceof StoragePreference) {
StoragePreferenceDialogFragment fragment = StoragePreferenceDialogFragment.newInstance(preference.getKey());
fragment.setTargetFragment(this, 0);
@ -174,7 +175,7 @@ public class SftpSettingsFragment
}
@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
try {
@ -340,7 +341,7 @@ public class SftpSettingsFragment
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
SftpPlugin.StorageInfo newStorageInfo = (SftpPlugin.StorageInfo) newValue;
ListIterator<SftpPlugin.StorageInfo> it = storageInfoList.listIterator();

View File

@ -96,7 +96,7 @@ public class StoragePreference extends DialogPreference {
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
checkbox = (CheckBox) holder.itemView.findViewById(R.id.checkbox);

View File

@ -104,7 +104,7 @@ public class StoragePreferenceDialogFragment extends PreferenceDialogFragmentCom
}
@Override
protected void onBindDialogView(View view) {
protected void onBindDialogView(@NonNull View view) {
super.onBindDialogView(view);
binding = FragmentStoragePreferenceDialogBinding.bind(view);

View File

@ -100,7 +100,7 @@ public class AlertDialogFragment extends DialogFragment implements DialogInterfa
}
@Override
public void onCancel(DialogInterface dialog) {
public void onCancel(@NonNull DialogInterface dialog) {
super.onCancel(dialog);
if (callback != null) {
@ -109,7 +109,7 @@ public class AlertDialogFragment extends DialogFragment implements DialogInterfa
}
@Override
public void onDismiss(DialogInterface dialog) {
public void onDismiss(@NonNull DialogInterface dialog) {
super.onDismiss(dialog);
if (callback != null) {

View File

@ -368,7 +368,7 @@ public class MainActivity extends AppCompatActivity implements SharedPreferences
}
@Override
protected void onSaveInstanceState(Bundle outState) {
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(STATE_SELECTED_DEVICE, mCurrentDevice);
outState.putInt(STATE_SELECTED_MENU_ENTRY, mCurrentMenuEntry);

View File

@ -130,7 +130,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
}
@Override
public void onAttach(Context context) {
public void onAttach(@NonNull Context context) {
super.onAttach(context);
mActivity = ((MainActivity) getActivity());
}
@ -286,7 +286,7 @@ public class PairingFragment extends Fragment implements PairingDeviceItem.Callb
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public void onCreateOptionsMenu(@NonNull Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.pairing, menu);
}

View File

@ -49,7 +49,7 @@ setIcon(android.R.color.transparent);
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
public void onBindViewHolder(@NonNull PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
View.OnClickListener toggleListener = v -> {

View File

@ -93,8 +93,9 @@ public class PluginSettingsListFragment extends PreferenceFragmentCompat {
});
}
@NonNull
@Override
protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
protected RecyclerView.Adapter onCreateAdapter(@NonNull PreferenceScreen preferenceScreen) {
RecyclerView.Adapter adapter = super.onCreateAdapter(preferenceScreen);
/*
@ -144,7 +145,7 @@ public class PluginSettingsListFragment extends PreferenceFragmentCompat {
}
@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
Parcelable layoutManagerState = recyclerViewLayoutManagerState;

View File

@ -32,6 +32,7 @@ public class SettingsFragment extends PreferenceFragmentCompat {
private EditTextPreference renameDevice;
@NonNull
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
if (getActivity() != null) {