Android 0.13, versionCode 15 #137
@@ -40,8 +40,8 @@ android {
|
||||
// the paragraph above, so the code keeps climbing and the NAME is what
|
||||
// closes the 0.10 -> 0.12 gap. They are allowed to differ: the code is
|
||||
// ordering, the name is what a person reads.
|
||||
versionCode = 14
|
||||
versionName = "0.12"
|
||||
versionCode = 15
|
||||
versionName = "0.13"
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package io.flamenet.messenger.app
|
||||
|
||||
import android.provider.Settings
|
||||
import android.os.Build
|
||||
import android.net.Uri
|
||||
import android.content.Intent
|
||||
import android.app.NotificationManager
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
@@ -75,6 +80,49 @@ fun ColumnScope.NotificationSection() {
|
||||
|
||||
Spacer(Modifier.height(Space.xs))
|
||||
|
||||
// A ringing call needs a permission the manifest cannot grant itself.
|
||||
//
|
||||
// Since Android 14, USE_FULL_SCREEN_INTENT is auto-granted only to apps the
|
||||
// system already treats as calling apps. Declared and not granted, an
|
||||
// incoming call is demoted to an ordinary heads-up: it shows for about two
|
||||
// seconds and collapses, which reads as the call notification being broken.
|
||||
// The system refuses silently, so the only way anybody learns is here.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
val manager = context.getSystemService(NotificationManager::class.java)
|
||||
if (manager?.canUseFullScreenIntent() == false) {
|
||||
Spacer(Modifier.height(Space.sm))
|
||||
Text(
|
||||
"Calls will not ring full screen",
|
||||
style = MaterialTheme.typography.titleSmall,
|
||||
modifier = Modifier.testTag("notify-fsi-title"),
|
||||
)
|
||||
Text(
|
||||
"Android is holding back the permission that lets an incoming call " +
|
||||
"take over the screen, so a call shows as a banner for a couple of " +
|
||||
"seconds and then goes. Grant it and calls ring properly.",
|
||||
fontSize = 12.sp,
|
||||
color = Palette.SecondaryText,
|
||||
)
|
||||
Spacer(Modifier.height(Space.xs))
|
||||
KitSecondaryButton(
|
||||
text = "Let calls ring",
|
||||
onClick = {
|
||||
runCatching {
|
||||
context.startActivity(
|
||||
Intent(
|
||||
Settings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT,
|
||||
Uri.fromParts("package", context.packageName, null),
|
||||
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
|
||||
)
|
||||
}
|
||||
},
|
||||
tag = "notify-fsi-grant",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(Modifier.height(Space.xs))
|
||||
|
||||
// Says what turning it on costs, and does not pretend the default is merely
|
||||
// cautious.
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user