diff options
| author | 2019-02-05 12:33:43 +0000 | |
|---|---|---|
| committer | 2019-02-05 12:51:52 +0000 | |
| commit | 79bceebe32fdaddd425a25d4e75eddffa15cee49 (patch) | |
| tree | 106751b4170f9c7897d6f9f7062b2221d4c836a9 | |
| parent | 80ced71afdb1202469d5a9df715f6ed990995f30 (diff) | |
Restrict reflection access to mLayoutParams
Users should rely on the getter / setter. The setter additionally
guarantees internal state correctness.
Bug: 123768937
Test: n/a
Change-Id: Ia2dcbe9db3fdeab8aeac9b80dcfaaa0932724dc2
| -rw-r--r-- | core/java/android/view/View.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 992b99617064..ab18fbdca85f 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4140,9 +4140,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * The layout parameters associated with this view and used by the parent * {@link android.view.ViewGroup} to determine how this view should be * laid out. + * + * The field should not be used directly. Instead {@link #getLayoutParams()} and {@link + * #setLayoutParams(ViewGroup.LayoutParams)} should be used. The setter guarantees internal + * state correctness of the class. * {@hide} */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) protected ViewGroup.LayoutParams mLayoutParams; /** |