Migrate devicelab tasks i-z to null safety. (#85998)

This commit is contained in:
Darren Austin
2021-07-13 16:41:06 -07:00
committed by GitHub
parent c800b9c3e4
commit 0c81077582
61 changed files with 45 additions and 167 deletions

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
@@ -27,7 +25,7 @@ Future<void> main() async {
section('Find Java');
final String javaHome = await findJavaHome();
final String? javaHome = await findJavaHome();
if (javaHome == null)
return TaskResult.failure('Could not find Java');
print('\nUsing JAVA_HOME=$javaHome');
@@ -325,9 +323,9 @@ Future<void> main() async {
final File apkFile = File(releaseHostApk);
final Archive apk = ZipDecoder().decodeBytes(apkFile.readAsBytesSync());
// Shouldn't be missing since we already checked it exists above.
final ArchiveFile noticesFile = apk.findFile('assets/flutter_assets/NOTICES.Z');
final ArchiveFile? noticesFile = apk.findFile('assets/flutter_assets/NOTICES.Z');
final Uint8List licenseData = noticesFile.content as Uint8List;
final Uint8List licenseData = noticesFile?.content as Uint8List;
if (licenseData == null) {
return TaskResult.failure('Invalid license file.');
}