mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 15:05:19 +00:00
SES-2715 Calls toggle and Mic permission
Making sure we tell the user when microphone permissions are denied permanently when toggling calls on.
This commit is contained in:
parent
ad944e3398
commit
d30ff252ab
@ -3,11 +3,14 @@ package org.thoughtcrime.securesms.preferences
|
||||
import android.Manifest
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.preference.Preference
|
||||
import com.squareup.phrase.Phrase
|
||||
import network.loki.messenger.R
|
||||
import org.session.libsession.utilities.StringSubstitutionConstants.APP_NAME_KEY
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
import org.session.libsession.utilities.TextSecurePreferences.Companion.setBooleanPreference
|
||||
import org.thoughtcrime.securesms.permissions.Permissions
|
||||
import org.thoughtcrime.securesms.showSessionDialog
|
||||
import org.thoughtcrime.securesms.ui.getSubbedString
|
||||
|
||||
internal class CallToggleListener(
|
||||
private val context: Fragment,
|
||||
@ -39,6 +42,10 @@ internal class CallToggleListener(
|
||||
)
|
||||
setCallback(true)
|
||||
}
|
||||
.withPermanentDenialDialog(
|
||||
context.requireContext().getSubbedString(R.string.permissionsMicrophoneAccessRequired,
|
||||
APP_NAME_KEY to context.requireContext().getString(R.string.app_name)
|
||||
))
|
||||
.onAnyDenied { setCallback(false) }
|
||||
.execute()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user