public static final void setVerifiedProviderSynchronouslyForTesting(Context context,
            @Nullable String provider) {
        String providerEmptyChecked = (provider == null || provider.isEmpty()) ? null : provider;

        StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads();
        try {
            SharedPreferences.Editor editor = getPreferences(context).edit();
            editor.putString(PREFS_VERIFIED_PROVIDER, providerEmptyChecked);
            editor.apply();
        } finally {
            StrictMode.setThreadPolicy(policy);
        }
    }
See {@link #setVerifiedProvider}, the main difference being that this approach sets the
provider synchronously, so may trigger a disk read.
@hide
customtabs/src/android/support/customtabs/trusted/TrustedWebActivityService.java