srctree

Robin Linden parent ddbac3e7 f04aa732
Target Android 14

atox/src/main/AndroidManifest.xml added: 27, removed: 10, total 17
@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
@@ -19,7 +20,13 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service android:name=".ToxService" android:exported="false"/>
<service android:name=".ToxService"
android:exported="false"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="serverless peer-to-peer messaging" />
</service>
 
<receiver android:name=".BootReceiver" android:enabled="false" android:exported="false">
<intent-filter>
 
atox/src/main/kotlin/ToxService.kt added: 27, removed: 10, total 17
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2023 Robin Lindén <dev@robinlinden.eu>
// SPDX-FileCopyrightText: 2019-2024 Robin Lindén <dev@robinlinden.eu>
// SPDX-FileCopyrightText: 2021-2022 aTox contributors
//
// SPDX-License-Identifier: GPL-3.0-only
@@ -10,6 +10,7 @@ import android.app.Notification
import android.app.PendingIntent
import android.content.Intent
import android.content.pm.PackageManager
import android.content.pm.ServiceInfo
import android.os.Build
import android.util.Log
import androidx.core.app.ActivityCompat
@@ -126,7 +127,16 @@ class ToxService : LifecycleService() {
}
 
createNotificationChannel()
startForeground(NOTIFICATION_ID, notificationFor(connectionStatus))
 
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(
NOTIFICATION_ID,
notificationFor(connectionStatus),
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE,
)
} else {
startForeground(NOTIFICATION_ID, notificationFor(connectionStatus))
}
 
lifecycleScope.launch(Dispatchers.Default) {
userRepository.get(tox.publicKey.string())
 
atox/src/main/kotlin/ui/AvatarImageView.kt added: 27, removed: 10, total 17
@@ -74,9 +74,9 @@ class AvatarImageView @JvmOverloads constructor(context: Context, attrs: Attribu
invalidate()
}
 
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (canvas == null || !statusIndicatorVisible) return
if (!statusIndicatorVisible) return
 
val size = min(width, height).toFloat()
 
 
gradle/libs.versions.toml added: 27, removed: 10, total 17
@@ -1,6 +1,6 @@
[versions]
sdk-min = "19"
sdk-target = "33"
sdk-target = "34"
 
kotlin = "2.0.20"
ksp = "2.0.20-1.0.25"