Skip to content

Commit a893157

Browse files
authored
Revert "Framework sends a11y message when enabling semantics (flutter#159163)" (flutter#160039)
This reverts commit 1a2d6a3. This is a straight revert as we are pivot away from using message channel, instead we will be adding api to dart:ui. See flutter/engine#56691 ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 119f170 commit a893157

File tree

5 files changed

+8
-92
lines changed

5 files changed

+8
-92
lines changed

packages/flutter/lib/src/rendering/binding.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -790,20 +790,10 @@ class _BindingPipelineManifold extends ChangeNotifier implements PipelineManifol
790790
ChangeNotifier.maybeDispatchObjectCreation(this);
791791
}
792792
_binding.addSemanticsEnabledListener(notifyListeners);
793-
if (_binding.semanticsEnabled) {
794-
SystemChannels.accessibility.send(const GeneratingSemanticsTreeSemanticsEvent(true).toMap());
795-
}
796793
}
797794

798795
final RendererBinding _binding;
799796

800-
@protected
801-
@override
802-
void notifyListeners() {
803-
SystemChannels.accessibility.send(GeneratingSemanticsTreeSemanticsEvent(_binding.semanticsEnabled).toMap());
804-
super.notifyListeners();
805-
}
806-
807797
@override
808798
void requestVisualUpdate() {
809799
_binding.ensureVisualUpdate();

packages/flutter/lib/src/semantics/semantics_event.dart

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -135,40 +135,6 @@ class TooltipSemanticsEvent extends SemanticsEvent {
135135
}
136136
}
137137

138-
/// An event to notify native OS that flutter starts or stops the semantics tree
139-
/// generation
140-
///
141-
/// The [generating] indicate whether flutter starts generating the semantics
142-
/// tree. If true, flutter will start sending semantics update to platform
143-
/// embedding.
144-
///
145-
/// Embeddings must be ready to receive semantics update after they receive this
146-
/// event with [generating] set to true as framework will start sending
147-
/// semantics update in the next frame.
148-
///
149-
/// If [generating] is false, embeddings need to clean up previous updates as
150-
/// the framework semantics tree was completely destroyed.
151-
class GeneratingSemanticsTreeSemanticsEvent extends SemanticsEvent {
152-
153-
/// Constructs an event that notify platform whether it is generating
154-
/// semantics tree.
155-
const GeneratingSemanticsTreeSemanticsEvent(this.generating)
156-
: super('generatingSemanticsTree');
157-
158-
/// Whether framework starts generating the semantics tree.
159-
///
160-
/// If true, flutter starts sending semantics update to platform
161-
/// embedding.
162-
final bool generating;
163-
164-
@override
165-
Map<String, dynamic> getDataMap() {
166-
return <String, dynamic> {
167-
'generating': generating,
168-
};
169-
}
170-
}
171-
172138
/// An event which triggers long press semantic feedback.
173139
///
174140
/// Currently only honored on Android. Triggers a long-press specific sound

packages/flutter/test/rendering/binding_pipeline_manifold_semantics_event_test.dart

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/flutter/test/widgets/feedback_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void main () {
3838

3939
testWidgets('forTap', (WidgetTester tester) async {
4040
final SemanticsTester semanticsTester = SemanticsTester(tester);
41-
semanticEvents.clear();
41+
4242
await tester.pumpWidget(TestWidget(
4343
tapHandler: (BuildContext context) {
4444
return () => Feedback.forTap(context);
@@ -67,7 +67,7 @@ void main () {
6767

6868
testWidgets('forTap Wrapper', (WidgetTester tester) async {
6969
final SemanticsTester semanticsTester = SemanticsTester(tester);
70-
semanticEvents.clear();
70+
7171
int callbackCount = 0;
7272
void callback() {
7373
callbackCount++;
@@ -102,7 +102,7 @@ void main () {
102102

103103
testWidgets('forLongPress', (WidgetTester tester) async {
104104
final SemanticsTester semanticsTester = SemanticsTester(tester);
105-
semanticEvents.clear();
105+
106106
await tester.pumpWidget(TestWidget(
107107
longPressHandler: (BuildContext context) {
108108
return () => Feedback.forLongPress(context);
@@ -130,7 +130,6 @@ void main () {
130130

131131
testWidgets('forLongPress Wrapper', (WidgetTester tester) async {
132132
final SemanticsTester semanticsTester = SemanticsTester(tester);
133-
semanticEvents.clear();
134133
int callbackCount = 0;
135134
void callback() {
136135
callbackCount++;

packages/flutter_driver/test/src/real_tests/extension_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void main() {
280280
'response': <String, dynamic>{},
281281
},
282282
);
283-
}, semanticsEnabled: false); // Disabling semantics to prevent the unexpected message.
283+
});
284284

285285
testWidgets(
286286
'waiting for NoPendingPlatformMessages returns until a single method channel call returns', (WidgetTester tester) async {
@@ -313,7 +313,7 @@ void main() {
313313
'response': <String, dynamic>{},
314314
},
315315
);
316-
}, semanticsEnabled: false); // Disabling semantics to prevent the unexpected message.
316+
});
317317

318318
testWidgets(
319319
'waiting for NoPendingPlatformMessages returns until both method channel calls return', (WidgetTester tester) async {
@@ -362,7 +362,7 @@ void main() {
362362
'response': <String, dynamic>{},
363363
},
364364
);
365-
}, semanticsEnabled: false); // Disabling semantics to prevent the unexpected message.
365+
});
366366

367367
testWidgets(
368368
'waiting for NoPendingPlatformMessages returns until new method channel call returns', (WidgetTester tester) async {
@@ -413,7 +413,7 @@ void main() {
413413
'response': <String, dynamic>{},
414414
},
415415
);
416-
}, semanticsEnabled: false); // Disabling semantics to prevent the unexpected message.
416+
});
417417

418418
testWidgets(
419419
'waiting for NoPendingPlatformMessages returns until both old and new method channel calls return', (WidgetTester tester) async {
@@ -463,7 +463,7 @@ void main() {
463463
'response': <String, dynamic>{},
464464
},
465465
);
466-
}, semanticsEnabled: false); // Disabling semantics to prevent the unexpected message.
466+
});
467467
});
468468

469469
group('getSemanticsId', () {

0 commit comments

Comments
 (0)