private static WrappedCallback wrapCallback(final ExecutionCallback callback) {
        return new WrappedCallback() {
            @Override
            public void onConnected(@Nullable final TrustedWebActivityServiceWrapper service) {
                AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            callback.onConnected(service);
                        } catch (TransactionTooLargeException e) {
                            Log.w(TAG,
                                    "TransactionTooLargeException from TrustedWebActivityService, "
                                            + "possibly due to large size of small icon.", e);
                        } catch (RemoteException | RuntimeException e) {
                            Log.w(TAG,
                                    "Exception while trying to use TrustedWebActivityService.", e);
                        }
                    }
                });
            }
        };
    }
Creates a TrustedWebActivityServiceConnectionManager.
@param context A Context used for accessing SharedPreferences.
customtabs/src/android/support/customtabs/trusted/TrustedWebActivityServiceConnectionManager.java