Skip to content

Conversation

@huzaifa-d
Copy link
Contributor

Adding the PowerNotification APIs as mentioned in this spec

@ghost ghost added the needs-triage label Jul 8, 2021

namespace ProjectReunionPowerTests
{
constexpr auto TIMEOUT = 2000;
Copy link
Member

Choose a reason for hiding this comment

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

Why 2000?

What's the expected average and worst case timeouts you'll encounter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH I just choose a value where I was sure that it will succeed. Informal testing shows they take <500 ms and the Power team also didn't have data on this. Do you have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: c_TimeoutInMs

Copy link
Contributor

Choose a reason for hiding this comment

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

Or, change this to a std::chrono::duration. Makes it more explicit with what you mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The variable name has been changed. I didn't use chrono as it would need another level of conversion and the variable name makes it clear.
Will take suggestions on a possible better time out value though. :)

Changed check_hresult to Throw_if_failed
Moved/removed some variables
Added background thread event firing
More NIT changes
@huzaifa-d
Copy link
Contributor Author

I wanted to push after the renaming to AppSDK but wasn't sure how long that would take and wanted this to be updated from my side.

</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Copy link
Member

Choose a reason for hiding this comment

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

Always use Level4

@DrusTheAxe DrusTheAxe self-requested a review August 12, 2021 05:32
Copy link
Member

@DrusTheAxe DrusTheAxe left a comment

Choose a reason for hiding this comment

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

Please flip warnings to level4 (in this PR or a follow up) and correct anything it flags

@huzaifa-d
Copy link
Contributor Author

huzaifa-d commented Aug 13, 2021 via email

@DrusTheAxe
Copy link
Member

My comment predates the Level4 change (or maybe I was looking at an older commit in Codeflow when I made that comment?)

But all good now :-)

@huzaifa-d
Copy link
Contributor Author

huzaifa-d commented Aug 13, 2021 via email

@DrusTheAxe DrusTheAxe added area-Lifecycle Topics related to the AppLifecycle, providing lifecycle management for WindowsAppSDK apps and removed needs-triage labels Aug 18, 2021
@DrusTheAxe DrusTheAxe added this to the 1.0 (2021 Q4) milestone Aug 18, 2021
@DrusTheAxe DrusTheAxe removed this from the 1.0 (2021 Q4) milestone Aug 18, 2021
Copy link
Member

@DrusTheAxe DrusTheAxe left a comment

Choose a reason for hiding this comment

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

Some minor comments but otherwise looks good

{
wil::unique_handle event(CreateEvent(nullptr, false, false, nullptr));
THROW_LAST_ERROR_IF_NULL(event.get());
auto value = EnergySaverStatus::Disabled;
Copy link
Member

Choose a reason for hiding this comment

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

NIT: auto value{ ... };

ES.23: Prefer the {}-initializer syntax

Same comment applies throughout

<packages>
<package id="Microsoft.Taef" version="10.58.210222006-develop" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.210707.1" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.210204.1" targetFramework="native" />
Copy link
Member

Choose a reason for hiding this comment

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

WIL reference is rather long in the tooth

I noticed lots of projects referenced WIL but varying versions (4 different ones!). I just updated them and CsWinRT references to latest (which WindowsAppSDK_DLL was using). Take a look at latest commits in #1208

BTW don't update this through VS' UI, it won't update all the references in *.vcxproj. Global search/replace is more effective

@DrusTheAxe
Copy link
Member

Is this PR current or obsolete?

@huzaifa-d
Copy link
Contributor Author

It is old. Apologies for the confusion. Closing.

@huzaifa-d huzaifa-d closed this Sep 24, 2021
@huzaifa-d huzaifa-d deleted the user/modanish/PN.8-FinalMerge2 branch November 16, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Lifecycle Topics related to the AppLifecycle, providing lifecycle management for WindowsAppSDK apps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants