private static int getExpectedColorScheme(Context context, TrustedWebActivityIntentBuilder builder) {
        Intent intent = builder.buildCustomTabsIntent().intent;
        Bundle extras = intent.getExtras();
        Integer scheme = extras == null ? null :
                (Integer) extras.get(CustomTabsIntent.EXTRA_COLOR_SCHEME);
        if (scheme != null && scheme != CustomTabsIntent.COLOR_SCHEME_SYSTEM) {
            return scheme;
        }
        boolean systemIsInDarkMode = (context.getResources().getConfiguration().uiMode
                & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
        return systemIsInDarkMode ? CustomTabsIntent.COLOR_SCHEME_DARK :
                CustomTabsIntent.COLOR_SCHEME_LIGHT;
    }
Makes a best-effort guess about which navigation 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