Issues with Access Permissions in PhoneLineTransportDevice API on Windows 11

Taylor Yi 0 Reputation points
2024-07-07T03:07:39.5133333+00:00

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.

Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,922 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,630 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.