Merge "Ignore scheduled onDeviceGone call on simulated device if it is already no longer present."

This commit is contained in:
Raphael Kim
2022-10-14 23:07:27 +00:00
committed by Android (Google) Code Review

View File

@@ -363,7 +363,9 @@ public class CompanionDevicePresenceMonitor implements AssociationStore.OnChange
@Override
public void handleMessage(@NonNull Message msg) {
final int associationId = msg.what;
onDeviceGone(mSimulated, associationId, /* sourceLoggingTag */ "simulated");
if (mSimulated.contains(associationId)) {
onDeviceGone(mSimulated, associationId, /* sourceLoggingTag */ "simulated");
}
}
}
}