Loading app/build.gradle +3 −4 Original line number Diff line number Diff line Loading @@ -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' } Loading Loading @@ -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' } app/src/main/java/net/fabiszewski/ulogger/ImageHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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)) { Loading app/src/main/java/net/fabiszewski/ulogger/LocationHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.preference.PreferenceManager; import java.util.ArrayList; import java.util.List; import java.util.Objects; class LocationHelper { Loading Loading @@ -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; } Loading @@ -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; } Loading app/src/main/java/net/fabiszewski/ulogger/MainFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } } Loading app/src/main/java/net/fabiszewski/ulogger/PermissionHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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
app/build.gradle +3 −4 Original line number Diff line number Diff line Loading @@ -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' } Loading Loading @@ -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' }
app/src/main/java/net/fabiszewski/ulogger/ImageHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -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(); Loading Loading @@ -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)) { Loading
app/src/main/java/net/fabiszewski/ulogger/LocationHelper.java +3 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import androidx.preference.PreferenceManager; import java.util.ArrayList; import java.util.List; import java.util.Objects; class LocationHelper { Loading Loading @@ -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; } Loading @@ -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; } Loading
app/src/main/java/net/fabiszewski/ulogger/MainFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } } Loading
app/src/main/java/net/fabiszewski/ulogger/PermissionHelper.java +2 −2 Original line number Diff line number Diff line Loading @@ -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; } Loading @@ -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; } }