From 491bc2b8d6817386c75d5628d09ac406de1d92d3 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 9 Aug 2016 13:18:21 -0700 Subject: [PATCH 1/2] Cherrypick so we can publish N version code description ASAP Fix issue #30766518: Document what targeting N does Also small documentation cleanup in a few other places. (cherry picked from commit b34cbedb4e36f184232d7f40b093bdc9fd0cd752) Change-Id: I9560b29faa4f2674277349272af8193122a1f95e --- core/java/android/app/Fragment.java | 7 ++-- core/java/android/os/Build.java | 42 ++++++++++++++++++- core/java/android/view/View.java | 4 +- .../drawable/AnimatedVectorDrawable.java | 2 +- 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java index a9cd34cd2321d..99bfaa4b007ec 100644 --- a/core/java/android/app/Fragment.java +++ b/core/java/android/app/Fragment.java @@ -1483,9 +1483,10 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene * at this point. If you want to do work once the activity itself is * created, see {@link #onActivityCreated(Bundle)}. * - *

If your app's targetSdkVersion is 23 or lower, child fragments - * being restored from the savedInstanceState are restored after onCreate - * returns. When targeting N or above and running on an N or newer platform version + *

If your app's targetSdkVersion is {@link android.os.Build.VERSION_CODES#M} + * or lower, child fragments being restored from the savedInstanceState are restored after + * onCreate returns. When targeting @link android.os.Build.VERSION_CODES#N} or + * above and running on an N or newer platform version * they are restored by Fragment.onCreate.

* * @param savedInstanceState If the fragment is being re-created from diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index dc7be6b5ad613..207169fccd685 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -669,7 +669,47 @@ public class Build { public static final int M = 23; /** - * N is for ¯\_(ツ)_/¯. + * N is for Nougat. + * + *

Applications targeting this or a later release will get these + * new changes in behavior:

+ * */ public static final int N = 24; } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 47cffac755938..86324468010cb 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -3748,9 +3748,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link android.os.Build.VERSION_CODES#N API 24} will be able to participate * in the drag operation and receive the dragged content. * - * If this is the only flag set, then the drag recipient will only have access to text data + *

If this is the only flag set, then the drag recipient will only have access to text data * and intents contained in the {@link ClipData} object. Access to URIs contained in the - * {@link ClipData} is determined by other DRAG_FLAG_GLOBAL_* flags. + * {@link ClipData} is determined by other DRAG_FLAG_GLOBAL_* flags

*/ public static final int DRAG_FLAG_GLOBAL = 1 << 8; // 256 diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java index 6762bea1ca350..ee6780722f0c3 100644 --- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java @@ -208,7 +208,7 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 { /** * In order to avoid breaking old apps, we only throw exception on invalid VectorDrawable - * animations * for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) + * animations for apps targeting N and later. For older apps, we ignore (i.e. quietly skip) * these animations. * * @return whether invalid animations for vector drawable should be ignored. From da6be5b8718f326a6ffe70634d3c41d82ba582a0 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 9 Aug 2016 18:00:31 -0700 Subject: [PATCH 2/2] A little more on issue #30766518: Document what targeting N does (cherry picked from commit 5f1649e85293428850659e35a52d812416812704) Change-Id: Ieaad1f3ddfa7ef3444e3b513181555f87ecb8c3f --- core/java/android/app/Fragment.java | 2 +- core/java/android/os/Build.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java index 99bfaa4b007ec..5dead2850942d 100644 --- a/core/java/android/app/Fragment.java +++ b/core/java/android/app/Fragment.java @@ -1485,7 +1485,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene * *

If your app's targetSdkVersion is {@link android.os.Build.VERSION_CODES#M} * or lower, child fragments being restored from the savedInstanceState are restored after - * onCreate returns. When targeting @link android.os.Build.VERSION_CODES#N} or + * onCreate returns. When targeting {@link android.os.Build.VERSION_CODES#N} or * above and running on an N or newer platform version * they are restored by Fragment.onCreate.

* diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 207169fccd685..06a4502593f80 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -677,9 +677,9 @@ public class Build { *
  • {@link android.app.DownloadManager.Request#setAllowedNetworkTypes * DownloadManager.Request.setAllowedNetworkTypes} * will disable "allow over metered" when specifying only - * {@link android.app.DownloadManager.Request#NETWORK_WIFI}. + * {@link android.app.DownloadManager.Request#NETWORK_WIFI}.
  • *
  • {@link android.app.DownloadManager} no longer allows access to raw - * file paths. + * file paths.
  • *
  • {@link android.app.Notification.Builder#setShowWhen * Notification.Builder.setShowWhen} * must be called explicitly to have the time shown, and various other changes in