Skip to content

Commit

Permalink
Cleanup unsed code on AccessibilityInfoModule
Browse files Browse the repository at this point in the history
Summary:
This diff cleansup unused code on AccessibilityInfoModule class

changelog: [Android][Deprecated] Remove code used by deprecated Android API levels

Reviewed By: JoshuaGross

Differential Revision: D22771912

fbshipit-source-id: f32808fa93f75c10324e8875b85fe4e541b284b8
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jul 31, 2020
1 parent b7d8641 commit b133427
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ public String getName() {
return "AccessibilityInfo";
}

@TargetApi(Build.VERSION_CODES.KITKAT)
private boolean getIsReduceMotionEnabledValue() {
String value =
Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1
? null
: Settings.Global.getString(
mContentResolver, Settings.Global.TRANSITION_ANIMATION_SCALE);
Settings.Global.getString(mContentResolver, Settings.Global.TRANSITION_ANIMATION_SCALE);

return value != null && value.equals("0.0");
}
Expand Down Expand Up @@ -139,11 +137,10 @@ private void updateAndSendTouchExplorationChangeEvent(boolean enabled) {
}

@Override
@TargetApi(Build.VERSION_CODES.KITKAT)
public void onHostResume() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mAccessibilityManager.addTouchExplorationStateChangeListener(
mTouchExplorationStateChangeListener);
}
mAccessibilityManager.addTouchExplorationStateChangeListener(
mTouchExplorationStateChangeListener);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
Uri transitionUri = Settings.Global.getUriFor(Settings.Global.TRANSITION_ANIMATION_SCALE);
Expand All @@ -155,15 +152,12 @@ public void onHostResume() {
}

@Override
@TargetApi(Build.VERSION_CODES.KITKAT)
public void onHostPause() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mAccessibilityManager.removeTouchExplorationStateChangeListener(
mTouchExplorationStateChangeListener);
}
mAccessibilityManager.removeTouchExplorationStateChangeListener(
mTouchExplorationStateChangeListener);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mContentResolver.unregisterContentObserver(animationScaleObserver);
}
mContentResolver.unregisterContentObserver(animationScaleObserver);
}

@Override
Expand Down

0 comments on commit b133427

Please sign in to comment.