private void launchTwa(TrustedWebActivityIntentBuilder twaBuilder,
            @Nullable SplashScreenStrategy splashScreenStrategy,
            @Nullable Runnable completionCallback) {
        if (splashScreenStrategy != null) {
            splashScreenStrategy.onTwaLaunchInitiated(mProviderPackage, twaBuilder);
        }

        Runnable onSessionCreatedRunnable = () ->
                launchWhenSessionEstablished(twaBuilder, splashScreenStrategy, completionCallback);

        if (mSession != null) {
            onSessionCreatedRunnable.run();
            return;
        }

        Runnable onSessionCreationFailedRunnable = () -> {
            // The provider has been unable to create a session for us, we can't launch a
            // Trusted Web Activity. We could either exit, forcing the user to try again,
            // hopefully successfully this time or we could launch a Custom Tab giving the user
            // a subpar experience (compared to a TWA).
            // We'll open in a CCT, but pay attention to what users want.
            launchCct(twaBuilder, completionCallback);
        };

        if (mServiceConnection == null) {
            mServiceConnection = new TwaCustomTabsServiceConnection();
        }

        mServiceConnection.setSessionCreationRunnables(
                onSessionCreatedRunnable, onSessionCreationFailedRunnable);
        CustomTabsClient.bindCustomTabsService(mContext, mProviderPackage, mServiceConnection);
    }
Similar to {@link #launch(Uri)}, but allows more customization.

@param twaBuilder {@link TrustedWebActivityIntentBuilder} containing the url to open, along with
optional parameters: status bar color, additional trusted origins, etc.
@param splashScreenStrategy {@link SplashScreenStrategy} to use for showing splash screens,
null if splash screen not needed.
@param completionCallback Callback triggered when the url has been opened.
customtabs/src/android/support/customtabs/trusted/TwaLauncher.java