Commit 8578cacc authored by Javinator9889's avatar Javinator9889

"Emergency" update - disabled some dynamic features

parent a4a5f410
## v1.1.1
+ New notifications handler - now they must notify when expected
+ New notifications handler - now you must get notified when expected
## v1.1.0
+ NEW: OkHttp for handling file downloading.
......
......@@ -42,7 +42,7 @@ android {
applicationId "com.javinator9889.handwashingreminder"
minSdkVersion 17
targetSdkVersion 29
versionCode 105
versionCode 106
versionName "1.1.1-${gitCommitHash}"
multiDexEnabled true
resConfigs "en", "es"
......
......@@ -116,9 +116,8 @@ class DynamicFeatureProgress : SplitCompatBaseActivity(),
SplitInstallSessionStatus.FAILED -> {
Toast.makeText(
this, getString(
R.string
.dynamic_module_loading_error
), Toast.LENGTH_LONG
R.string.dynamic_module_loading_error, state.errorCode),
Toast.LENGTH_LONG
).show()
Timber.e(
"Installation failed - error code: ${state.errorCode}"
......
......@@ -189,10 +189,10 @@ class LauncherActivity : AppCompatActivity() {
modules += AppIntro.MODULE_NAME
launchOnInstall = true
}
modules += if (isAtLeast(AndroidVersion.LOLLIPOP))
/*modules += if (isAtLeast(AndroidVersion.LOLLIPOP))
OkHttp.MODULE_NAME
else
OkHttpLegacy.MODULE_NAME
OkHttpLegacy.MODULE_NAME*/
if (googleApi.isGooglePlayServicesAvailable(
this,
GOOGLE_PLAY_SERVICES_MIN_VERSION
......
......@@ -40,6 +40,7 @@ class BootCompletedJob : BroadcastReceiver() {
else
app.activityHandler.disableActivityTracker()
try {
Timber.d("Enqueuing notifications as the device has rebooted")
with(WorkHandler(requireNotNull(context))) {
enqueuePeriodicNotificationsWorker()
}
......
......@@ -18,20 +18,18 @@
*/
package com.javinator9889.handwashingreminder.network
import com.javinator9889.handwashingreminder.utils.AndroidVersion
import com.javinator9889.handwashingreminder.utils.OkHttp
import com.javinator9889.handwashingreminder.utils.OkHttpLegacy
import com.javinator9889.handwashingreminder.utils.isAtLeast
import com.javinator9889.handwashingreminder.network.okhttp.OkHttpDownloader as Downloader
object HttpDownloader {
fun newInstance(): OkHttpDownloader {
val className = if (isAtLeast(AndroidVersion.LOLLIPOP))
/*val className = if (isAtLeast(AndroidVersion.LOLLIPOP))
"${OkHttp.PACKAGE_NAME}.${OkHttp.CLASS_NAME}\$${OkHttp.PROVIDER_NAME}"
else
"${OkHttpLegacy.PACKAGE_NAME}.${OkHttpLegacy
.CLASS_NAME}\$${OkHttpLegacy.PROVIDER_NAME}"
val okHttpProvider = Class.forName(className).kotlin.objectInstance
as OkHttpDownloader.Provider
return okHttpProvider.newInstance()
return okHttpProvider.newInstance()*/
return Downloader.newInstance()
}
}
\ No newline at end of file
/*
* Copyright © 2020 - present | Handwashing reminder by Javinator9889
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*
* Created by Javinator9889 on 21/04/20 - Handwashing reminder.
*/
package com.javinator9889.handwashingreminder.network.okhttp
import com.javinator9889.handwashingreminder.network.OkHttpDownloader
import okhttp3.CacheControl
import okhttp3.OkHttpClient
import okhttp3.Request
import okio.BufferedSource
import java.io.IOException
class OkHttpDownloader : OkHttpDownloader {
private val client = OkHttpClient()
companion object Provider : OkHttpDownloader.Provider {
override fun newInstance(): OkHttpDownloader = OkHttpDownloader()
}
override fun downloadFile(url: String): BufferedSource {
val request = with(Request.Builder()) {
url(url)
cacheControl(CacheControl.FORCE_NETWORK)
build()
}
with(client.newCall(request).execute()) {
if (!isSuccessful) {
close()
throw IOException("Unexpected code $this")
}
return body()!!.source()
}
}
}
\ No newline at end of file
......@@ -53,7 +53,7 @@
contenido a la aplicación para que funcione correctamente. Por favor,
espera un minuto - este proceso no debería durar mucho.</string>
<string name="dynamic_module_loading_error">¡Vaya! Algo ha ido
mal 😥 - intenta el proceso de nuevo</string>
mal 😥 - intenta el proceso de nuevo | código de error: %1$d</string>
<string name="done">Hecho</string>
<string name="preparing">Preparando…</string>
<string name="installing">Instalando…</string>
......
......@@ -52,7 +52,7 @@
content to the app so it works correctly. Please, wait a minute
- this process should not last long.</string>
<string name="dynamic_module_loading_error">Oops! Something went
wrong 😥 - please retry the process</string>
wrong 😥 - please retry the process | error code: %1$d</string>
<string name="done">Done</string>
<string name="preparing">Preparing…</string>
<string name="installing">Installing…</string>
......
......@@ -73,7 +73,7 @@ class IntroActivity : AppIntro2(),
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
SplitCompat.installActivity(base)
SplitCompat.installActivity(this)
}
override fun onCreate(savedInstanceState: Bundle?) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment