Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6d7eb52

Browse files
authored
Revert "Android embedding refactor pr3 add remaining systemchannels (#7874)" (#7886)
This reverts commit f4fba6d.
1 parent dad6ec0 commit 6d7eb52

File tree

11 files changed

+562
-1571
lines changed

11 files changed

+562
-1571
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,13 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/D
446446
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/PlatformMessageHandler.java
447447
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java
448448
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/renderer/OnFirstFrameRenderedListener.java
449-
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java
450449
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/KeyEventChannel.java
451450
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/LifecycleChannel.java
452451
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/LocalizationChannel.java
453452
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/NavigationChannel.java
454453
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/PlatformChannel.java
455454
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/SettingsChannel.java
456455
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/SystemChannel.java
457-
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java
458456
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/ActivityLifecycleListener.java
459457
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java
460458
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BinaryCodec.java

shell/platform/android/BUILD.gn

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,13 @@ java_library("flutter_shell_java") {
114114
"io/flutter/embedding/engine/dart/PlatformMessageHandler.java",
115115
"io/flutter/embedding/engine/renderer/FlutterRenderer.java",
116116
"io/flutter/embedding/engine/renderer/OnFirstFrameRenderedListener.java",
117-
"io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java",
118117
"io/flutter/embedding/engine/systemchannels/KeyEventChannel.java",
119118
"io/flutter/embedding/engine/systemchannels/LifecycleChannel.java",
120119
"io/flutter/embedding/engine/systemchannels/LocalizationChannel.java",
121120
"io/flutter/embedding/engine/systemchannels/NavigationChannel.java",
122121
"io/flutter/embedding/engine/systemchannels/PlatformChannel.java",
123122
"io/flutter/embedding/engine/systemchannels/SettingsChannel.java",
124123
"io/flutter/embedding/engine/systemchannels/SystemChannel.java",
125-
"io/flutter/embedding/engine/systemchannels/TextInputChannel.java",
126124
"io/flutter/plugin/common/ActivityLifecycleListener.java",
127125
"io/flutter/plugin/common/BasicMessageChannel.java",
128126
"io/flutter/plugin/common/BinaryCodec.java",

shell/platform/android/io/flutter/embedding/engine/systemchannels/AccessibilityChannel.java

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

shell/platform/android/io/flutter/embedding/engine/systemchannels/LocalizationChannel.java

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66

77
import android.support.annotation.NonNull;
88

9-
import java.util.ArrayList;
109
import java.util.Arrays;
11-
import java.util.List;
12-
import java.util.Locale;
1310

1411
import io.flutter.embedding.engine.dart.DartExecutor;
1512
import io.flutter.plugin.common.JSONMethodCodec;
1613
import io.flutter.plugin.common.MethodChannel;
1714

1815
/**
19-
* Sends the platform's locales to Dart.
16+
* TODO(mattcarroll): fill in javadoc for LocalizationChannel.
2017
*/
2118
public class LocalizationChannel {
2219

@@ -27,18 +24,12 @@ public LocalizationChannel(@NonNull DartExecutor dartExecutor) {
2724
this.channel = new MethodChannel(dartExecutor, "flutter/localization", JSONMethodCodec.INSTANCE);
2825
}
2926

30-
/**
31-
* Send the given {@code locales} to Dart.
32-
*/
33-
public void sendLocales(List<Locale> locales) {
34-
List<String> data = new ArrayList<>();
35-
for (Locale locale : locales) {
36-
data.add(locale.getLanguage());
37-
data.add(locale.getCountry());
38-
data.add(locale.getScript());
39-
data.add(locale.getVariant());
40-
}
41-
channel.invokeMethod("setLocale", data);
27+
public void setLocale(String language, String country) {
28+
channel.invokeMethod("setLocale", Arrays.asList(language, country));
29+
}
30+
31+
public void setMethodCallHandler(MethodChannel.MethodCallHandler handler) {
32+
channel.setMethodCallHandler(handler);
4233
}
4334

4435
}

0 commit comments

Comments
 (0)