A four-variable automorphic kernel function