Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement systemPreferences.getMediaAccessStatus() on Windows #24275

Merged
merged 1 commit into from Jun 25, 2020

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Jun 24, 2020

Description of Change

Implement systemPreferences.getMediaAccessStatus() on Windows

Checklist

Release Notes

Notes: Implemented systemPreferences.getMediaAccessStatus() on Windows.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 24, 2020
@miniak miniak requested review from zcbenz, codebytere and deepak1556 and removed request for zcbenz June 24, 2020 00:38
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid 👍

return ConvertDeviceAccessStatus(
DeviceAccessStatus::DeviceAccessStatus_Allowed);
} else {
args->ThrowError("Invalid media type");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not originating from this PR but when we have a unknown state in the docs, why do we want to throw an error ? seem to do it for macOS as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepak1556 The return type can have unknown, the media_type argument can't be unknown

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an unknown media type why can't the return type by unknown, the current system calls both on windows and macOS never return an unknown state, the value is being unused. I wouldn't mind if this state wasn't documented but it is :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to bring this up with api-WG

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can address it in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@miniak miniak force-pushed the miniak/device-permissions-win branch from d058966 to 8c471b4 Compare June 24, 2020 12:35
@miniak miniak requested a review from codebytere June 24, 2020 12:58
@@ -426,6 +426,9 @@ This user consent was not required on macOS 10.13 High Sierra or lower so this m
macOS 10.14 Mojave or higher requires consent for `microphone` and `camera` access.
macOS 10.15 Catalina or higher requires consent for `screen` access.

Windows 10 has a global setting controlling `microphone` and `camera` access for all win32 applications.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is specific for win32 applications should we safety check if for APPX / Window Store builds?

Copy link
Contributor Author

@miniak miniak Jun 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The system API returns the global value, it should work fine. Electron Window Store app is still Win32.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 25, 2020
Copy link
Member

@codebytere codebytere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from an impl perspective, & i agree we might want to discuss the unknown type but don't think it should necessarily block this PR :)

@deepak1556 deepak1556 merged commit 9b4572d into master Jun 25, 2020
@release-clerk
Copy link

release-clerk bot commented Jun 25, 2020

Release Notes Persisted

Implemented systemPreferences.getMediaAccessStatus() on Windows.

@deepak1556 deepak1556 deleted the miniak/device-permissions-win branch June 25, 2020 16:47
@miniak
Copy link
Contributor Author

miniak commented Jun 26, 2020

/trop run backport-to 8-x-y

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

The backport process for this PR has been manually initiated -
sending your commits to "8-x-y"!

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

I was unable to backport this PR to "8-x-y" cleanly;
you will need to perform this backport manually.

@miniak
Copy link
Contributor Author

miniak commented Jun 26, 2020

/trop run backport-to 9-x-y

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

The backport process for this PR has been manually initiated -
sending your commits to "9-x-y"!

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

I was unable to backport this PR to "9-x-y" cleanly;
you will need to perform this backport manually.

@miniak
Copy link
Contributor Author

miniak commented Jun 26, 2020

/trop run backport-to 10-x-y

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

The backport process for this PR has been manually initiated -
sending your commits to "10-x-y"!

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

I have automatically backported this PR to "10-x-y", please check out #24311

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

@miniak has manually backported this PR to "9-x-y", please check out #24312

@trop
Copy link
Contributor

trop bot commented Jun 26, 2020

@miniak has manually backported this PR to "8-x-y", please check out #24313

@miniak miniak self-assigned this Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants