private void regWatchers(int parentPid) { if (mProcessWatcher == null) { mProcessWatcher = new ProcessWatcher(parentPid, this); } else { mProcessWatcher.stop(); } mProcessWatcher.start(); if (mUninstallWatcher == null) { mUninstallWatcher = new UninstallWatcher(getContext().getPackageName(), this); } else { mUninstallWatcher.stop(); } mUninstallWatcher.start(); }
private void unregWatchers() { if (mProcessWatcher != null) { mProcessWatcher.stop(); } if (mUninstallWatcher != null) { mUninstallWatcher.stop(); } }