Docs: CL for continuing work on tactically merged N-DP3 docs.
This CL continues the work from ag/1036623 and ag/1036124.
Change-Id: Ic1e026ed9f53a389a0435c2b8e21edfe9ef635c4
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index 09227f2..1b6da06 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -38,6 +38,7 @@
<li><a href="#scoped_directory_access">Scoped directory access</a></li>
<li><a href="#keyboard_shortcuts_helper">Keyboard Shortcuts Helper</a></li>
<li><a href="#sustained_performance_api">Sustained Performance API</a></li>
+ <li><a href="#vr">VR Support</a></li>
<li><a href="#print_svc">Print service enhancements</a></li>
<li><a href="#virtual_files">Virtual Files</a></li>
<li><a href="#framemetrics_api">FrameMetricsListener API</a></li>
@@ -85,6 +86,7 @@
<p class="img-caption">
<strong>Figure 1.</strong> Apps running in split-screen mode.
</p>
+
</div>
<p>Especially on tablets and other larger-screen devices, multi-window support
@@ -401,7 +403,7 @@
</p>
<p>
- For information about creating an app tile, see the
+ For information about creating an app tile, see the documentation for
<code>android.service.quicksettings.Tile</code> in the downloadable <a href=
"{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
</p>
@@ -474,8 +476,9 @@
languages such as English, Spanish, French, and Arabic. It also adds partial
support for more than 100 new languages.</p>
-<p>Apps can get the list of locales set by the user by calling <code>LocaleList.GetDefault()</code>. To support the expanded number of locales, Android N is changing the way
-that it resolves resources. Make sure that you test and verify that your apps
+<p>Apps can get the list of locales set by the user by calling
+<code>LocaleList.GetDefault()</code>. To support the expanded number of locales, Android N is
+changing the way that it resolves resources. Make sure that you test and verify that your apps
working as expected with the new resource resolution logic.</p>
<p>To learn about the new resource-resolution behavior and the best practices you
@@ -550,7 +553,8 @@
<ul>
<li> All extensions from the <a class="external-link"
-href="https://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt">Android Extension Pack</a></a> (AEP) except for <code>EXT_texture_sRGB_decode</code>.
+href="https://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt">
+Android Extension Pack</a></a> (AEP) except for <code>EXT_texture_sRGB_decode</code>.
<li> Floating-point framebuffers for HDR and deferred shading.
<li> BaseVertex draw calls to enable better batching and streaming.
<li> Robust buffer access control to reduce WebGL overhead.
@@ -850,22 +854,18 @@
<h2 id="keyboard_shortcuts_helper">Keyboard Shortcuts Helper</h2>
<p>
-In Android N, the user can press Meta+/ to trigger a Keyboard Shortcuts
+In Android N, the user can press "Alt + /" to trigger a <em>Keyboard Shortcuts</em>
screen that displays all shortcuts available both from the system and from
the app in focus. These are retrieved automatically from the app’s menu if
available, but developers can provide their own fine-tuned shortcuts lists
-for the screen. This is done simply by overriding the following method
-in {@code Activity.java}:
+for the screen. You can do this by overriding the new
+<code>Activity.onProvideKeyboardShortcuts()</code> method, described in the downloadable
+<a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
</p>
-<pre>
-public void onProvideKeyboardShortcuts(
- List<KeyboardShortcutGroup> data, Menu menu, int deviceId)
-</pre>
-
<p>
To trigger the Keyboard Shortcuts Helper from anywhere in your app,
-call {@code requestKeyboardShortcutsHelper} for the relevant activity.
+call {@code Activity.requestKeyboardShortcutsHelper()} for the relevant activity.
</p>
<h2 id="sustained_performance_api">Sustained Performance API</h2>
@@ -879,9 +879,9 @@
<p>
To address these limitations, Android N includes support for
-<em>sustained performance mode</em>, enabling OEMs to provide hints on
-device-performance capabilities for long-running applications. App developers
-can use these hints to tune applications for a predictable,
+<em>sustained performance mode</em>, enabling OEMs to provide hints about
+device-performance capabilities for long-running apps. App developers
+can use these hints to tune apps for a predictable,
consistent level of device performance over long periods of time.
</p>
@@ -890,10 +890,20 @@
Nexus 6P devices only. To use this feature,
set the sustained performance window flag for the window
you want to run in sustained performance mode. Set this flag using the
-{@code setSustainedPerformanceMode(boolean)} method. The system automatically
+{@code Window.setSustainedPerformanceMode()} method. The system automatically
disables this mode when the window is no longer in focus.
</p>
+<h2 id="vr">VR Support</h2>
+
+<p>
+Leveraging the <a href="#sustained_performance_api">Sustained Performance API</a>
+and newly introduced {@code VrListenerService} class, Android N provides support for
+VR apps developed using the <a href="https://developers.google.com/cardboard/overview">Cardboard
+SDK</a>. For more information about the {@code VrListenerService} class, see the relevant section
+of the downloadable <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
+
+
<h2 id="print_svc">Print Service Enhancements</h2>
<p>
@@ -939,9 +949,10 @@
<p>
The FrameMetricsListener API allows an app to monitor its UI rendering
-performance by exposing a streaming pubsub API to transfer frame
+performance. The API provides this capability by exposing a streaming Pub/Sub API to transfer frame
timing info for the app's current window. The data returned is
-equivalent to that displayed by {@code adb shell dumpsys gfxinfo framestats},
+equivalent to that displayed by {@code
+<a href="{@docRoot}tools/help/shell.html#shellcommands">adb shell</a> dumpsys gfxinfo framestats},
but is not limited to the past 120 frames.
</p>
@@ -958,25 +969,20 @@
</p>
<p>
-The API provides a callback interface to be implemented and
-registered on the window that you wish to monitor:
+To monitor a window, implement the <code>FrameMetricsListener.onMetricsAvailable()</code>
+callback method and register it on that window. For more information, refer to
+the {@code FrameMetricsListener} class documentation in
+the downloadable <a href="{@docRoot}preview/setup-sdk.html#docs-dl">API Reference</a>.
</p>
-<pre>
- public interface FrameMetricsListener {
- void onMetricsAvailable(Window window, FrameMetrics frameMetrics,
- int dropCountSinceLastInvocation);
- }
-</pre>
-
<p>
-The API returns a FrameMetrics object, which contains timing data that
+The API provides a {@code FrameMetrics} object, which contains timing data that
the rendering subsystem reports for various milestones in a frame lifecycle.
The supported metrics are: {@code UNKNOWN_DELAY_DURATION},
{@code INPUT_HANDLING_DURATION}, {@code ANIMATION_DURATION},
{@code LAYOUT_MEASURE_DURATION}, {@code DRAW_DURATION}, {@code SYNC_DURATION},
{@code COMMAND_ISSUE_DURATION}, {@code SWAP_BUFFERS_DURATION},
-{@code TOTAL_DURATION}, and {@code FIRST_DRAW_FRAME}
+{@code TOTAL_DURATION}, and {@code FIRST_DRAW_FRAME}.
</p>
diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd
index 7c8bfe8..88dca54 100644
--- a/docs/html/preview/behavior-changes.jd
+++ b/docs/html/preview/behavior-changes.jd
@@ -23,6 +23,7 @@
<li><a href="#permfilesys">File System Permission Changes</a></li>
</ol>
</li>
+ <li><a href="#sharing-files">Sharing Files Between Apps</a></li>
<li><a href="#accessibility">Accessibility Improvements</a>
<ol>
<li><a href="#screen-zoom">Screen Zoom</a></li>
@@ -257,6 +258,23 @@
</li>
</ul>
+<h2 id="sharing-files">Sharing Files Between Apps</h2>
+
+<p>
+For apps targeting Android N, the Android framework enforces
+the {@link android.os.StrictMode} API policy that prohibits exposing {@code file://} URIs
+outside your app. If an intent containing a file URI leaves your app, the app fails
+with a {@code FileUriExposedException} exception.
+</p>
+
+<p>
+To share files between applications, you should send a {@code content://} URI
+and grant a temporary access permission on the URI. The easiest way to grant this permission is by
+using the {@link android.support.v4.content.FileProvider} class. For more information
+on permissions and sharing files,
+see <a href="{@docRoot}training/secure-file-sharing/index.html">Sharing Files</a>.
+</p>
+
<h2 id="accessibility">Accessibility Improvements</h2>
<p>
@@ -487,7 +505,7 @@
running in device owner mode, the <code>DISALLOW_ADD_USER</code> restriction
is automatically set. This prevents users from creating unmanaged secondary
users. In addition, the <code>CreateUser()</code> and
- <code>createAndInitial()</code> methods are deprecated; the new
+ <code>createAndInitializeUser()</code> methods are deprecated; the new
<code>DevicePolicyManager.createAndManageUser()</code> method replaces them.
</li>
@@ -496,6 +514,10 @@
<code>DevicePolicyManagewr.getWifiMacAddress()</code>. If Wi-Fi has never
been enabled on the device, this method returns a value of {@code null}.
</li>
+
+ <li>The Work Mode setting controls access to work apps. When work mode is off the
+ system launcher indicates work apps are unavailable by greying them out. Enabling
+ work mode again restores normal behavior.
</ul>
<p>
@@ -576,5 +598,33 @@
which causes {@code ActivityThread.StopInfo} to throw a
{@code RuntimeException} when your app targets Android N.
</li>
+
+<li>
+If an app posts {@link java.lang.Runnable} tasks to a {@link android.view.View}, and
+the {@link android.view.View}
+is not attached to a window, the system
+queues the {@link java.lang.Runnable} task with the {@link android.view.View};
+the {@link java.lang.Runnable} task does not execute until the
+{@link android.view.View} is attached
+to a window. This behavior fixes the following bugs:
+<ul>
+ <li>If an app posted to a {@link android.view.View} from a thread other than the intended
+ window’s UI thread, the {@link java.lang.Runnable} may run on the wrong thread as a result.
+ </li>
+ <li>If the {@link java.lang.Runnable} task was posted from a thread other than
+ a looper thread, the app could expose the {@link java.lang.Runnable} task.</li>
+</ul>
+</li>
+
+<li>
+If an app on Android N with
+{@link android.Manifest.permission#DELETE_PACKAGES DELETE_PACKAGES}
+permission tries to delete a package, but a different app had installed that package,
+the system requires user confirmation. In this scenario, apps should expect
+{@link android.content.pm.PackageInstaller#STATUS_PENDING_USER_ACTION STATUS_PENDING_USER_ACTION}
+as the return status when they invoke
+{@link android.content.pm.PackageInstaller#uninstall PackageInstaller.uninstall()}.
+</li>
+
</ul>
diff --git a/docs/html/preview/features/notification-updates.jd b/docs/html/preview/features/notification-updates.jd
index c405360..0163337 100644
--- a/docs/html/preview/features/notification-updates.jd
+++ b/docs/html/preview/features/notification-updates.jd
@@ -209,9 +209,10 @@
The notification must be either updated or cancelled after the app has
received remote input. When the user replies to a remote update
using Direct Reply,
- do not cancel the notification. Instead, update the notification to display the user's reply. You can update the notification using a
- <code>MessagingStyle</code>, or you can append the user's reply to the remote
- input history.
+ do not cancel the notification. Instead, update the notification to display the user's reply.
+For notifications using {@code MessagingStyle}, you should add
+the reply as the latest message. When using other templates, you can
+append the user's reply to the remote-input history.
</p>
<h2 id="bundle">Bundled Notifications</h2>
@@ -395,4 +396,4 @@
.addMessage("What's up?", timestamp2, "Coworker")
.addMessage("Not much", timestamp3, null)
.addMessage("How about lunch?", timestamp4, "Coworker"));
-</pre>
\ No newline at end of file
+</pre>