void RefreshPid(IAsyncOperation op)
        {
            if (!op.Success)
            {
                SetCompleted(false);
                return;
            }

            AdbGetProcessIdOperation adbOp = (AdbGetProcessIdOperation)op;

            if (pid == UNASSIGNED_PID)
            {
                // Ignore if the activity is still starting, and thus doesn't show up in 'ps'
                if (adbOp.ProcessId > 0)
                {
                    pid = adbOp.ProcessId;
                    StartLogTracking();                      // track log *after* getting the pid
                }
            }
            else
            {
                if (adbOp.ProcessId == 0 || pid != adbOp.ProcessId)
                {
                    SetCompleted(false);
                    return;
                }
            }
            adbOp.Dispose();

            GLib.Timeout.Add(WAIT_TIME, delegate {
                getPidOp            = new AdbGetProcessIdOperation(device, packageName);
                getPidOp.Completed += RefreshPid;
                return(false);
            });
        }
 void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (getPidOp != null)
         {
             getPidOp.Dispose();
             getPidOp = null;
         }
         if (trackLogOp != null)
         {
             trackLogOp.Dispose();
             trackLogOp = null;
         }
     }
 }