@Nullable
    Integer getExpectedStatusBarColor(Context context, String providerPackage,
            TrustedWebActivityIntentBuilder builder) {
        Intent intent = builder.buildCustomTabsIntent().intent;
        if (providerSupportsColorSchemeParams(context, providerPackage)) {
            int colorScheme = getExpectedColorScheme(context, builder);
            CustomTabColorSchemeParams params = CustomTabsIntent.getColorSchemeParams(intent,
                    colorScheme);
            return params.toolbarColor;
        }
        Bundle extras = intent.getExtras();
        return extras == null ? null : (Integer) extras.get(CustomTabsIntent.EXTRA_TOOLBAR_COLOR);
    }
Makes a best-effort guess about which status bar color will be used when the Trusted Web
Activity is launched. Returns null if not possible to predict.
customtabs/src/android/support/customtabs/trusted/splashscreens/SystemBarColorPredictor.java