Properly invalidate pairing state after pairing

This commit is contained in:
Cameron Gutman
2016-11-05 20:20:09 -07:00
parent 453fbb5f58
commit 0f0b83badc
2 changed files with 19 additions and 1 deletions

View File

@@ -238,6 +238,21 @@ public class ComputerManagerService extends Service {
return null;
}
public void invalidateStateForComputer(UUID uuid) {
synchronized (pollingTuples) {
for (PollingTuple tuple : pollingTuples) {
if (uuid.equals(tuple.computer.uuid)) {
// We need the network lock to prevent a concurrent poll
// from wiping this change out
synchronized (tuple.networkLock) {
tuple.computer.state = ComputerDetails.State.UNKNOWN;
tuple.computer.reachability = ComputerDetails.Reachability.UNKNOWN;
}
}
}
}
}
}
@Override