Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo: Release source code for 52.7 #162

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions android/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ follow [https://changelog.md/](https://changelog.md/) guidelines.

## [Unreleased]

## [52.7] - 2025-01-30

### ADDED

- Background notification processing reliability improvements

## [52.6] - 2025-01-14

### ADDED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import android.os.SystemClock
import io.muun.apollo.data.net.ConnectivityInfoProvider
import io.muun.apollo.data.net.NetworkInfoProvider
import io.muun.apollo.data.net.TrafficStatsInfoProvider
import io.muun.apollo.data.preferences.BackgroundTimesRepository
import io.muun.apollo.domain.model.BackgroundEvent
import kotlinx.serialization.Serializable
import javax.inject.Inject

Expand All @@ -30,6 +32,7 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
private val localeInfoProvider: LocaleInfoProvider,
private val trafficStatsInfoProvider: TrafficStatsInfoProvider,
private val nfcProvider: NfcProvider,
private val bkgTimesRepo: BackgroundTimesRepository,
) {

private val powerManager: PowerManager by lazy {
Expand Down Expand Up @@ -92,7 +95,8 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
nfcProvider.getNfcAntennaPosition().map { "${it.first};${it.second}" }.toTypedArray(),
nfcProvider.deviceSizeInMm?.let { "${it.first};${it.second}" } ?: "",
nfcProvider.isDeviceFoldable,
activityManagerInfoProvider.isBackgroundRestricted
activityManagerInfoProvider.isBackgroundRestricted,
bkgTimesRepo.getLatestBackgroundTimes()
)

@Suppress("ArrayInDataClass")
Expand Down Expand Up @@ -152,7 +156,8 @@ class BackgroundExecutionMetricsProvider @Inject constructor(
private val androidNfcAntennaPositions: Array<String>, // in mms starting bottom-left
private val androidDeviceSizeInMms: String,
private val androidFoldableDevice: Boolean?,
private val isBackgroundRestricted: Boolean
private val isBackgroundRestricted: Boolean,
private val bkgTimes: List<BackgroundEvent>,
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ class BackgroundTimesRepository @Inject constructor(
return backgroundTimesPreferences.get()!!.map { it.toModel() }
}

fun getLatestBackgroundTimes(): List<BackgroundEvent> {
return backgroundTimesPreferences.get()!!
.takeLast(10)
.map { it.toModel() }
}

fun pruneIfGreaterThan(maxBkgTimesArraySize: Int) {
val storedBkgTimes = getBackgroundTimes()
val bkgTimes = storedBkgTimes.takeLast(maxBkgTimesArraySize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class RepositoryRegistry {
NightModeRepository::class.java,
SchemaVersionRepository::class.java,
NotificationPermissionDeniedRepository::class.java,
NotificationPermissionSkippedRepository::class.java
NotificationPermissionSkippedRepository::class.java,
BackgroundTimesRepository::class.java
)

// Note: the use of a map is critical here for 2 reasons, both of them related to memory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.muun.apollo.domain.model

import kotlinx.serialization.Serializable

@Serializable
class BackgroundEvent(
val beginTimeInMillis: Long,
val durationInMillis: Long,
Expand Down
4 changes: 2 additions & 2 deletions android/apolloui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ android {
applicationId "io.muun.apollo"
minSdk 19
targetSdk 34
versionCode 1206
versionName "52.6"
versionCode 1207
versionName "52.7"

// Needed to make sure these classes are available in the main DEX file for API 19
// See: https://spin.atomicobject.com/2018/07/16/support-kitkat-multidex/
Expand Down