From a4d549ea069532d26a4c767cc3cbe27dbf1a4de7 Mon Sep 17 00:00:00 2001 From: Lisa Ong Date: Sun, 13 Dec 2015 14:33:32 -0800 Subject: [PATCH] fixes to pass store certification (not to display dialog on app start up before the main view page is created). --- Steps/Package.appxmanifest | 43 ++++++++---------------------- Steps/StepsEngine.cs | 18 ++++++------- Steps/Strings/en-US/Resources.resw | 6 ++--- 3 files changed, 22 insertions(+), 45 deletions(-) diff --git a/Steps/Package.appxmanifest b/Steps/Package.appxmanifest index 0558911..fdd97c5 100644 --- a/Steps/Package.appxmanifest +++ b/Steps/Package.appxmanifest @@ -1,43 +1,23 @@  - - - - - - - + + + - Steps - Lumia SensorCore SDK sample - Lumia SDK + Steps - Microsoft SensorCore SDK sample + Sensors QA Assets\StoreLogo.png - - - + - - - - + + + + @@ -53,11 +33,10 @@ - - + diff --git a/Steps/StepsEngine.cs b/Steps/StepsEngine.cs index b2bedb3..003b43f 100644 --- a/Steps/StepsEngine.cs +++ b/Steps/StepsEngine.cs @@ -237,13 +237,7 @@ public LumiaStepsEngine() /// Asynchronous task public static async Task ValidateSettingsAsync() { - if (!await StepCounter.IsSupportedAsync()) - { - MessageDialog dlg = new MessageDialog(_resourceLoader.GetString("FeatureNotSupported/Message"), _resourceLoader.GetString("FeatureNotSupported/Title")); - await dlg.ShowAsync(); - Application.Current.Exit(); - } - else + if (await StepCounter.IsSupportedAsync()) { // Starting from version 2 of Motion data settings Step counter and Acitivity monitor are always available. In earlier versions system // location setting and Motion data had to be enabled. @@ -424,7 +418,7 @@ private async Task CallSensorCoreApiAsync(Func action) { case SenseError.LocationDisabled: { - dlg = new MessageDialog("Location has been disabled. Do you want to open Location settings now?", "Information"); + dlg = new MessageDialog(_resourceLoader.GetString("FeatureDisabled/Location"), _resourceLoader.GetString("FeatureDisabled/Title")); dlg.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(async (cmd) => await SenseHelper.LaunchLocationSettingsAsync()))); dlg.Commands.Add(new UICommand("No", new UICommandInvokedHandler((cmd) => { /* do nothing */ }))); await dlg.ShowAsync(); @@ -433,12 +427,18 @@ private async Task CallSensorCoreApiAsync(Func action) } case SenseError.SenseDisabled: { - dlg = new MessageDialog("Motion data has been disabled. Do you want to open Motion data settings now?", "Information"); + dlg = new MessageDialog(_resourceLoader.GetString("FeatureDisabled/MotionData"), _resourceLoader.GetString("FeatureDisabled/Title")); dlg.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(async (cmd) => await SenseHelper.LaunchSenseSettingsAsync()))); dlg.Commands.Add(new UICommand("No", new UICommandInvokedHandler((cmd) => { /* do nothing */ }))); await dlg.ShowAsync(); return false; } + case SenseError.SenseNotAvailable: + { + dlg = new MessageDialog(_resourceLoader.GetString("FeatureNotSupported/Message"), _resourceLoader.GetString("FeatureNotSupported/Title")); + await dlg.ShowAsync(); + return false; + } default: { dlg = new MessageDialog("Failure: " + SenseHelper.GetSenseError(failure.HResult), ""); diff --git a/Steps/Strings/en-US/Resources.resw b/Steps/Strings/en-US/Resources.resw index c339ad5..d80b016 100644 --- a/Steps/Strings/en-US/Resources.resw +++ b/Steps/Strings/en-US/Resources.resw @@ -121,7 +121,7 @@ about - The Steps developer sample application demonstrates Lumia SensorCore SDK's Step Counter API functionality. + The Steps developer sample application demonstrates the Windows Pedometer API and Lumia SensorCore SDK's Step Counter API functionality. This developer sample application has been created to provide tips and best practice guidance for software developers and app designers, and may not have all the features you would expect in a commercial product. This application is published in Store as a free software as it may also have value to regular phone users. The source code and more information of this sample can be from GitHub: @@ -160,9 +160,7 @@ Information - Sorry, the feature exemplified by this application is not available on your phone. - -The application will now exit. + Sorry, the features exemplified by this application are not available on your device. This application requires a Windows 10 device that supports either a Pedometer or Lumia SensorCore Motion. Lumia SensorCore