mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Properly invalidate pairing state after pairing
This commit is contained in:
parent
453fbb5f58
commit
0f0b83badc
@ -353,6 +353,10 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
// Just navigate to the app view without displaying a toast
|
// Just navigate to the app view without displaying a toast
|
||||||
message = null;
|
message = null;
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
|
// Invalidate reachability information after pairing to force
|
||||||
|
// a refresh before reading pair state again
|
||||||
|
managerBinder.invalidateStateForComputer(computer.uuid);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Should be no other values
|
// Should be no other values
|
||||||
@ -381,7 +385,6 @@ public class PcView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
|
|
||||||
if (toastSuccess) {
|
if (toastSuccess) {
|
||||||
// Open the app list after a successful pairing attempt
|
// Open the app list after a successful pairing attempt
|
||||||
computer.pairState = PairState.PAIRED;
|
|
||||||
doAppList(computer);
|
doAppList(computer);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -238,6 +238,21 @@ public class ComputerManagerService extends Service {
|
|||||||
|
|
||||||
return null;
|
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
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user