Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8c07d5d authored by Dan Yu's avatar Dan Yu Committed by android-build-merger
Browse files

Merge \\\\"docs: Clarifying direct boot notification messages\\\\" into...

Merge \\\\"docs: Clarifying direct boot notification messages\\\\" into mnc-io-docs am: 120fd583 am: 4c5e5ec6 am: 189ef624
am: 2b5c6303

Change-Id: I9d1613270a53d0753c0de092635455d4f9759a0a
parents 925ad9ef 2b5c6303
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -108,18 +108,25 @@ Direct Boot mode, use credential encrypted storage.</p>

<h2 id="notification">Getting Notified of User Unlock</h2>

<p>Once the user unlocks the device after restart, your app can switch to
<p>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.</p>

<p>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 <code>ACTION_USER_UNLOCKED</code> 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.</p>
to listen for unlock notification messages. When the user unlocks the device
after boot:
</p>
<ul>
<li>If your app has foreground processes that need immediate notification,
listen for the {@code ACTION_USER_UNLOCKED} message.</li>
<li>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.</li>
</ul>

<p>You can directly query if the user has unlocked the device by calling
<p>If the user has unlocked the device, you can find out by calling
<code>UserManager.isUserUnlocked()</code>.</p>

<h2 id="migrating">Migrating Existing Data</h2>