I try to run bugreport from Runtime exec and I get the following error:
FAIL:Failed to connect to dumpstate service: No such file or directory
I looked into bugreport code here , and it looks like it failed to open a tcp socket to dumpstate service. I also investigated that when com.android.settings asks for a bugreport it uses ActivityManagerService function "requestBugReport" as you can see here, the system set property to start a service but I fail to that also. I tried to reflect this method but for some reason this "ActivityManagerService" class not found.
val check = Class
.forName("com.android.server.am.ActivityManagerService")
.getMethod("requestBugReport")
.invoke(null)
Is there anyway to get the output of bugreport/bugreportz?