How to use unity java calls to access clipboard

My attempt at accessing the clipboard on android is not working.
I’m surprised GUIUtility.systemCopyBuffer doesn’t seem to work on android.

This is the java code I need to run in unity.

 ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); 
 ClipData clip = ClipData.newPlainText(label, text);
 clipboard.setPrimaryClip(clip);

Im not quite sure how use to the getSystemService method with the Unity java object functionality

Here is my attempt that isn’t working. I don’t have android debugging working at the moment so just wondering if anyone knows offhand how to do this?

AndroidJavaObject clipboard = new AndroidJavaObject("java.lang.Object").Call("getSystemService", new AndroidJavaClass("CLIPBOARD_SERVICE"));
AndroidJavaObject clipData = new AndroidJavaObject("android.content.ClipData", "field value", selectedGameobject.GetComponent<Text>().text);
clipboard.Call("setPrimaryClip", clipData);

Im pretty sure the second and third lines would work as expected it’s just the first line.

@gheeler I found It in https://github.com/mtsalenc/toaster

GUIUtility.systemCopyBuffer = str;
		#if UNITY_ANDROID
		AndroidJavaClass UnityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
		AndroidJavaObject currentActivity = UnityPlayer.GetStatic<AndroidJavaObject> ("currentActivity"); 
		AndroidJavaClass Context = new AndroidJavaClass ("android.content.Context");
		AndroidJavaObject CLIPBOARD_SERVICE = Context.GetStatic<AndroidJavaObject> ("CLIPBOARD_SERVICE");
		AndroidJavaObject clipboardMgr = currentActivity.Call<AndroidJavaObject> ("getSystemService", CLIPBOARD_SERVICE);
		AndroidJavaClass ClipData = new AndroidJavaClass ("android.content.ClipData");
		AndroidJavaObject clipData = ClipData.CallStatic<AndroidJavaObject> ("newPlainText", "simple text", str);
		clipboardMgr.Call ("setPrimaryClip", clipData);
		#endif