I can run an application that I developed by throwing the system/app folder. But I have a problem, since this application constantly communicates with the server, the application must not be closed. As in the example I gave in the photo, it cannot be disabled in my application, but it can be stopped with force stop. How can I prevent this?
I was wondering if I could change the setting force stop button to work. If the user clicks the force stop button on my application, it does nothing. I did not understand exactly how force stop works, but I think the killproces process will kill the application, so I made such an addition, how do you think.
private void killProcesses() {
if (runningAppProcessInfo.get(i).processName.equals("com.interprobe.saganakmdm")) {
return;
}
ActivityManager am = (ActivityManager)getActivity().getSystemService(Context.ACTIVITY_SERVICE);
for (int i=0; i< mApp.mEntries.size(); i++) {
ProcStatsEntry ent = mApp.mEntries.get(i);
for (int j=0; j<ent.mPackages.size(); j++) {
am.forceStopPackage(ent.mPackages.get(j));
}
}
}