diff options
author | Yorke Lee <yorkelee@google.com> | 2014-03-10 16:06:00 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-03-10 23:08:53 +0000 |
commit | aeeec7e4ac819289fe977704c6b55a754c019f85 (patch) | |
tree | 19aeb99fbf64761072f9630fdfde13c84f2aa342 /InCallUI | |
parent | ef169940c2ae0d59bfcb884ebea1e4401034d367 (diff) |
DO NOT MERGE Fix NPE in DialpadFragment.onHover when fragment is detached
Use the view's context(which should never be null) instead of
getActivity() to get an instance of AccessibilityManager.
Bug: 13400751
Change-Id: Ib93e16e82b8eea4683ff09aaef81ee66f15f903c
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/DialpadFragment.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/DialpadFragment.java b/InCallUI/src/com/android/incallui/DialpadFragment.java index c6ec742af..e9cabd2c4 100644 --- a/InCallUI/src/com/android/incallui/DialpadFragment.java +++ b/InCallUI/src/com/android/incallui/DialpadFragment.java @@ -333,9 +333,8 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese @Override public void onClick(View v) { - Log.d(this, "onClick"); final AccessibilityManager accessibilityManager = (AccessibilityManager) - getActivity().getSystemService(Context.ACCESSIBILITY_SERVICE); + v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); // When accessibility is on, simulate press and release to preserve the // semantic meaning of performClick(). Required for Braille support. if (accessibilityManager.isEnabled()) { @@ -352,7 +351,7 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese // When touch exploration is turned on, lifting a finger while inside // the button's hover target bounds should perform a click action. final AccessibilityManager accessibilityManager = (AccessibilityManager) - getActivity().getSystemService(Context.ACCESSIBILITY_SERVICE); + v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); if (accessibilityManager.isEnabled() && accessibilityManager.isTouchExplorationEnabled()) { |