summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Filip Pavlis <pavlis@google.com> 2019-02-06 15:45:14 +0000
committer Filip Pavlis <pavlis@google.com> 2019-03-22 19:26:35 +0000
commit638d2aa892f423d5b83209323b348cefa1ca559c (patch)
treecfe3c33e3bc53fccb47a24441b5651c03c5b49d6
parentfe9f8eb8345203b689628c91bf7eab36a6bd2f77 (diff)
Restrict access to private flags.
Specifially restrict access to mPrivateFlags and mPrivateFlags2. We were not able to find a legitimate use-case. Several flags have corresponding public APIs. We are deliberately breaking the usage of any flags that don't have alternative API already as it breaks encapsulation of the View class that is supposed to manage these flags on its own. Some examples of existing public APIs for important flags: PFLAG_FOCUSED - hasFocus PFLAG_SELECTED - isSelected - setSelected PFLAG_HOVERED - isHovered - setHovered PFLAG2_ACCESSIBILITY_FOCUSED - isAccessibilityFocused - requestAccessibilityFocus Bug: b/123769414 Bug: b/123768943 Bug: b/129147060 Test: N/A Change-Id: If8acd7e8b516e4ce6808dcd57485659b616e24ee
-rw-r--r--core/java/android/view/View.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 90110e60f0fd..9267f700f674 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4040,11 +4040,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}, formatToHexString = true)
/* @hide */
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123769414)
public int mPrivateFlags;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 123768943)
int mPrivateFlags2;
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 129147060)
int mPrivateFlags3;
private int mPrivateFlags4;