diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-12-08 15:07:24 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-12-08 16:09:45 -0800 |
commit | d0030b05f591cbadb21f51b7c87f2d8813f35627 (patch) | |
tree | f690494af4d5942b02fb2ef2caffa18c77c0f85b /src/com/android/launcher3/PagedView.java | |
parent | fcb1dd183cc81208ec4d6498b12e7e969a3e3e9a (diff) | |
download | android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.tar.gz android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.tar.bz2 android_packages_apps_Trebuchet-d0030b05f591cbadb21f51b7c87f2d8813f35627.zip |
Adding placeholder method for compat implementations for Accessibility manager
> Moving some utility methods to the compat class
Bug: 69611105
Change-Id: Ide0cab0b926d7bc03617fc568d2a2b429ee00cd9
Diffstat (limited to 'src/com/android/launcher3/PagedView.java')
-rw-r--r-- | src/com/android/launcher3/PagedView.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index b23568e9e..d6b56564e 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -16,6 +16,9 @@ package com.android.launcher3; +import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; +import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; + import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.LayoutTransition; @@ -41,7 +44,6 @@ import android.view.ViewDebug; import android.view.ViewGroup; import android.view.ViewParent; import android.view.accessibility.AccessibilityEvent; -import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; @@ -521,9 +523,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } private void sendScrollAccessibilityEvent() { - AccessibilityManager am = - (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); - if (am.isEnabled()) { + if (isObservedEventType(getContext(), AccessibilityEvent.TYPE_VIEW_SCROLLED)) { if (mCurrentPage != getNextPage()) { AccessibilityEvent ev = AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED); @@ -572,9 +572,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc } onPostReorderingAnimationCompleted(); - AccessibilityManager am = (AccessibilityManager) - getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); - if (am.isEnabled()) { + if (isAccessibilityEnabled(getContext())) { // Notify the user when the page changes announceForAccessibility(getCurrentPageDescription()); } |