kopia lustrzana https://github.com/ryukoposting/Signal-Android
Disable Telecom integration solely for OnePlus devices.
rodzic
7edef20f4f
commit
0b1a93d3e6
|
@ -39,18 +39,18 @@ object AndroidTelecomUtil {
|
|||
@JvmStatic
|
||||
val telecomSupported: Boolean
|
||||
get() {
|
||||
// if (Build.VERSION.SDK_INT >= 26 && !systemRejected) {
|
||||
// if (!accountRegistered) {
|
||||
// registerPhoneAccount()
|
||||
// }
|
||||
//
|
||||
// if (accountRegistered) {
|
||||
// val phoneAccount = ContextCompat.getSystemService(context, TelecomManager::class.java)!!.getPhoneAccount(getPhoneAccountHandle())
|
||||
// if (phoneAccount != null && phoneAccount.isEnabled) {
|
||||
// return true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (Build.VERSION.SDK_INT >= 26 && !systemRejected && !isRestrictedDevice()) {
|
||||
if (!accountRegistered) {
|
||||
registerPhoneAccount()
|
||||
}
|
||||
|
||||
if (accountRegistered) {
|
||||
val phoneAccount = ContextCompat.getSystemService(context, TelecomManager::class.java)!!.getPhoneAccount(getPhoneAccountHandle())
|
||||
if (phoneAccount != null && phoneAccount.isEnabled) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -186,6 +186,10 @@ object AndroidTelecomUtil {
|
|||
}
|
||||
return SignalAudioManager.AudioDevice.NONE
|
||||
}
|
||||
|
||||
private fun isRestrictedDevice(): Boolean {
|
||||
return "${Build.MODEL} ${Build.PRODUCT} ${Build.MANUFACTURER}".contains(other = "oneplus", ignoreCase = true)
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(26)
|
||||
|
|
Ładowanie…
Reference in New Issue