diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-01-17 14:36:46 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-01-17 14:51:45 -0800 |
commit | 8a78fd4d9572dff95432fcc4ba0e87563415b728 (patch) | |
tree | 14e2d6c5bcf4c63cd6be048b74ca20188a764d9e /core/java/android/widget/RelativeLayout.java | |
parent | 32313b161f7c7d17841bf49b3d146fd19dd7fde1 (diff) | |
download | frameworks_base-8a78fd4d9572dff95432fcc4ba0e87563415b728.zip frameworks_base-8a78fd4d9572dff95432fcc4ba0e87563415b728.tar.gz frameworks_base-8a78fd4d9572dff95432fcc4ba0e87563415b728.tar.bz2 |
AccessibilityEvent/AccessibilityNodeInfo class name property should be set to only framework classes.
AccessibilityEvent and AccessibilityNodeInfo have a property className which is set to the source
Java class. This is problematic since leads to leaking private classes which would allow an
accessibility service to load classes from other packages. This is strongly undesirable since
not trusted code can be loaded, and hence executed, in the accessibility service. To address
that the class name is set to the most concrete framework class extended by the info/event
source.
bug:5878943
Change-Id: I7b3114ece8772ea2773f5151e21b8a6f2006882a
Diffstat (limited to 'core/java/android/widget/RelativeLayout.java')
-rw-r--r-- | core/java/android/widget/RelativeLayout.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java index a452fec..e4b8f34 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -40,6 +40,7 @@ import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; +import android.view.accessibility.AccessibilityNodeInfo; import android.widget.RemoteViews.RemoteView; import static android.util.Log.d; @@ -985,6 +986,18 @@ public class RelativeLayout extends ViewGroup { return false; } + @Override + public void onInitializeAccessibilityEvent(AccessibilityEvent event) { + super.onInitializeAccessibilityEvent(event); + event.setClassName(RelativeLayout.class.getName()); + } + + @Override + public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { + super.onInitializeAccessibilityNodeInfo(info); + info.setClassName(RelativeLayout.class.getName()); + } + /** * Compares two views in left-to-right and top-to-bottom fashion. */ |