Skip to content

Commit 558b3a4

Browse files
committed
Merged main into live
2 parents 721c19a + 72a21b1 commit 558b3a4

37 files changed

+128
-2962
lines changed

.openpublishing.redirection.json

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8729,6 +8729,76 @@
87298729
"source_path": "hub/apps/develop/camera/index.md",
87308730
"redirect_url": "/windows/apps/develop/camera/camera",
87318731
"redirect_document_id": false
8732+
},
8733+
{
8734+
"source_path": "uwp/launch-resume/handle-uri-activation.md",
8735+
"redirect_url": "/windows/apps/develop/launch/handle-uri-activation",
8736+
"redirect_document_id": false
8737+
},
8738+
{
8739+
"source_path": "uwp/launch-resume/launch-app-from-file.md",
8740+
"redirect_url": "/windows/apps/develop/launch/",
8741+
"redirect_document_id": false
8742+
},
8743+
{
8744+
"source_path": "uwp/launch-resume/launch-app-with-uri.md",
8745+
"redirect_url": "/windows/apps/develop/launch/",
8746+
"redirect_document_id": false
8747+
},
8748+
{
8749+
"source_path": "uwp/launch-resume/launch-default-app.md",
8750+
"redirect_url": "/windows/apps/develop/launch/launch-default-app",
8751+
"redirect_document_id": false
8752+
},
8753+
{
8754+
"source_path": "uwp/launch-resume/launch-default-apps-settings.md",
8755+
"redirect_url": "/windows/apps/develop/launch/launch-default-apps-settings",
8756+
"redirect_document_id": false
8757+
},
8758+
{
8759+
"source_path": "uwp/launch-resume/launch-maps-app.md",
8760+
"redirect_url": "/windows/apps/develop/launch/launch-maps-app",
8761+
"redirect_document_id": false
8762+
},
8763+
{
8764+
"source_path": "uwp/launch-resume/launch-people-apps.md",
8765+
"redirect_url": "/windows/apps/develop/launch/launch-people-app",
8766+
"redirect_document_id": false
8767+
},
8768+
{
8769+
"source_path": "uwp/launch-resume/launch-screen-snipping.md",
8770+
"redirect_url": "/windows/apps/develop/launch/launch-screen-snipping",
8771+
"redirect_document_id": false
8772+
},
8773+
{
8774+
"source_path": "uwp/launch-resume/launch-settings-app.md",
8775+
"redirect_url": "/windows/apps/develop/launch/launch-settings-app",
8776+
"redirect_document_id": false
8777+
},
8778+
{
8779+
"source_path": "uwp/launch-resume/launch-store-app.md",
8780+
"redirect_url": "/windows/apps/develop/launch/launch-store-app",
8781+
"redirect_document_id": false
8782+
},
8783+
{
8784+
"source_path": "uwp/launch-resume/launch-the-default-app-for-a-file.md",
8785+
"redirect_url": "/windows/apps/develop/launch/launch-the-default-app-for-a-file",
8786+
"redirect_document_id": false
8787+
},
8788+
{
8789+
"source_path": "uwp/launch-resume/reserved-uri-scheme-names.md",
8790+
"redirect_url": "/windows/apps/develop/launch/reserved-uri-scheme-names",
8791+
"redirect_document_id": false
8792+
},
8793+
{
8794+
"source_path": "uwp/launch-resume/web-to-app-linking.md",
8795+
"redirect_url": "/windows/apps/develop/launch/web-to-app-linking",
8796+
"redirect_document_id": false
8797+
},
8798+
{
8799+
"source_path": "uwp/launch-resume/handle-file-activation.md",
8800+
"redirect_url": "/windows/apps/develop/launch/handle-file-activation",
8801+
"redirect_document_id": false
87328802
}
87338803
]
87348804
}

uwp/debug-test-perf/optimize-background-activity.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.localizationpriority: medium
99
---
1010
# Optimize background activity
1111

12-
Universal Windows apps should perform consistently well across all device families. On battery-powered devices, power consumption is a critical factor in the user's overall experience with your app. All-day battery life is a desirable feature to every user, but it requires efficiency from all of the software installed on the device, including your own.
12+
Universal Windows apps should perform consistently well across all device families. On battery-powered devices, power consumption is a critical factor in the user's overall experience with your app. All-day battery life is a desirable feature to every user, but it requires efficiency from all of the software installed on the device, including your own.
1313

