public void Cancel() { lock (lockObj) { if (IsCompleted) { return; } // Make sure our master tracking operation is finished first if (getPidOp != null && !getPidOp.IsCompleted) { try { getPidOp.Cancel(); } catch {} } // Try to kill the activity if we were able to actually get its pid if (pid != UNASSIGNED_PID) { try { new AdbKillProcessOperation(device, packageName); } catch {} } } SetCompleted(false); }