private SupportedFeatures getSupportedFeatures(Context context,
            String providerPackage) {
        SupportedFeatures cached = mSupportedFeaturesCache.get(providerPackage);
        if (cached != null) return cached;

        if (isChrome76(context, providerPackage)) {
            // Chrome 76 supports both features, but doesn't advertise it with categories.
            SupportedFeatures features = new SupportedFeatures(true, true);
            mSupportedFeaturesCache.put(providerPackage, features);
            return features;
        }

        Intent serviceIntent = new Intent()
                .setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION)
                .setPackage(providerPackage);
        ResolveInfo resolveInfo = context.getPackageManager().resolveService(serviceIntent,
                PackageManager.GET_RESOLVED_FILTER);

        SupportedFeatures features = new SupportedFeatures(
                hasCategory(resolveInfo, CustomTabsService.CATEGORY_NAVBAR_COLOR_CUSTOMIZATION),
                hasCategory(resolveInfo, CustomTabsService.CATEGORY_COLOR_SCHEME_CUSTOMIZATION)
        );
        mSupportedFeaturesCache.put(providerPackage, features);
        return features;
    }
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