1414
Background task behavior is arguably the most important factor in the total energy cost of an app. A background task is any program activity that has been registered with the system to run without the app being open. See [Create and register an out-of-process background task](../launch-resume/create-and-register-a-background-task.md) for more information.
1515

@@ -21,7 +21,7 @@ On desktop and mobile devices running Windows 10, version 1607 or later, users c
2121

2222
### Background permissions on mobile
2323

24-
On mobile devices, users will see a list of radio buttons that specify the background task permission setting for that app. Background activity can be set to "Always allowed," "Never allowed," or "Managed by Windows," which means the app's background activity is regulated by the system according to a number of factors.
24+
On mobile devices, users will see a list of radio buttons that specify the background task permission setting for that app. Background activity can be set to "Always allowed," "Never allowed," or "Managed by Windows," which means the app's background activity is regulated by the system according to a number of factors.
2525

2626
![Background task permissions radio buttons](images/background-task-permissions.png)
2727

@@ -35,20 +35,24 @@ On desktop devices, the "Managed by Windows" setting is presented as a toggle sw
3535

3636
In your app, you can use the [**BackgroundAccessStatus**](/uwp/api/windows.applicationmodel.background.backgroundaccessstatus) enum value returned by a call to the [**BackgroundExecutionManager.RequestAccessAsync()**](/uwp/api/windows.applicationmodel.background.backgroundexecutionmanager.requestaccessasync) method to determine its current background activity permission setting.
3737

38-
All this is to say that if your app doesn't implement responsible background activity management, the user may deny background permissions to your app altogether, which is not desirable for either party. If your app has been denied permission to run in the background but requires background activity to complete an action for the user, you can notify the user and point them to the Settings app. This can be accomplished by [Launching the Settings App](../launch-resume/launch-settings-app.md) to the Background Apps or Battery Usage Details page.
38+
All this is to say that if your app doesn't implement responsible background activity management, the user may deny background permissions to your app altogether, which is not desirable for either party. If your app has been denied permission to run in the background but requires background activity to complete an action for the user, you can notify the user and point them to the Settings app. This can be accomplished by [Launching the Settings App](/windows/apps/develop/launch/launch-settings-app) to the Background Apps or Battery Usage Details page.
3939

4040
## Work with the Battery Saver feature
41+
4142
Battery Saver is a system-level feature that users can configure in Settings. It cuts off all background activity of all apps when the battery level drops below a user-defined threshold, *except* for the background activity of apps that have been set to "Always allowed."
4243

43-
Check the status of Battery Saver mode from within your app by referencing the [**PowerManager.EnergySaverStatus**](/uwp/api/windows.system.power.energysaverstatus) property. It is an enum value: either **EnergySaverStatus.Disabled**, **EnergySaverStatus.Off** or **EnergySaverStatus.On**. If your app requires background activity and is not set to "Always allowed" then it should handle **EnergySaverStatus.On** by notifying the user that the given background task(s) will not run until Battery Saver is off. While background activity management is the primary purpose of the Battery Saver feature, your app can make additional adjustments to further conserve energy when Battery Saver is on. In the case where Battery Saver is on, your app could reduce its use of animations, stop location polling, or delay syncs and backups.
44+
Check the status of Battery Saver mode from within your app by referencing the [**PowerManager.EnergySaverStatus**](/uwp/api/windows.system.power.energysaverstatus) property. It is an enum value: either **EnergySaverStatus.Disabled**, **EnergySaverStatus.Off** or **EnergySaverStatus.On**. If your app requires background activity and is not set to "Always allowed" then it should handle **EnergySaverStatus.On** by notifying the user that the given background task(s) will not run until Battery Saver is off. While background activity management is the primary purpose of the Battery Saver feature, your app can make additional adjustments to further conserve energy when Battery Saver is on. In the case where Battery Saver is on, your app could reduce its use of animations, stop location polling, or delay syncs and backups.
4445

4546
## Further optimize background tasks
47+
4648
The following are additional steps you can take when registering your background tasks to make them more battery-aware.
4749

