35 {
36 @Override
37 public void onMethodCall(@NonNull
MethodCall call, @NonNull MethodChannel.Result
result) {
38 if (platformMessageHandler == null) {
39
40
41 return;
42 }
43
44 String method =
call.method;
45 Object arguments =
call.arguments;
46 Log.v(TAG,
"Received '" + method +
"' message.");
47 try {
48 switch (method) {
49 case "SystemSound.play":
50 try {
51 SoundType soundType = SoundType.fromValue((String) arguments);
54 } catch (NoSuchFieldException exception) {
55
56 result.error(
"error", exception.getMessage(),
null);
57 }
58 break;
59 case "HapticFeedback.vibrate":
60 try {
61 HapticFeedbackType feedbackType =
62 HapticFeedbackType.fromValue((String) arguments);
65 } catch (NoSuchFieldException exception) {
66
67 result.error(
"error", exception.getMessage(),
null);
68 }
69 break;
70 case "SystemChrome.setPreferredOrientations":
71 try {
72 int androidOrientation = decodeOrientations((JSONArray) arguments);
75 } catch (JSONException | NoSuchFieldException exception) {
76
77
78
79
80 result.error(
"error", exception.getMessage(),
null);
81 }
82 break;
83 case "SystemChrome.setApplicationSwitcherDescription":
84 try {
85 AppSwitcherDescription description =
86 decodeAppSwitcherDescription((JSONObject) arguments);
89 } catch (JSONException exception) {
90
91 result.error(
"error", exception.getMessage(),
null);
92 }
93 break;
94 case "SystemChrome.setEnabledSystemUIOverlays":
95 try {
99 } catch (JSONException | NoSuchFieldException exception) {
100
101
102
103 result.error(
"error", exception.getMessage(),
null);
104 }
105 break;
106 case "SystemChrome.setEnabledSystemUIMode":
107 try {
108 SystemUiMode
mode = decodeSystemUiMode((String) arguments);
111 } catch (JSONException | NoSuchFieldException exception) {
112
113
114
115 result.error(
"error", exception.getMessage(),
null);
116 }
117 break;
118 case "SystemChrome.setSystemUIChangeListener":
121 break;
122 case "SystemChrome.restoreSystemUIOverlays":
125 break;
126 case "SystemChrome.setSystemUIOverlayStyle":
127 try {
128 SystemChromeStyle systemChromeStyle =
129 decodeSystemChromeStyle((JSONObject) arguments);
132 } catch (JSONException | NoSuchFieldException exception) {
133
134
135
136 result.error(
"error", exception.getMessage(),
null);
137 }
138 break;
139 case "SystemNavigator.setFrameworkHandlesBack":
140 {
141 boolean frameworkHandlesBack = (boolean) arguments;
144 break;
145 }
146 case "SystemNavigator.pop":
149 break;
150 case "Clipboard.getData":
151 {
152 String contentFormatName = (String) arguments;
153 ClipboardContentFormat clipboardFormat = null;
154 if (contentFormatName != null) {
155 try {
156 clipboardFormat = ClipboardContentFormat.fromValue(contentFormatName);
157 } catch (NoSuchFieldException exception) {
158
160 "error", "No such clipboard content format: " + contentFormatName, null);
161 }
162 }
163
164 CharSequence clipboardContent =
166 if (clipboardContent != null) {
167 JSONObject response = new JSONObject();
168 response.put("text", clipboardContent);
170 } else {
172 }
173 break;
174 }
175 case "Clipboard.setData":
176 {
177 String clipboardContent = ((JSONObject) arguments).getString("text");
180 break;
181 }
182 case "Clipboard.hasStrings":
183 {
185 JSONObject response = new JSONObject();
186 response.put("value", hasStrings);
188 break;
189 }
190 case "Share.invoke":
191 String
text = (String) arguments;
194 break;
195 default:
197 break;
198 }
199 } catch (JSONException e) {
200 result.error(
"error",
"JSON error: " +
e.getMessage(),
null);
201 }
202 }
203 };
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode