Skip to content

Commit 215408b

Browse files
committed
Windows 10 RTM Release - December 2015 Update
1 parent 0b2568a commit 215408b

File tree

5 files changed

+14
-102
lines changed

5 files changed

+14
-102
lines changed

Samples/BackgroundAudio/cs/BackgroundAudioTask/MyBackgroundAudioTask.cs

+1-11
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private void UpdateUVCOnNewTrack(MediaPlaybackItem item)
218218
/// <param name="args"></param>
219219
void smtc_PropertyChanged(SystemMediaTransportControls sender, SystemMediaTransportControlsPropertyChangedEventArgs args)
220220
{
221-
// TODO: If soundlevel turns to muted, app can choose to pause the music
221+
// If soundlevel turns to muted, app can choose to pause the music
222222
}
223223

224224
/// <summary>
@@ -382,9 +382,6 @@ private void SkipToPrevious()
382382
{
383383
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
384384
playbackList.MovePrevious();
385-
386-
// TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
387-
BackgroundMediaPlayer.Current.Play();
388385
}
389386

390387
/// <summary>
@@ -394,10 +391,6 @@ private void SkipToNext()
394391
{
395392
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
396393
playbackList.MoveNext();
397-
398-
// TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
399-
BackgroundMediaPlayer.Current.Play();
400-
401394
}
402395
#endregion
403396

@@ -477,9 +470,6 @@ void BackgroundMediaPlayer_MessageReceivedFromForeground(object sender, MediaPla
477470
Debug.WriteLine("Skipping to track " + index);
478471
smtc.PlaybackStatus = MediaPlaybackStatus.Changing;
479472
playbackList.MoveTo((uint)index);
480-
481-
// TODO: Work around playlist bug that doesn't continue playing after a switch; remove later
482-
BackgroundMediaPlayer.Current.Play();
483473
return;
484474
}
485475

Samples/LockScreenApps/cs/ScenarioInput1.xaml

+10-24
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,26 @@
1616

1717
<StackPanel>
1818
<TextBlock Style="{StaticResource DescriptionTextStyle}" TextWrapping="Wrap">
19-
In this scenario, the app will request to be added to the lock screen, remove itself from the lock screen, and
20-
query its current lock screen status.
19+
In this scenario, the app will request that the user add it to the lock screen.
2120
<LineBreak/>
2221
<LineBreak/>
23-
Lock screen apps are apps that can notify users when the users are not using their device. Lock screen apps are
24-
special in that they have permission to run in the background. For example, lock screen apps can run code
25-
periodically on a timer every 15 minutes, maintain a TCP socket in the background, or receive push notifications
26-
from the Windows Push Notification Service (WNS). Lock screen apps have the ability to show updates to the user
22+
Lock screen apps are apps that can notify users when the users are not using their device.
23+
Lock screen apps have the ability to show updates to the user
2724
on the lock screen by updating badge counts and glyphs, showing toast notifications, or by allowing a text-only
28-
version of their Start tile to appear on the lock screen. An app must be granted permission by the user to be a
29-
lock screen app.
25+
version of their Start tile to appear on the lock screen.
3026
<LineBreak/>
3127
<LineBreak/>
32-
There are only 7 lock screen slots and an app may request to fill a single one of these. Of these seven apps, one
33-
may also take the detailed status slot on the lock screen. If the user declines to give your app permission, you
34-
may not prompt again. Apps can query the current state of the setting and may prompt the user a single time to see
35-
if they want to allow the app to appear on their lock screen. Subsequent attempts to prompt the user will result
36-
in returning the app's current status, without showing any UI to the user.
37-
<LineBreak/>
38-
<LineBreak/>
39-
An app must set the appropriate information in the manifest in order to be background capable. In the Visual Studio
28+
An app must set the appropriate information in the manifest in order to appear on the lock screen. In the Visual Studio
4029
manifest editor, under the Lock screen notifications option in the Application UI tab, set the value to either
4130
"Badge" or "Badge and Tile Text". Additionally, apps must specify a background task of type "Control channel",
4231
"Timer", or "Push notification" in the Declarations tab. For more information, see the "Background Tasks" sample.
4332
<LineBreak/>
4433
<LineBreak/>
45-
Users can manually add the app to the lock screen (or remove it) through the Personalize page in PC Settings, or
46-
in the Permissions tab in the app's Settings page. When declared in the manifest as described above, the app will
47-
appear in the list of allowable lock screen apps on the Lock screen tab of the Personalize page.
34+
To appear on the lock screen, the user must add it manually
35+
through the Notifications page in Settings.
36+
When declared in the manifest as described above, the app will
37+
appear in the list of allowable lock screen apps.
4838
</TextBlock>
49-
<StackPanel Orientation="Horizontal" >
50-
<Button x:Name="RequestLockScreenAccess" Content="Request lock screen access"/>
51-
<Button x:Name="RemoveLockScreenAccess" Content="Remove lock screen access"/>
52-
<Button x:Name="QueryLockScreenAccess" Content="Query lock screen access"/>
53-
</StackPanel>
39+
<Button Content="Go to Notification Settings" Click="{x:Bind OpenNotificationSettings}" Margin="0,10,0,0"/>
5440
</StackPanel>
5541
</Page>

