Corrects issues with order of operations so that InCallFeedback isn't null when dependent routines check it's state.

This commit is contained in:
Neil Dorin
2019-11-27 10:32:21 -07:00
parent 2fe1ac0e75
commit f2e2166146
4 changed files with 83 additions and 70 deletions

View File

@@ -87,7 +87,11 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
else
Debug.Console(0, this, "Unable to add Red LED device");
CheckPrivacyMode();
AddPostActivationAction(() => {
CheckPrivacyMode();
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
});
initialized = true;
@@ -97,8 +101,6 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
public void SetPrivacyDevice(IPrivacy privacyDevice)
{
PrivacyDevice = privacyDevice;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
}
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)