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