Samples/LockScreenApps/cs/ScenarioInput1.xaml.cs

+2-61
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
using System;
99
using System.Threading.Tasks;
10-
using Windows.ApplicationModel.Background;
1110
using Windows.UI.Xaml;
1211
using Windows.UI.Xaml.Controls;
1312
using Windows.UI.Xaml.Navigation;
@@ -23,71 +22,13 @@ public sealed partial class ScenarioInput1 : Page
2322
public ScenarioInput1()
2423
{
2524
InitializeComponent();
26-
RequestLockScreenAccess.Click += new RoutedEventHandler(RequestLockScreenAccess_Click);
27-
RemoveLockScreenAccess.Click += new RoutedEventHandler(RemoveLockScreenAccess_Click);
28-
QueryLockScreenAccess.Click += new RoutedEventHandler(QueryLockScreenAccess_Click);
2925
}
3026

31-
private async void RequestLockScreenAccess_Click(object sender, RoutedEventArgs e)
27+
private async void OpenNotificationSettings()
3228
{
33-
BackgroundAccessStatus status = BackgroundAccessStatus.Unspecified;
34-
try
35-
{
36-
status = await BackgroundExecutionManager.RequestAccessAsync();
37-
}
38-
catch (UnauthorizedAccessException)
39-
{
40-
// An access denied exception may be thrown if two requests are issued at the same time
41-
// For this specific sample, that could be if the user double clicks "Request access"
42-
}
43-
44-
switch (status)
45-
{
46-
case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
47-
rootPage.NotifyUser("This app is on the lock screen and has access to Always-On Real Time Connectivity.", NotifyType.StatusMessage);
48-
break;
49-
case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
50-
rootPage.NotifyUser("This app is on the lock screen and has access to Active Real Time Connectivity.", NotifyType.StatusMessage);
51-
break;
52-
case BackgroundAccessStatus.Denied:
53-
rootPage.NotifyUser("This app is not on the lock screen.", NotifyType.StatusMessage);
54-
break;
55-
case BackgroundAccessStatus.Unspecified:
56-
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);
57-
break;
58-
default:
59-
break;
60-
}
61-
}
62-
63-
private void RemoveLockScreenAccess_Click(object sender, RoutedEventArgs e)
64-
{
65-
BackgroundExecutionManager.RemoveAccess();
66-
rootPage.NotifyUser("This app has been removed from the lock screen.", NotifyType.StatusMessage);
29+
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:notifications"));
6730
}
6831

69-
private void QueryLockScreenAccess_Click(object sender, RoutedEventArgs e)
70-
{
71-
switch (BackgroundExecutionManager.GetAccessStatus())
72-
{
73-
case BackgroundAccessStatus.AllowedWithAlwaysOnRealTimeConnectivity:
74-
rootPage.NotifyUser("This app is on the lock screen and has access to Always-On Real Time Connectivity.", NotifyType.StatusMessage);
75-
break;
76-
case BackgroundAccessStatus.AllowedMayUseActiveRealTimeConnectivity:
77-
rootPage.NotifyUser("This app is on the lock screen and has access to Active Real Time Connectivity.", NotifyType.StatusMessage);
78-
break;
79-
case BackgroundAccessStatus.Denied:
80-
rootPage.NotifyUser("This app is not on the lock screen.", NotifyType.StatusMessage);
81-
break;
82-
case BackgroundAccessStatus.Unspecified:
83-
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);
84-
break;
85-
default:
86-
break;
87-
}
88-
}
89-
90-
9132
#region Template-Related Code - Do not remove
9233
protected override void OnNavigatedTo(NavigationEventArgs e)
9334
{

Samples/LockScreenApps/cs/ScenarioList.xaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</ListBox.ItemTemplate>
2424
<!-- Add your scenarios here -->
2525
<ListBoxItem x:Name="Scenario1">
26-
<TextBlock Text="1) Adding, removing and querying lock screen capabilities"/>
26+
<TextBlock Text="1) Adding app to the lock screen"/>
2727
</ListBoxItem>
2828
<ListBoxItem x:Name="Scenario2">
2929
<TextBlock Text="2) Sending lock screen badge notifications and tile updates"/>

Samples/LockScreenApps/cs/ScenarioOutput1.xaml

-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@
1414
d:DesignHeight="300"
1515
d:DesignWidth="400">
1616

17-
<Grid>
18-
<TextBlock Style="{StaticResource DescriptionTextStyle}" TextWrapping="Wrap">
19-
Apps can only prompt the user once, as enforced by the API.
20-
</TextBlock>
21-
</Grid>
2217
</Page>

0 commit comments

Comments
 (0)