From 23a7c7e087b108ed621a9cf31dd3e35069fb83a1 Mon Sep 17 00:00:00 2001
From: Daniel Yu
Date: Mon, 6 Jun 2016 11:27:07 -0700
Subject: [PATCH] docs: Clarifying direct boot notification messages
Adding details on which notification message to listen for
when developing apps that need to interact with direct boot mode.
Note: This is a doc fix for the N direct boot feature docs, but
not specific to any preview release.
Bug: 28729775
Change-Id: If6b239e7aa92bced735cfa1e72d8891d193a420c
---
docs/html/preview/features/direct-boot.jd | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/docs/html/preview/features/direct-boot.jd b/docs/html/preview/features/direct-boot.jd
index 3d442d0966ca6..8351f4b4b10fe 100644
--- a/docs/html/preview/features/direct-boot.jd
+++ b/docs/html/preview/features/direct-boot.jd
@@ -108,18 +108,25 @@ Direct Boot mode, use credential encrypted storage.
Getting Notified of User Unlock
-Once the user unlocks the device after restart, your app can switch to
+
When the user unlocks the device after restart, your app can switch to
accessing credential encrypted storage and use regular system services that
depend on user credentials.
To get notified when the user unlocks the device after a reboot,
register a {@link android.content.BroadcastReceiver} from a running component
-to listen for the ACTION_USER_UNLOCKED message. Or, you can
-receive the existing {@link android.content.Intent#ACTION_BOOT_COMPLETED
-ACTION_BOOT_COMPLETED} message, which now indicates the device has booted and
-the user has unlocked the device.
+to listen for unlock notification messages. When the user unlocks the device
+after boot:
+
+
+- If your app has foreground processes that need immediate notification,
+listen for the {@code ACTION_USER_UNLOCKED} message.
+- If your app only uses background processes that can act on a delayed
+notification, listen for the
+{@link android.content.Intent#ACTION_BOOT_COMPLETED ACTION_BOOT_COMPLETED}
+message.
+
-You can directly query if the user has unlocked the device by calling
+
If the user has unlocked the device, you can find out by calling
UserManager.isUserUnlocked().
Migrating Existing Data