Fix errors reported by lint

This commit is contained in:
Dominik Schürmann 2020-07-01 22:41:19 +02:00
parent 0034e1faff
commit 14996c1eca
10 changed files with 19 additions and 6 deletions

View File

@ -29,6 +29,7 @@ android {
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
minSdkVersion 14
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 25
/*
The Android Testing Support Library collects analytics to continuously improve the testing

View File

@ -692,6 +692,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, intent);
if (scanResult != null) {
if (scanResult.getContents() != null) {

View File

@ -5,13 +5,15 @@ import android.system.ErrnoException;
import android.system.Os;
import android.system.StructStat;
import androidx.annotation.RequiresApi;
import java.io.File;
/**
* Helper class to prevent {@link VerifyError}s from occurring in {@link CleanCacheService#clearOldFiles(File, long)}
* due to the fact that {@link Os} was only introduced in API 21.
*/
@TargetApi(21)
@RequiresApi(21)
class CleanCacheService21 {
static void deleteIfOld(File file, long olderThan) {
if (file == null || !file.exists()) {

View File

@ -5,6 +5,8 @@ import android.os.Build;
import android.system.ErrnoException;
import android.util.Log;
import androidx.annotation.RequiresApi;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.SanitizedFile;
@ -40,6 +42,7 @@ public class FileCompat {
* not attempt to load this class at runtime. Otherwise, using the Os.symlink method will cause
* a VerifyError to be thrown at runtime when the FileCompat class is first used.
*/
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
private static class Symlink21 {
@TargetApi(21)

View File

@ -158,6 +158,7 @@ public class DefaultInstallerActivity extends FragmentActivity {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQUEST_CODE_INSTALL:
switch (resultCode) {

View File

@ -1,15 +1,16 @@
package org.fdroid.fdroid.qr;
import android.annotation.TargetApi;
import android.content.Context;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.os.Build;
import androidx.annotation.NonNull;
import android.util.Log;
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
public class CameraCharacteristicsMinApiLevel21 extends CameraCharacteristicsChecker {
private static final String TAG = "CameraCharMinApiLevel21";

View File

@ -306,6 +306,7 @@ public class AppDetailsActivity extends AppCompatActivity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQUEST_ENABLE_BLUETOOTH:
fdroidApp.sendViaBluetooth(this, resultCode, app.packageName);

View File

@ -140,6 +140,7 @@ public class ManageReposActivity extends AppCompatActivity
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}

View File

@ -173,6 +173,7 @@ public class RepoDetailsActivity extends AppCompatActivity {
@Override
public void onNewIntent(Intent i) {
super.onNewIntent(i);
// onResume gets called after this to handle the intent
setIntent(i);
}

View File

@ -1,4 +1,5 @@
<!-- Taken from here: https://stackoverflow.com/a/53969021 -->
<resources xmlns:tools="http://schemas.android.com/tools">
<bool name="config_materialPreferenceIconSpaceReserved" tools:ignore="MissingDefaultResource,PrivateResource">false</bool>
<dimen name="preference_category_padding_start" tools:ignore="MissingDefaultResource,PrivateResource">0dp</dimen>
<bool name="config_materialPreferenceIconSpaceReserved" tools:ignore="MissingDefaultResource,PrivateResource,UnusedResources">false</bool>
<dimen name="preference_category_padding_start" tools:ignore="MissingDefaultResource,PrivateResource,UnusedResources">0dp</dimen>
</resources>