Skip to content

Conversation

@ThomasSession
Copy link
Collaborator

SES-4975 - New UI to help users with Slow Mode to make sure Session is whitelisted as allowed to run in the background.

Comment on lines 55 to 58
var showWhitelistEnableDialog by mutableStateOf(false)
var showWhitelistDisableDialog by mutableStateOf(false)

var whiteListControl: SwitchPreferenceCompat? = null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be private?


var whiteListControl: SwitchPreferenceCompat? = null

private val composeView by lazy { ComposeView(requireContext()) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't retain views in fragments because fragment will create/destroy view as necessary. So it should be:
private var composeView: ComposeView? = null

then create and assign it in onCreateView

startActivity(intent) // shows the system dialog for this specific app
} catch (_: ActivityNotFoundException) {
// Fallback to the general settings list
startActivity(Intent(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ActivityNotFoundException happen to this too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably can on some custom ROMs. I'll try the basic settings and then show a toast if even that fails

@ThomasSession ThomasSession merged commit abd3bcc into dev Dec 4, 2025
4 checks passed
@ThomasSession ThomasSession deleted the feature/slow-mode-whitelisst branch December 4, 2025 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants