Exemplo n.º 1
0
  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();
  }
Exemplo n.º 2
0
 private void unregWatchers() {
   if (mProcessWatcher != null) {
     mProcessWatcher.stop();
   }
   if (mUninstallWatcher != null) {
     mUninstallWatcher.stop();
   }
 }