Unverified Commit d14a898f authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

remove LICENSE/NOTICES work around (#61199)

Now that google3 has been updated, remove the LICENSE loading fallback. This was done in cl/320506032

#16723
parent fd80503f
...@@ -103,14 +103,7 @@ mixin ServicesBinding on BindingBase, SchedulerBinding { ...@@ -103,14 +103,7 @@ mixin ServicesBinding on BindingBase, SchedulerBinding {
// TODO(ianh): Remove this complexity once these bugs are fixed. // TODO(ianh): Remove this complexity once these bugs are fixed.
final Completer<String> rawLicenses = Completer<String>(); final Completer<String> rawLicenses = Completer<String>();
scheduleTask(() async { scheduleTask(() async {
// TODO(jonahwilliams): temporary catch to allow migrating LICENSE to NOTICES. rawLicenses.complete(await rootBundle.loadString('NOTICES', cache: false));
// Once both the tool and google3 use notices this can be removed after PR:
// https://github.com/flutter/flutter/pull/57871
try {
rawLicenses.complete(await rootBundle.loadString('NOTICES', cache: false));
} on FlutterError {
rawLicenses.complete(await rootBundle.loadString('LICENSE', cache: false));
}
}, Priority.animation); }, Priority.animation);
await rawLicenses.future; await rawLicenses.future;
final Completer<List<LicenseEntry>> parsedLicenses = Completer<List<LicenseEntry>>(); final Completer<List<LicenseEntry>> parsedLicenses = Completer<List<LicenseEntry>>();
......
...@@ -46,10 +46,7 @@ class TestBinding extends BindingBase with SchedulerBinding, ServicesBinding { ...@@ -46,10 +46,7 @@ class TestBinding extends BindingBase with SchedulerBinding, ServicesBinding {
BinaryMessenger createBinaryMessenger() { BinaryMessenger createBinaryMessenger() {
return super.createBinaryMessenger() return super.createBinaryMessenger()
..setMockMessageHandler('flutter/assets', (ByteData message) async { ..setMockMessageHandler('flutter/assets', (ByteData message) async {
// Temporarily check for both LICENSE and NOTICES if (const StringCodec().decodeMessage(message) == 'NOTICES') {
// Once both the tool and google3 use notices this can be removed after PR:
// https://github.com/flutter/flutter/pull/57871
if (const StringCodec().decodeMessage(message) == 'LICENSE' || const StringCodec().decodeMessage(message) == 'NOTICES') {
return const StringCodec().encodeMessage(licenses); return const StringCodec().encodeMessage(licenses);
} }
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment