Commit 8c858204 authored by Bartek Fabiszewski's avatar Bartek Fabiszewski
Browse files

Target API 34, upgrade Gradle to 8, fix warnings

parent 619041ec
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -10,13 +10,12 @@
apply plugin: 'com.android.application'

android {
    compileSdkVersion 33
    buildToolsVersion '33.0.0'
    compileSdk 34

    defaultConfig {
        applicationId 'net.fabiszewski.ulogger'
        minSdkVersion 21
        targetSdkVersion 33
        targetSdkVersion 34
        versionCode 309
        versionName '3.9'
    }
@@ -45,7 +44,7 @@ android {
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.preference:preference:1.2.0'
    implementation 'androidx.preference:preference:1.2.1'
    implementation 'androidx.exifinterface:exifinterface:1.3.6'
    testImplementation 'junit:junit:4.13.2'
}
+2 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Objects;

class ImageHelper {
    private static final String TAG = ImageHelper.class.getSimpleName();
@@ -171,7 +172,7 @@ class ImageHelper {
        int sizePx = getThumbnailSize(context);
        Bitmap bitmap;
        ContentResolver cr = context.getContentResolver();
        if (uri.getScheme().equals("content") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
        if (Objects.equals(uri.getScheme(), "content") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
            bitmap = cr.loadThumbnail(uri, new Size(sizePx, sizePx), null);
        } else {
            try (InputStream is = cr.openInputStream(uri)) {
+3 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import androidx.preference.PreferenceManager;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

class LocationHelper {

@@ -269,7 +270,7 @@ class LocationHelper {
     * @return True if is from GPS
     */
    static boolean isGps(@NonNull Location location) {
        boolean ret = location.getProvider().equals(LocationManager.GPS_PROVIDER);
        boolean ret = Objects.equals(location.getProvider(), LocationManager.GPS_PROVIDER);
        if (Logger.DEBUG) { Log.d(TAG, "[isGps: " + ret + "]"); }
        return ret;
    }
@@ -280,7 +281,7 @@ class LocationHelper {
     * @return True if is from Network
     */
    static boolean isNetwork(@NonNull Location location) {
        boolean ret = location.getProvider().equals(LocationManager.NETWORK_PROVIDER);
        boolean ret = Objects.equals(location.getProvider(), LocationManager.NETWORK_PROVIDER);
        if (Logger.DEBUG) { Log.d(TAG, "[isNetwork: " + ret + "]"); }
        return ret;
    }
+1 −1
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ public class MainFragment extends Fragment implements PermissionHelper.Permissio
            filter.addAction(LoggerService.BROADCAST_LOCATION_PERMISSION_DENIED);
            filter.addAction(WebSyncService.BROADCAST_SYNC_DONE);
            filter.addAction(WebSyncService.BROADCAST_SYNC_FAILED);
            context.registerReceiver(broadcastReceiver, filter);
            ContextCompat.registerReceiver(context, broadcastReceiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED);
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ public class PermissionHelper {
        CharSequence label = ctx.getPackageManager().getBackgroundPermissionOptionLabel();
        CharSequence defaultLabel = "Allow all the time";

        if (Locale.getDefault().getLanguage().equals("en")) {
        if ("en".equals(Locale.getDefault().getLanguage())) {
            return label.length() > 0 ? label : defaultLabel;
        }

@@ -311,6 +311,6 @@ public class PermissionHelper {
        config.setLocale(Locale.ENGLISH);
        CharSequence defaultText = ctx.createConfigurationContext(config).getText(R.string.background_location_rationale);

        return translated.equals(defaultText) ? defaultLabel : label;
        return CharSequence.compare(translated, defaultText) == 0 ? defaultLabel : label;
    }
}
Loading