From 601373b55e880aea07e7f4f3184f3ca7bb9e90c3 Mon Sep 17 00:00:00 2001 From: Daniel Yu Date: Thu, 31 Mar 2016 15:15:28 -0700 Subject: [PATCH] docs: Updating Direct Boot N preview docs for DP2 Small name changes were made to Direct Boot APIs and constants, so the preview docs are being updated to reflect this. Doc changes will get published when DP2 is released (and not before). Also fixing small bug with context. Bug: 27907930 27781930 Change-Id: I75d6bf4efaa9a8bece60b6e2d794af3d075fc353 --- docs/html/preview/features/direct-boot.jd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/html/preview/features/direct-boot.jd b/docs/html/preview/features/direct-boot.jd index aefa4dcaa47a4..d1530d7efe67d 100644 --- a/docs/html/preview/features/direct-boot.jd +++ b/docs/html/preview/features/direct-boot.jd @@ -58,7 +58,7 @@ credential encrypted storage.

can run during Direct Boot mode or access device encrypted storage. Apps register with the system by marking components as encryption aware. To mark your component as encryption aware, set the -android:encryptionAware attribute to true in your manifest.

+android:directBootAware attribute to true in your manifest.

Encryption aware components can register to receive a LOCKED_BOOT_COMPLETED broadcast message from the @@ -72,7 +72,7 @@ intent filter for LOCKED_BOOT_COMPLETED, in the app manifest:

 <receiever
-  android:encryptionAware="true" >
+  android:directBootAware="true" >
   ...
   <intent-filter>
     <action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
@@ -87,13 +87,13 @@ device encrypted storage as well as credential encrypted storage.

To access device encrypted storage, create a second {@link android.content.Context} instance by calling -Context.createDeviceEncryptedStorageContext(). All storage API +Context.createDeviceProtectedStorageContext(). All storage API calls made using this context access the device encrypted storage. The following example accesses the device encrypted storage and opens an existing app data file:

-Context directBootContext = Context.createDeviceEncryptedStorageContext();
+Context directBootContext = appContext.createDeviceProtectedStorageContext();
 // Access appDataFilename that lives in device encrypted storage
 FileInputStream inStream = directBootContext.openFileInput(appDataFilename);
 // Use inStream to read content...
@@ -125,8 +125,8 @@ the user has unlocked the device.

If a user updates their device to use Direct Boot mode, you might have existing data that needs to get migrated to device encrypted storage. Use -Context.migrateSharedPreferencesFrom() and -Context.migrateDatabaseFrom() to migrate preference and database +Context.moveSharedPreferencesFrom() and +Context.moveDatabaseFrom() to migrate preference and database data between credential encrypted storage and device encrypted storage.

Use your best judgment when deciding what data to migrate from credential