diff --git a/Samples/BackgroundAudio/cs/BackgroundAudioTask/MyBackgroundAudioTask.cs b/Samples/BackgroundAudio/cs/BackgroundAudioTask/MyBackgroundAudioTask.cs
index 484a785114..12cc7634db 100644
--- a/Samples/BackgroundAudio/cs/BackgroundAudioTask/MyBackgroundAudioTask.cs
+++ b/Samples/BackgroundAudio/cs/BackgroundAudioTask/MyBackgroundAudioTask.cs
@@ -218,7 +218,7 @@ private void UpdateUVCOnNewTrack(MediaPlaybackItem item)
///
void smtc_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
{
- // TODO: If soundlevel turns to muted, app can choose to pause the music
+ // If soundlevel turns to muted, app can choose to pause the music
}
///
@@ -382,9 +382,6 @@ private void SkipToPrevious()
{
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
playbackList.MovePrevious();
-
- // TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
- BackgroundMediaPlayer.Current.Play();
}
///
@@ -394,10 +391,6 @@ private void SkipToNext()
{
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
playbackList.MoveNext();
-
- // TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
- BackgroundMediaPlayer.Current.Play();
-
}
#endregion
@@ -477,9 +470,6 @@ void BackgroundMediaPlayer_MessageReceivedFromForeground(object sender, MediaPla
Debug.WriteLine("Skipping to track " + index);
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
playbackList.MoveTo((uint)index);
-
- // TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
- BackgroundMediaPlayer.Current.Play();
return;
}
diff --git a/Samples/LockScreenApps/cs/ScenarioInput1.xaml b/Samples/LockScreenApps/cs/ScenarioInput1.xaml
index 2f29faf1d0..23059165e1 100644
--- a/Samples/LockScreenApps/cs/ScenarioInput1.xaml
+++ b/Samples/LockScreenApps/cs/ScenarioInput1.xaml
@@ -16,40 +16,26 @@
- In this scenario, the app will request to be added to the lock screen, remove itself from the lock screen, and
- query its current lock screen status.
+ In this scenario, the app will request that the user add it to the lock screen.
- Lock screen apps are apps that can notify users when the users are not using their device. Lock screen apps are
- special in that they have permission to run in the background. For example, lock screen apps can run code
- periodically on a timer every 15 minutes, maintain a TCP socket in the background, or receive push notifications
- from the Windows Push Notification Service (WNS). Lock screen apps have the ability to show updates to the user
+ Lock screen apps are apps that can notify users when the users are not using their device.
+ Lock screen apps have the ability to show updates to the user
on the lock screen by updating badge counts and glyphs, showing toast notifications, or by allowing a text-only
- version of their Start tile to appear on the lock screen. An app must be granted permission by the user to be a
- lock screen app.
+ version of their Start tile to appear on the lock screen.
- There are only 7 lock screen slots and an app may request to fill a single one of these. Of these seven apps, one
- may also take the detailed status slot on the lock screen. If the user declines to give your app permission, you
- may not prompt again. Apps can query the current state of the setting and may prompt the user a single time to see
- if they want to allow the app to appear on their lock screen. Subsequent attempts to prompt the user will result
- in returning the app's current status, without showing any UI to the user.
-
-
- An app must set the appropriate information in the manifest in order to be background capable. In the Visual Studio
+ An app must set the appropriate information in the manifest in order to appear on the lock screen. In the Visual Studio
manifest editor, under the Lock screen notifications option in the Application UI tab, set the value to either
"Badge" or "Badge and Tile Text". Additionally, apps must specify a background task of type "Control channel",
"Timer", or "Push notification" in the Declarations tab. For more information, see the "Background Tasks" sample.
- Users can manually add the app to the lock screen (or remove it) through the Personalize page in PC Settings, or
- in the Permissions tab in the app's Settings page. When declared in the manifest as described above, the app will
- appear in the list of allowable lock screen apps on the Lock screen tab of the Personalize page.
+ To appear on the lock screen, the user must add it manually
+ through the Notifications page in Settings.
+ When declared in the manifest as described above, the app will
+ appear in the list of allowable lock screen apps.
-
-
-
-
-
+
diff --git a/Samples/LockScreenApps/cs/ScenarioInput1.xaml.cs b/Samples/LockScreenApps/cs/ScenarioInput1.xaml.cs
index 6c2313c93d..56b2c21a4b 100644
--- a/Samples/LockScreenApps/cs/ScenarioInput1.xaml.cs
+++ b/Samples/LockScreenApps/cs/ScenarioInput1.xaml.cs
@@ -7,7 +7,6 @@
using System;
using System.Threading.Tasks;
-using Windows.ApplicationModel.Background;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
@@ -23,71 +22,13 @@ public sealed partial class ScenarioInput1 : Page
public ScenarioInput1()
{
InitializeComponent();
- RequestLockScreenAccess.Click += new RoutedEventHandler(RequestLockScreenAccess_Click);
- RemoveLockScreenAccess.Click += new RoutedEventHandler(RemoveLockScreenAccess_Click);
- QueryLockScreenAccess.Click += new RoutedEventHandler(QueryLockScreenAccess_Click);
}
- private async void RequestLockScreenAccess_Click(object sender, RoutedEventArgs e)
+ private async void OpenNotificationSettings()
{
- BackgroundAccessStatus status = BackgroundAccessStatus.Unspecified;
- try
- {
- status = await BackgroundExecutionManager.RequestAccessAsync();
- }
- catch (UnauthorizedAccessException)
- {
- // An access denied exception may be thrown if two requests are issued at the same time
- // For this specific sample, that could be if the user double clicks "Request access"
- }
-
- switch (status)
- {
- case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
- rootPage.NotifyUser("This app is on the lock screen and has access to Always-On Real Time Connectivity.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
- rootPage.NotifyUser("This app is on the lock screen and has access to Active Real Time Connectivity.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.Denied:
- rootPage.NotifyUser("This app is not on the lock screen.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.Unspecified:
- rootPage.NotifyUser("The user has not yet taken any action. This is the default setting and the app is not on the lock screen.", NotifyType.StatusMessage);
- break;
- default:
- break;
- }
- }
-
- private void RemoveLockScreenAccess_Click(object sender, RoutedEventArgs e)
- {
- BackgroundExecutionManager.RemoveAccess();
- rootPage.NotifyUser("This app has been removed from the lock screen.", NotifyType.StatusMessage);
+ await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:notifications"));
}
- private void QueryLockScreenAccess_Click(object sender, RoutedEventArgs e)
- {
- switch (BackgroundExecutionManager.GetAccessStatus())
- {
- case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
- rootPage.NotifyUser("This app is on the lock screen and has access to Always-On Real Time Connectivity.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
- rootPage.NotifyUser("This app is on the lock screen and has access to Active Real Time Connectivity.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.Denied:
- rootPage.NotifyUser("This app is not on the lock screen.", NotifyType.StatusMessage);
- break;
- case BackgroundAccessStatus.Unspecified:
- rootPage.NotifyUser("The user has not yet taken any action. This is the default setting and the app is not on the lock screen.", NotifyType.StatusMessage);
- break;
- default:
- break;
- }
- }
-
-
#region Template-Related Code - Do not remove
protected override void OnNavigatedTo(NavigationEventArgs e)
{
diff --git a/Samples/LockScreenApps/cs/ScenarioList.xaml b/Samples/LockScreenApps/cs/ScenarioList.xaml
index e0a3b8842b..a84e176142 100644
--- a/Samples/LockScreenApps/cs/ScenarioList.xaml
+++ b/Samples/LockScreenApps/cs/ScenarioList.xaml
@@ -23,7 +23,7 @@
-
+
diff --git a/Samples/LockScreenApps/cs/ScenarioOutput1.xaml b/Samples/LockScreenApps/cs/ScenarioOutput1.xaml
index a223c156d7..459bedd5ac 100644
--- a/Samples/LockScreenApps/cs/ScenarioOutput1.xaml
+++ b/Samples/LockScreenApps/cs/ScenarioOutput1.xaml
@@ -14,9 +14,4 @@
d:DesignHeight="300"
d:DesignWidth="400">
-
-
- Apps can only prompt the user once, as enforced by the API.
-
-
\ No newline at end of file