chore: enable Flutter Android workflow on aarch64 (#113829)

- removes invalid arch check on Android workflow in order to enable Android development on any device supported
Signed-off-by: 's avatarTheOneWithTheBraid <the-one@with-the-braid.cf>
Signed-off-by: 's avatarTheOneWithTheBraid <the-one@with-the-braid.cf>
parent c1ceda41
...@@ -44,19 +44,14 @@ class AndroidWorkflow implements Workflow { ...@@ -44,19 +44,14 @@ class AndroidWorkflow implements Workflow {
AndroidWorkflow({ AndroidWorkflow({
required AndroidSdk? androidSdk, required AndroidSdk? androidSdk,
required FeatureFlags featureFlags, required FeatureFlags featureFlags,
required OperatingSystemUtils operatingSystemUtils,
}) : _androidSdk = androidSdk, }) : _androidSdk = androidSdk,
_featureFlags = featureFlags, _featureFlags = featureFlags;
_operatingSystemUtils = operatingSystemUtils;
final AndroidSdk? _androidSdk; final AndroidSdk? _androidSdk;
final FeatureFlags _featureFlags; final FeatureFlags _featureFlags;
final OperatingSystemUtils _operatingSystemUtils;
@override @override
bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled;
// Android Studio is not currently supported on Linux Arm64 Hosts.
&& _operatingSystemUtils.hostPlatform != HostPlatform.linux_arm64;
@override @override
bool get canListDevices => appliesToHostPlatform && _androidSdk != null bool get canListDevices => appliesToHostPlatform && _androidSdk != null
......
...@@ -120,7 +120,6 @@ Future<T> runInContext<T>( ...@@ -120,7 +120,6 @@ Future<T> runInContext<T>(
AndroidWorkflow: () => AndroidWorkflow( AndroidWorkflow: () => AndroidWorkflow(
androidSdk: globals.androidSdk, androidSdk: globals.androidSdk,
featureFlags: featureFlags, featureFlags: featureFlags,
operatingSystemUtils: globals.os,
), ),
ApplicationPackageFactory: () => FlutterApplicationPackageFactory( ApplicationPackageFactory: () => FlutterApplicationPackageFactory(
userMessages: globals.userMessages, userMessages: globals.userMessages,
......
...@@ -23,7 +23,6 @@ void main() { ...@@ -23,7 +23,6 @@ void main() {
androidWorkflow = AndroidWorkflow( androidWorkflow = AndroidWorkflow(
androidSdk: FakeAndroidSdk(), androidSdk: FakeAndroidSdk(),
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
}); });
...@@ -34,7 +33,6 @@ void main() { ...@@ -34,7 +33,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(null), androidSdk: FakeAndroidSdk(null),
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
processManager: FakeProcessManager.empty(), processManager: FakeProcessManager.empty(),
fileSystem: MemoryFileSystem.test(), fileSystem: MemoryFileSystem.test(),
...@@ -55,7 +53,6 @@ void main() { ...@@ -55,7 +53,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(), androidSdk: FakeAndroidSdk(),
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
processManager: fakeProcessManager, processManager: fakeProcessManager,
fileSystem: MemoryFileSystem.test(), fileSystem: MemoryFileSystem.test(),
...@@ -74,7 +71,6 @@ void main() { ...@@ -74,7 +71,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(null), androidSdk: FakeAndroidSdk(null),
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
processManager: FakeProcessManager.empty(), processManager: FakeProcessManager.empty(),
fileSystem: MemoryFileSystem.test(), fileSystem: MemoryFileSystem.test(),
...@@ -116,7 +112,6 @@ void main() { ...@@ -116,7 +112,6 @@ void main() {
featureFlags: TestFeatureFlags( featureFlags: TestFeatureFlags(
isAndroidEnabled: false, isAndroidEnabled: false,
), ),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
processManager: FakeProcessManager.any(), processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(), fileSystem: MemoryFileSystem.test(),
......
...@@ -39,7 +39,6 @@ void main() { ...@@ -39,7 +39,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
androidSdk: null, androidSdk: null,
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
expect(androidWorkflow.canLaunchDevices, false); expect(androidWorkflow.canLaunchDevices, false);
...@@ -53,7 +52,6 @@ void main() { ...@@ -53,7 +52,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
androidSdk: androidSdk, androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
expect(androidWorkflow.canLaunchDevices, false); expect(androidWorkflow.canLaunchDevices, false);
...@@ -61,20 +59,19 @@ void main() { ...@@ -61,20 +59,19 @@ void main() {
expect(androidWorkflow.canListEmulators, false); expect(androidWorkflow.canListEmulators, false);
}); });
// Android Studio is not currently supported on Linux Arm64 hosts. // Android SDK is actually supported on Linux Arm64 hosts.
testWithoutContext('Not supported AndroidStudio on Linux Arm Hosts', () { testWithoutContext('Support for Android SDK on Linux Arm Hosts', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk(); final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = null; androidSdk.adbPath = null;
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
androidSdk: androidSdk, androidSdk: androidSdk,
operatingSystemUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
); );
expect(androidWorkflow.appliesToHostPlatform, false); expect(androidWorkflow.appliesToHostPlatform, isTrue);
expect(androidWorkflow.canLaunchDevices, false); expect(androidWorkflow.canLaunchDevices, isFalse);
expect(androidWorkflow.canListDevices, false); expect(androidWorkflow.canListDevices, isFalse);
expect(androidWorkflow.canListEmulators, false); expect(androidWorkflow.canListEmulators, isFalse);
}); });
testWithoutContext('AndroidWorkflow is disabled if feature is disabled', () { testWithoutContext('AndroidWorkflow is disabled if feature is disabled', () {
...@@ -83,7 +80,6 @@ void main() { ...@@ -83,7 +80,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(isAndroidEnabled: false), featureFlags: TestFeatureFlags(isAndroidEnabled: false),
androidSdk: androidSdk, androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
expect(androidWorkflow.appliesToHostPlatform, false); expect(androidWorkflow.appliesToHostPlatform, false);
...@@ -98,7 +94,6 @@ void main() { ...@@ -98,7 +94,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
androidSdk: androidSdk, androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
expect(androidWorkflow.appliesToHostPlatform, true); expect(androidWorkflow.appliesToHostPlatform, true);
...@@ -114,7 +109,6 @@ void main() { ...@@ -114,7 +109,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow( final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
androidSdk: androidSdk, androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
); );
expect(androidWorkflow.appliesToHostPlatform, true); expect(androidWorkflow.appliesToHostPlatform, true);
......
...@@ -79,7 +79,6 @@ void main() { ...@@ -79,7 +79,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
...@@ -101,7 +100,6 @@ void main() { ...@@ -101,7 +100,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
...@@ -116,7 +114,6 @@ void main() { ...@@ -116,7 +114,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
fileSystem: fileSystem, fileSystem: fileSystem,
); );
...@@ -144,7 +141,6 @@ void main() { ...@@ -144,7 +141,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
final CreateEmulatorResult result = await emulatorManager.createEmulator(); final CreateEmulatorResult result = await emulatorManager.createEmulator();
...@@ -186,7 +182,6 @@ void main() { ...@@ -186,7 +182,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
final CreateEmulatorResult result = await emulatorManager.createEmulator(); final CreateEmulatorResult result = await emulatorManager.createEmulator();
...@@ -223,7 +218,6 @@ void main() { ...@@ -223,7 +218,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'test'); final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'test');
...@@ -262,7 +256,6 @@ void main() { ...@@ -262,7 +256,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'existing-avd-1'); final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'existing-avd-1');
...@@ -304,7 +297,6 @@ void main() { ...@@ -304,7 +297,6 @@ void main() {
androidWorkflow: AndroidWorkflow( androidWorkflow: AndroidWorkflow(
androidSdk: sdk, androidSdk: sdk,
featureFlags: TestFeatureFlags(), featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
), ),
); );
final CreateEmulatorResult result = await emulatorManager.createEmulator(); final CreateEmulatorResult result = await emulatorManager.createEmulator();
......
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