48-
### Use a maintenance trigger
50+
### Use a maintenance trigger
51+
4952
A [**MaintenanceTrigger**](/uwp/api/windows.applicationmodel.background.maintenancetrigger) object can be used instead of a [**SystemTrigger**](/uwp/api/windows.applicationmodel.background.systemtrigger) object to determine when a background task starts. Tasks that use maintenance triggers will only run when the device is connected to AC power, and they are allowed to run for longer. See [Use a maintenance trigger](../launch-resume/use-a-maintenance-trigger.md) for instructions.
5053

5154
### Use the **BackgroundWorkCostNotHigh** system condition type
55+
5256
System conditions must be met in order for background tasks to run (see [Set conditions for running a background task](../launch-resume/set-conditions-for-running-a-background-task.md) for more). The background work cost is a measurement that denotes the *relative* energy impact of running the background task. A task running when the device is plugged into AC power would be marked as **low** (little/no impact on battery). A task running when the device is on battery power with the screen off is marked as **high** because there is presumably little program activity running on the device at the time, so the background task would have a greater relative cost. A task running when the device is on battery power with the screen *on* is marked as **medium**, because there is presumably already some program activity running, and the background task would add a bit more to the energy cost. The **BackgroundWorkCostNotHigh** system condition simply delays your task's ability to run until either the screen is on or the device is connected to AC power.
5357

5458
## Test battery efficiency
@@ -58,4 +62,4 @@ Be sure to test your app on real devices for any high-power-consumption scenario
5862
## Related topics
5963

6064
* [Create and register an out-of-process background task](../launch-resume/create-and-register-a-background-task.md)
61-
* [Planning for performance](./planning-and-measuring-performance.md)
65+
* [Planning for performance](./planning-and-measuring-performance.md)

uwp/develop/toc.yml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -878,42 +878,14 @@
878878
href: ../launch-resume/add-a-splash-screen.md
879879
- name: Display a splash screen for more time
880880
href: ../launch-resume/create-a-customized-splash-screen.md
881-
- name: Launch an app with a URI
882-
href: ../launch-resume/launch-app-with-uri.md
883-
items:
884-
- name: Launch the default app for a URI
885-
href: ../launch-resume/launch-default-app.md
886-
- name: Handle URI activation
887-
href: ../launch-resume/handle-uri-activation.md
888-
- name: Launch an app for results
889-
href: ../launch-resume/how-to-launch-an-app-for-results.md
890-
- name: Choose and save tones using the ms-tonepicker URI scheme
891-
href: ../launch-resume/launch-ringtone-picker.md
892-
- name: Launch the Windows Settings app
893-
href: ../launch-resume/launch-settings-app.md
894-
- name: Launch the Default Apps settings page
895-
href: ../launch-resume/launch-default-apps-settings.md
896-
- name: Launch the Microsoft Store app
897-
href: ../launch-resume/launch-store-app.md
898-
- name: Launch the Windows Maps app
899-
href: ../launch-resume/launch-maps-app.md
900-
- name: Launch the People app
901-
href: ../launch-resume/launch-people-apps.md
902-
- name: Launch screen snipping
903-
href: ../launch-resume/launch-screen-snipping.md
904-
- name: Support web-to-app linking with app URI handlers
905-
href: ../launch-resume/web-to-app-linking.md
906-
- name: Launch an app through file activation
907-
href: ../launch-resume/launch-app-from-file.md
908-
items:
909-
- name: Launch the default app for a file
910-
href: ../launch-resume/launch-the-default-app-for-a-file.md
911-
- name: Handle file activation
912-
href: ../launch-resume/handle-file-activation.md
913881
- name: Auto-launching with AutoPlay
914882
href: ../launch-resume/auto-launching-with-autoplay.md
915-
- name: Reserved file and URI scheme names
916-
href: ../launch-resume/reserved-uri-scheme-names.md
883+
- name: Launch an app for results
884+
href: ../launch-resume/how-to-launch-an-app-for-results.md
885+
- name: Choose and save tones using the ms-tonepicker URI scheme
886+
href: ../launch-resume/launch-ringtone-picker.md
887+
- name: Reserved file and URI scheme names >>
888+
href: /windows/apps/develop/launch/reserved-uri-scheme-names
917889
- name: Use app services and extensions
918890
href: ../launch-resume/app-services.md
919891
items:

0 commit comments

Comments
 (0)