private static @Nullable String getProcessName(final Context context) {
		final ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
		if (am == null) return null;
		final List<ActivityManager.RunningAppProcessInfo> processes;
		try {
			processes = am.getRunningAppProcesses();
		} catch (final SecurityException e) { return null; }	// Isolated process not allowed to call getRunningAppProcesses
		final int pid = Process.myPid();
		if (processes != null) for (final ActivityManager.RunningAppProcessInfo process : processes)
			if (process.pid == pid) return process.processName;
		Log.e(TAG, "Error querying the name of current process.");
		return null;
	}
Install the condom protection for current process. This method should generally never be called in the main process of app.

<p>It is suggested to use {@link android.content.ContentProvider ContentProvider} with "android:process", to install it in specified process.
library/src/main/java/com/oasisfeng/condom/CondomProcess.java