Touch exploration - nits
Change-Id: Ie49558e0a81218dbad70c02f81dd7a59b3213d5c
diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java
index 11c9392..5e18f55 100644
--- a/core/java/android/view/accessibility/AccessibilityEvent.java
+++ b/core/java/android/view/accessibility/AccessibilityEvent.java
@@ -253,7 +253,7 @@
public static final int TYPES_ALL_MASK = 0xFFFFFFFF;
private static final int MAX_POOL_SIZE = 10;
- private static final Object mPoolLock = new Object();
+ private static final Object sPoolLock = new Object();
private static AccessibilityEvent sPool;
private static int sPoolSize;
@@ -375,7 +375,7 @@
* @return An instance.
*/
public static AccessibilityEvent obtain() {
- synchronized (mPoolLock) {
+ synchronized (sPoolLock) {
if (sPool != null) {
AccessibilityEvent event = sPool;
sPool = sPool.mNext;
@@ -392,14 +392,16 @@
* Return an instance back to be reused.
* <p>
* <b>Note: You must not touch the object after calling this function.</b>
+ *
+ * @throws IllegalStateException If the event is already recycled.
*/
@Override
public void recycle() {
if (mIsInPool) {
- return;
+ throw new IllegalStateException("Event already recycled!");
}
clear();
- synchronized (mPoolLock) {
+ synchronized (sPoolLock) {
if (sPoolSize <= MAX_POOL_SIZE) {
mNext = sPool;
sPool = this;