From 96fea022f29f13c296ccf9388966bf0efa805f6e Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Tue, 8 Mar 2016 13:05:10 -0800 Subject: [PATCH] Clarify docs about event recycling. Bug: 27454838 Change-Id: I65d0ced3198dc6ad45b99e4932a0d6e32306cf10 --- .../accessibilityservice/AccessibilityService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index ac3b8e360b2e9..b59306633344b 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -406,7 +406,9 @@ public abstract class AccessibilityService extends Service { /** * Callback for {@link android.view.accessibility.AccessibilityEvent}s. * - * @param event An event. + * @param event The new event. This event is owned by the caller and cannot be used after + * this method returns. Services wishing to use the event after this method returns should + * make a copy. */ public abstract void onAccessibilityEvent(AccessibilityEvent event); @@ -493,7 +495,9 @@ public abstract class AccessibilityService extends Service { * functionality. *

* - * @param event The event to be processed. + * @param event The event to be processed. This event is owned by the caller and cannot be used + * after this method returns. Services wishing to use the event after this method returns should + * make a copy. * @return If true then the event will be consumed and not delivered to * applications, otherwise it will be delivered as usual. */