From 82248c3c9b830dbcfd0001c62bbc5b36ebc4f7b2 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Sep 2019 12:41:56 -0700 Subject: [PATCH] Revert "Support accessibility labels on iOS switches. (#12404)" This reverts commit 147d0c3805499f5302f763da01fc40259b1a22ee. --- lib/ui/window.dart | 8 -------- lib/ui/window/window.h | 1 - lib/web_ui/lib/src/ui/window.dart | 9 --------- .../ios/framework/Source/FlutterViewController.mm | 12 ------------ 4 files changed, 30 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index edff156af1ef4..a810551e38254 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -1194,7 +1194,6 @@ class AccessibilityFeatures { static const int _kDisableAnimationsIndex = 1 << 2; static const int _kBoldTextIndex = 1 << 3; static const int _kReduceMotionIndex = 1 << 4; - static const int _kOnOffSwitchLabelsIndex = 1 << 5; // A bitfield which represents each enabled feature. final int _index; @@ -1222,11 +1221,6 @@ class AccessibilityFeatures { /// Only supported on iOS. bool get reduceMotion => _kReduceMotionIndex & _index != 0; - /// The platform is requesting that on/off labels be added to switches. - /// - /// Only supported on iOS. - bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0; - @override String toString() { final List features = []; @@ -1240,8 +1234,6 @@ class AccessibilityFeatures { features.add('boldText'); if (reduceMotion) features.add('reduceMotion'); - if (onOffSwitchLabels) - features.add('onOffSwitchLabels'); return 'AccessibilityFeatures$features'; } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 6039b9e178dc0..99a8585a6910a 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -44,7 +44,6 @@ enum class AccessibilityFeatureFlag : int32_t { kDisableAnimations = 1 << 2, kBoldText = 1 << 3, kReduceMotion = 1 << 4, - kOnOffSwitchLabels = 1 << 5, }; class WindowClient { diff --git a/lib/web_ui/lib/src/ui/window.dart b/lib/web_ui/lib/src/ui/window.dart index 56c09a4133dd7..80f15c712d165 100644 --- a/lib/web_ui/lib/src/ui/window.dart +++ b/lib/web_ui/lib/src/ui/window.dart @@ -1012,7 +1012,6 @@ class AccessibilityFeatures { static const int _kDisableAnimationsIndex = 1 << 2; static const int _kBoldTextIndex = 1 << 3; static const int _kReduceMotionIndex = 1 << 4; - static const int _kOnOffSwitchLabelsIndex = 1 << 5; // A bitfield which represents each enabled feature. final int _index; @@ -1040,11 +1039,6 @@ class AccessibilityFeatures { /// Only supported on iOS. bool get reduceMotion => _kReduceMotionIndex & _index != 0; - /// The platform is requesting that on/off labels be added to switches. - /// - /// Only supported on iOS. - bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0; - @override String toString() { final List features = []; @@ -1063,9 +1057,6 @@ class AccessibilityFeatures { if (reduceMotion) { features.add('reduceMotion'); } - if (onOffSwitchLabels) { - features.add('onOffSwitchLabels'); - } return 'AccessibilityFeatures$features'; } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 09a32e67f05a5..87e605e97fd48 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -234,16 +234,6 @@ - (void)setupNotificationCenterObservers { name:UIAccessibilityBoldTextStatusDidChangeNotification object:nil]; - [center addObserver:self - selector:@selector(onAccessibilityStatusChanged:) - name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification - object:nil]; - - [center addObserver:self - selector:@selector(onAccessibilityStatusChanged:) - name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification - object:nil]; - [center addObserver:self selector:@selector(onUserSettingsChanged:) name:UIContentSizeCategoryDidChangeNotification @@ -867,8 +857,6 @@ - (void)onAccessibilityStatusChanged:(NSNotification*)notification { flags |= static_cast(flutter::AccessibilityFeatureFlag::kReduceMotion); if (UIAccessibilityIsBoldTextEnabled()) flags |= static_cast(flutter::AccessibilityFeatureFlag::kBoldText); - if (UIAccessibilityIsOnOffSwitchLabelsEnabled()) - flags |= static_cast(flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels); #if TARGET_OS_SIMULATOR // There doesn't appear to be any way to determine whether the accessibility // inspector is enabled on the simulator. We conservatively always turn on the