class AuthIntentReceiverActivity : Activity() { @VisibleForTesting override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) MainScope().launch { // The intent property is nullable, but the rest of the code below // assumes it is not. If it's null, then we make a new one and open // the HomeActivity. val intent = intent?.let { Intent(intent) } ?: Intent() if (settings().lastKnownMode.isPrivate) { components.intentProcessors.privateCustomTabIntentProcessor.process(intent) } else { components.intentProcessors.customTabIntentProcessor.process(intent) } intent.setClassName(applicationContext, AuthCustomTabActivity::class.java.name) intent.putExtra(HomeActivity.OPEN_TO_BROWSER, true) startActivity(intent) finish() } } }
Processes incoming intents and sends them to the corresponding activity.