Fix:5175 Upgraded Minimum SDK Version, Compile and Target SDK Version (#5177)

* Kotlin Version Upgraded to 1.6.10

* Kotlin Version Upgraded to 1.6.20

* Kotlin Version Upgraded to 1.7.20

* Fix:5175 Upgraded Minimum SDK Version, Compile and Target SDK Version
This commit is contained in:
Kartikay Kaushik 2023-03-16 02:02:35 -07:00 committed by GitHub
parent 66e15a17ef
commit 9b0b936c62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 63 deletions

View file

@ -61,7 +61,8 @@
android:configChanges="screenSize|keyboard|orientation"
android:parentActivityName=".customselector.ui.selector.CustomSelectorActivity" />
<activity android:name=".auth.LoginActivity">
<activity android:name=".auth.LoginActivity"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
@ -77,6 +78,7 @@
<activity
android:hardwareAccelerated="false"
android:name=".upload.UploadActivity"
android:exported="true"
android:configChanges="orientation|screenSize|keyboard"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@ -235,7 +237,8 @@
android:label="@string/provider_bookmarks_location"
android:syncable="false" />
<receiver android:name=".widget.PicOfDayAppWidget">
<receiver android:name=".widget.PicOfDayAppWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

View file

@ -24,8 +24,6 @@ import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipeline;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.mapbox.mapboxsdk.Mapbox;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import fr.free.nrw.commons.auth.SessionManager;
import fr.free.nrw.commons.bookmarks.items.BookmarkItemsDao.Table;
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
@ -55,6 +53,7 @@ import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Named;
import leakcanary.ObjectWatcher;
import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraDialog;
@ -122,7 +121,7 @@ public class CommonsApplication extends MultiDexApplication {
* Constants End
*/
private RefWatcher refWatcher;
private ObjectWatcher objectWatcher;
private static CommonsApplication INSTANCE;
@ -193,9 +192,6 @@ public class CommonsApplication extends MultiDexApplication {
// or from Observables that are (deliberately or not) missing an onError handler.
RxJavaPlugins.setErrorHandler(Functions.emptyConsumer());
if (setupLeakCanary() == RefWatcher.DISABLED) {
return;
}
// Fire progress callbacks for every 3% of uploaded content
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
}
@ -273,26 +269,14 @@ public class CommonsApplication extends MultiDexApplication {
}
/**
* Helps in setting up LeakCanary library
*
* @return instance of LeakCanary
*/
protected RefWatcher setupLeakCanary() {
if (LeakCanary.isInAnalyzerProcess(this)) {
return RefWatcher.DISABLED;
}
return LeakCanary.install(this);
}
/**
* Provides a way to get member refWatcher
* Provides a way to get member objectWatcher
*
* @param context Application context
* @return application member refWatcher
* @return application member objectWatcher
*/
public static RefWatcher getRefWatcher(Context context) {
public static ObjectWatcher getObjectWatcher(Context context) {
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
return application.refWatcher;
return application.objectWatcher;
}
/**

View file

@ -138,6 +138,18 @@ class ImageLoader @Inject constructor(
is Result.TRUE -> {
mapResult[imageSHA1] = Result.TRUE
}
is Result.ERROR -> {
mapResult[imageSHA1] = Result.ERROR
}
is Result.FALSE -> {
mapResult[imageSHA1] = Result.FALSE
}
is Result.INVALID -> {
mapResult[imageSHA1] = Result.INVALID
}
is Result.NOTFOUND -> {
mapResult[imageSHA1] = Result.NOTFOUND
}
}
}
else -> {
@ -160,6 +172,18 @@ class ImageLoader @Inject constructor(
is Result.TRUE -> {
mapResult[sha1] = Result.TRUE
}
is Result.ERROR -> {
mapResult[sha1] = Result.ERROR
}
is Result.FALSE -> {
mapResult[sha1] = Result.FALSE
}
is Result.INVALID -> {
mapResult[sha1] = Result.INVALID
}
is Result.NOTFOUND -> {
mapResult[sha1] = Result.NOTFOUND
}
}
}
else -> {

View file

@ -86,7 +86,7 @@ class LanguagesAdapter constructor(
}
fun getIndexOfUserDefaultLocale(context: Context): Int {
return language.codes.indexOf(context.locale.language)
return language.codes.indexOf(context.locale!!.language)
}
fun getIndexOfLanguageCode(languageCode: String): Int {
@ -138,5 +138,5 @@ class LanguagesAdapter constructor(
}
private val Context.locale: Locale
private val Context.locale: Locale?
get() = ConfigurationCompat.getLocales(resources.configuration)[0]