I have this code to set my app as the default dialer:
val telecomManager = getSystemService(TELECOM_SERVICE) as TelecomManager
val isAlreadyDefaultDialer = packageName == telecomManager.defaultDialerPackage
if (isAlreadyDefaultDialer) return
val intent = Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER)
.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, packageName)
startActivityForResult(intent, REQUEST_CODE_SET_DEFAULT_DIALER)
Which works fine. And it's set on a checkbox. But I want when the user unchecks it, to make an intent to show me the "Default Apps" page. Or if not to fallback to the default android dialer. Is that possible?
I tried:
val intent = Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER)
.putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, "com.android.phone")
But it doesn't do anything. Also "ACTION_APPLICATION_SETTINGS" but that goes tot he apps page. I want to go to the default apps
I found this that works for me:
var i = Intent(ACTION_MANAGE_DEFAULT_APPS_SETTINGS)
startActivity(i)