A community member has associated this post with a similar question:
Issues with Access Permissions in PhoneLineTransportDevice API on Windows 11

Only moderators can edit this content.

Unable to get access permission of PhoneLineTransportDevice on Windows 11 22H2

Taylor Yi 0 Reputation points
2024-07-07T02:57:12.0666667+00:00

I am attempting to use the PhoneLineTransportDevice API to develop a hands-free application for Windows. The first step is to call PhoneLineTransportDevice.RequestAccessAsync() in order to request access permissions. This has worked fine on my development PC running Windows 10.

I'm having trouble getting the same code to work on another PC running Windows 11 22H2, despite there being no differences in the code or API usage. Specifically, PhoneLineTransportDevice.RequestAccessAsync() always returns “DeniedBySystem" on this PC, no matter what steps I take.

Here is a snippet of the relevant code:

var access = await PhoneLineTransportDevice.RequestAccessAsync();
if (access != DeviceAccessStatus.AlwaysAllowed && access != DeviceAccessStatus.AllowedSubjectToSystemPolicy)
{
    return default(BackgroundTaskRegistration);
}

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.
11,022 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,915 questions
0 comments No comments
{count} votes