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

Commit 71473c55 authored by Daniel Yu's avatar Daniel 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
am: e8c07d5d

Change-Id: Icc857ec3baaa3cc76255cda04bd40a723bcbc5a0
parents 2b60341d e8c07d5d
Loading
Loading
Loading
Loading
+13 −6
Original line number Original line 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>
<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
accessing credential encrypted storage and use regular system services that
depend on user credentials.</p>
depend on user credentials.</p>


<p>To get notified when the user unlocks the device after a reboot,
<p>To get notified when the user unlocks the device after a reboot,
register a {@link android.content.BroadcastReceiver} from a running component
register a {@link android.content.BroadcastReceiver} from a running component
to listen for the <code>ACTION_USER_UNLOCKED</code> message. Or, you can
to listen for unlock notification messages. When the user unlocks the device
receive the existing {@link android.content.Intent#ACTION_BOOT_COMPLETED
after boot:
ACTION_BOOT_COMPLETED} message, which now indicates the device has booted and
</p>
the user has unlocked the device.</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>
<code>UserManager.isUserUnlocked()</code>.</p>


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