Skip to content

Commit cc294bf

Browse files
committed
Disable missed call events when reading the call log
1 parent b5201f6 commit cc294bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

android/app/src/main/java/com/httpsms/MainActivity.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ class MainActivity : AppCompatActivity() {
108108
val requestPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { permissions ->
109109
permissions.entries.forEach {
110110
Timber.d("${it.key} = ${it.value}")
111+
if (it.key == Manifest.permission.READ_CALL_LOG && !it.value) {
112+
Timber.w("disabling incoming call events since for SIM1 and SIM2")
113+
Settings.setIncomingCallEventsEnabled(context, Constants.SIM1, false)
114+
Settings.setIncomingCallEventsEnabled(context, Constants.SIM2, false)
115+
}
111116
}
112117
}
113118

0 commit comments

Comments
 (0)