Skip to content

Commit

Permalink
Dependency update
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
dkrivoruchko committed Jun 21, 2022
1 parent 9e4a896 commit 3e94826
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId = "info.dvkr.screenstream"
minSdkVersion(21)
targetSdkVersion(32)
versionCode = 30900
versionName = "3.9.0"
versionCode = 30902
versionName = "3.9.2"
resConfigs 'en', 'ru', 'pt-rBR', 'zh-rTW', 'fr-rFR', 'fa', 'it', 'pl', 'hi', 'de', 'sk', 'es', 'ar', 'ja', 'gl', 'ca', 'uk', 'nl'

vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -91,8 +91,8 @@ dependencies {

implementation(project(":data"))

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3")

implementation("androidx.core:core-ktx:1.8.0")
implementation("androidx.activity:activity-ktx:1.4.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,31 @@ abstract class AppUpdateActivity(@LayoutRes contentLayoutId: Int) : BaseActivity
AppUpdateManagerFactory.create(this).requestUpdateFlow().onEach { appUpdateResult ->
when (appUpdateResult) {
AppUpdateResult.NotAvailable -> {
XLog.v(getLog("AppUpdateResult.NotAvailable"))
XLog.v(this@AppUpdateActivity.getLog("AppUpdateResult.NotAvailable"))
}
is AppUpdateResult.Available -> {
XLog.d(getLog("AppUpdateResult.Available"))
XLog.d(this@AppUpdateActivity.getLog("AppUpdateResult.Available"))
if (appUpdateResult.updateInfo.isFlexibleUpdateAllowed) {
XLog.d(getLog("AppUpdateResult.Available", "FlexibleUpdateAllowed"))
XLog.d(this@AppUpdateActivity.getLog("AppUpdateResult.Available", "FlexibleUpdateAllowed"))
val lastRequestMillisPassed =
System.currentTimeMillis() - settings.lastUpdateRequestMillisFlow.first()
if (lastRequestMillisPassed >= APP_UPDATE_REQUEST_TIMEOUT) {
XLog.d(getLog("AppUpdateResult.Available", "startFlexibleUpdate"))
XLog.d(this@AppUpdateActivity.getLog("AppUpdateResult.Available", "startFlexibleUpdate"))
settings.setLastUpdateRequestMillis(System.currentTimeMillis())
appUpdateResult.startFlexibleUpdate(this, APP_UPDATE_FLEXIBLE_REQUEST_CODE)
}
}
}
is AppUpdateResult.InProgress -> {
XLog.v(getLog("AppUpdateResult.InProgress", appUpdateResult.installState.toString()))
XLog.v(this@AppUpdateActivity.getLog("AppUpdateResult.InProgress", appUpdateResult.installState.toString()))
}
is AppUpdateResult.Downloaded -> {
XLog.d(getLog("AppUpdateResult.Downloaded"))
XLog.d(this@AppUpdateActivity.getLog("AppUpdateResult.Downloaded"))
showUpdateConfirmationDialog(appUpdateResult)
}
}
}
.catch { cause -> XLog.e(getLog("AppUpdateManager.requestUpdateFlow.catch: $cause"), cause) }
.catch { cause -> XLog.e(this@AppUpdateActivity.getLog("AppUpdateManager.requestUpdateFlow.catch: $cause"), cause) }
.launchIn(lifecycleScope)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ abstract class PermissionActivity(@LayoutRes contentLayoutId: Int) : ServiceActi
}
}

@Deprecated("Deprecated in Java")
@Suppress("DEPRECATION")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == SCREEN_CAPTURE_REQUEST_CODE) {
Expand Down
2 changes: 1 addition & 1 deletion data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.7.0")

implementation("androidx.core:core:1.8.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ internal class HttpServer(
XLog.d(getLog("startServer"))

val coroutineExceptionHandler = CoroutineExceptionHandler { _, throwable ->
XLog.e(getLog("onCoroutineException", throwable.toString()), throwable)
XLog.d(getLog("onCoroutineException", "ktorServer: ${ktorServer?.hashCode()}"))
XLog.e(getLog("onCoroutineException", throwable.toString()), throwable)
if (throwable is IOException) return@CoroutineExceptionHandler
ktorServer?.stop(0, 250)
ktorServer = null
when (throwable) {
is BindException -> sendEvent(Event.Error(FixableError.AddressInUseException))
is IOException -> Unit // Ignore
else -> sendEvent(Event.Error(FatalError.HttpServerException))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ class AppStateMachineImpl(

override suspend fun destroy() {
XLog.d(getLog("destroy"))
wakeLock?.release()
wakeLock = null

sendEvent(InternalEvent.Destroy)
httpServer.destroy().await()
broadcastHelper.stopListening()
connectivityHelper.stopListening()
coroutineScope.cancel()

mediaProjectionIntent = null

wakeLock?.release()
wakeLock = null
}

private fun onError(appError: AppError) {
Expand Down Expand Up @@ -322,7 +322,7 @@ class AppStateMachineImpl(
}

private suspend fun startProjection(streamState: StreamState, intent: Intent): StreamState {
XLog.d(getLog("startProjection"))
XLog.d(getLog("startProjection", "Intent: ${intent?.toString()}"))

mediaProjectionIntent = intent
val mediaProjection = withContext(Dispatchers.Main) {
Expand Down

0 comments on commit 3e94826

Please sign in to comment.