Issues with Access Permissions in PhoneLineTransportDevice API on Windows 11
I am currently working on a hands-free application on Windows and using the PhoneLineTransportDevice API. To utilize the features of this API, I initially request access permissions using the PhoneLineTransportDevice.RequestAccessAsync() method. This process works as expected on a PC running Windows 10.
However, when I execute the same code on a PC running Windows 11 22H2, I encounter an issue. The PhoneLineTransportDevice.RequestAccessAsync() method consistently returns “DeniedBySystem”, despite the fact that the code and API usage are identical on both systems.
Here is the relevant part of my code:
var access = await PhoneLineTransportDevice.RequestAccessAsync();
if (access != DeviceAccessStatus.AlwaysAllowed && access != DeviceAccessStatus.AllowedSubjectToSystemPolicy)
{
return default(BackgroundTaskRegistration);
}
I anticipated that the RequestAccessAsync()
method would return either “Allowed” or “AlwaysAllowed”, similar to its behavior on the Windows 10 system. This would allow me to proceed with the subsequent steps of my application. However, on the Windows 11 system, the method consistently returns “DeniedBySystem”.
I have been unable to locate any documentation or resources that explain why this issue is occurring. I would greatly appreciate any insights or suggestions that could assist in resolving this issue.