public static Set<String> getVerifiedPackages(Context context, String origin) {
        // Loading preferences is on the critical path for this class - we need to synchronously
        // inform the client whether or not an notification can be handled by a TWA.
        // I considered loading the preferences into a cache on a background thread when this class
        // was created, but ultimately if that load hadn't completed by the time {@link #execute} or
        // {@link #registerClient} were called, we'd still need to block for it to complete.
        // Therefore we attempt to asynchronously load the preferences in the constructor, but if
        // they aren't loaded by the time they are needed, we disable StrictMode and read them on
        // the main thread.
        StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads();

        try {
            if (sSharedPreferences.get() == null) {
                sSharedPreferences.compareAndSet(null,
                        context.getSharedPreferences(PREFS_FILE, Context.MODE_PRIVATE));
            }

            return origin == null ? null :
                    new HashSet<>(sSharedPreferences.get().getStringSet(origin,
                            Collections.<String>emptySet()));
        } finally {
            StrictMode.setThreadPolicy(policy);
        }
    }
Gets the verified packages for the given origin. |origin| may be null, in which case this
method call will just trigger caching the Preferences.

This is safe to be called on any thread, however it may hit disk.

@param context A Context to be used for accessing SharedPreferences.
@param origin The origin that was previously used with {@link #registerClient}.
@return A set of package names. This set is safe to be modified.
customtabs/src/android/support/customtabs/trusted/TrustedWebActivityServiceConnectionManager.java