From c90e782c718929d3cb569dd335b86d0548f3cc16 Mon Sep 17 00:00:00 2001 From: Clara Bayarri Date: Mon, 26 Nov 2018 12:50:40 +0000 Subject: [PATCH] Restrict unsupported API usage to View#mParent/mTop/mLeft/mRight/mBottom All these properties have getters and setters since API 11 and should be accessed via those. Bug: 117521221 Bug: 117520719 Bug: 117521672 Test: none Change-Id: Id96421370abf6d9417d7411698aae7603c1e0ff1 --- core/java/android/view/View.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 85c980881987e..f19d40ab46c3b 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -3993,7 +3993,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * @see #getParent() */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected ViewParent mParent; /** @@ -4199,7 +4199,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@hide} */ @ViewDebug.ExportedProperty(category = "layout") - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected int mLeft; /** * The distance in pixels from the left edge of this view's parent @@ -4207,7 +4207,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@hide} */ @ViewDebug.ExportedProperty(category = "layout") - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected int mRight; /** * The distance in pixels from the top edge of this view's parent @@ -4215,7 +4215,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@hide} */ @ViewDebug.ExportedProperty(category = "layout") - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected int mTop; /** * The distance in pixels from the top edge of this view's parent @@ -4223,7 +4223,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@hide} */ @ViewDebug.ExportedProperty(category = "layout") - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected int mBottom; /**