I'm getting RESULT_CANCELED from startActivityForResult()
I'm trying to set my app as the default phone app in Android 10 and above and when I say default "phone app" is the one that you find when you go to Settings > Apps > Default Apps > Phone I have this main activity class:
@RequiresApi(Build.VERSION_CODES.Q)
class MainActivity : ComponentActivity() {
private lateinit var setPhoneAppLauncher: ActivityResultLauncher
private val roleManager: RoleManager by lazy {
getSystemService(Context.ROLE_SERVICE) as RoleManager
}...