mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 17:25:21 +00:00
feat: Disable system screenshots in recents screen (#608)
This change prevents the app's content from being visible in the recents screen on Android 13 (Tiramisu) and newer devices. It achieves this by calling `setRecentsScreenshotEnabled(false)` in the `onCreate` method of `MainActivity` after checking the device's SDK version. This enhances user privacy by hiding potentially sensitive information from the system's app overview.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.bitchat.android
|
package com.bitchat.android
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.activity.OnBackPressedCallback
|
import androidx.activity.OnBackPressedCallback
|
||||||
@@ -80,7 +81,9 @@ class MainActivity : OrientationAwareActivity() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
this.setRecentsScreenshotEnabled(false)
|
||||||
|
}
|
||||||
// Register receiver for force finish signal from shutdown coordinator
|
// Register receiver for force finish signal from shutdown coordinator
|
||||||
val filter = android.content.IntentFilter(com.bitchat.android.util.AppConstants.UI.ACTION_FORCE_FINISH)
|
val filter = android.content.IntentFilter(com.bitchat.android.util.AppConstants.UI.ACTION_FORCE_FINISH)
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 33) {
|
if (android.os.Build.VERSION.SDK_INT >= 33) {
|
||||||
|
|||||||
Reference in New Issue
Block a user