Skip to content

Commit fa89823

Browse files
authored
Fix runtime error on Tizen 4.0 (#279)
1 parent fc30c34 commit fa89823

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

shell/platform/tizen/BUILD.gn

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ template("embedder") {
116116
"channels/platform_view_channel.cc",
117117
"channels/settings_channel.cc",
118118
"channels/text_input_channel.cc",
119-
"channels/tizen_shell.cc",
120119
"channels/window_channel.cc",
121120
"external_texture_pixel_gl.cc",
122121
"external_texture_surface_gl.cc",
@@ -159,13 +158,20 @@ template("embedder") {
159158
"feedback",
160159
"tbm",
161160
"tdm-client",
162-
"tzsh_common",
163-
"tzsh_softkey",
164161
"wayland-client",
165162
"EGL",
166163
"GLESv2",
167164
]
168165

166+
if (target_name == "flutter_tizen_common") {
167+
sources += [ "channels/tizen_shell.cc" ]
168+
169+
libs += [
170+
"tzsh_common",
171+
"tzsh_softkey",
172+
]
173+
}
174+
169175
defines += invoker.defines
170176
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
171177

shell/platform/tizen/channels/platform_channel.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
#include "flutter/shell/platform/common/json_method_codec.h"
1212
#include "flutter/shell/platform/tizen/channels/feedback_manager.h"
13+
#ifdef COMMON_PROFILE
1314
#include "flutter/shell/platform/tizen/channels/tizen_shell.h"
15+
#endif
1416
#include "flutter/shell/platform/tizen/logger.h"
1517

1618
namespace flutter {
@@ -25,12 +27,10 @@ constexpr char kClipboardHasStringsMethod[] = "Clipboard.hasStrings";
2527
constexpr char kPlaySoundMethod[] = "SystemSound.play";
2628
constexpr char kHapticFeedbackVibrateMethod[] = "HapticFeedback.vibrate";
2729
constexpr char kSystemNavigatorPopMethod[] = "SystemNavigator.pop";
28-
#ifdef COMMON_PROFILE
2930
constexpr char kRestoreSystemUiOverlaysMethod[] =
3031
"SystemChrome.restoreSystemUIOverlays";
3132
constexpr char kSetEnabledSystemUiOverlaysMethod[] =
3233
"SystemChrome.setEnabledSystemUIOverlays";
33-
#endif
3434
constexpr char kSetPreferredOrientationsMethod[] =
3535
"SystemChrome.setPreferredOrientations";
3636

@@ -43,7 +43,9 @@ constexpr char kUnknownClipboardError[] =
4343
"Unknown error during clipboard data retrieval";
4444

4545
constexpr char kSoundTypeClick[] = "SystemSoundType.click";
46+
#ifdef COMMON_PROFILE
4647
constexpr char kSystemUiOverlayBottom[] = "SystemUiOverlay.bottom";
48+
#endif
4749
constexpr char kPortraitUp[] = "DeviceOrientation.portraitUp";
4850
constexpr char kPortraitDown[] = "DeviceOrientation.portraitDown";
4951
constexpr char kLandscapeLeft[] = "DeviceOrientation.landscapeLeft";
@@ -120,7 +122,6 @@ void PlatformChannel::HandleMethodCall(
120122
document.AddMember(rapidjson::Value(kValueKey, allocator),
121123
rapidjson::Value(!text_clipboard.empty()), allocator);
122124
result->Success(document);
123-
#ifdef COMMON_PROFILE
124125
} else if (method == kRestoreSystemUiOverlaysMethod) {
125126
RestoreSystemUiOverlays();
126127
result->Success();
@@ -132,7 +133,6 @@ void PlatformChannel::HandleMethodCall(
132133
}
133134
SetEnabledSystemUiOverlays(overlays);
134135
result->Success();
135-
#endif
136136
} else if (method == kSetPreferredOrientationsMethod) {
137137
const rapidjson::Document& list = arguments[0];
138138
std::vector<std::string> orientations;
@@ -167,6 +167,8 @@ void PlatformChannel::RestoreSystemUiOverlays() {
167167
if (!renderer_) {
168168
return;
169169
}
170+
171+
#ifdef COMMON_PROFILE
170172
auto& shell = TizenShell::GetInstance();
171173
shell.InitializeSoftkey(renderer_->GetWindowId());
172174

@@ -175,13 +177,16 @@ void PlatformChannel::RestoreSystemUiOverlays() {
175177
} else {
176178
shell.HideSoftkey();
177179
}
180+
#endif
178181
}
179182

180183
void PlatformChannel::SetEnabledSystemUiOverlays(
181184
const std::vector<std::string>& overlays) {
182185
if (!renderer_) {
183186
return;
184187
}
188+
189+
#ifdef COMMON_PROFILE
185190
auto& shell = TizenShell::GetInstance();
186191
shell.InitializeSoftkey(renderer_->GetWindowId());
187192

@@ -191,13 +196,15 @@ void PlatformChannel::SetEnabledSystemUiOverlays(
191196
} else {
192197
shell.HideSoftkey();
193198
}
199+
#endif
194200
}
195201

196202
void PlatformChannel::SetPreferredOrientations(
197203
const std::vector<std::string>& orientations) {
198204
if (!renderer_) {
199205
return;
200206
}
207+
201208
static const std::map<std::string, int> orientation_mapping = {
202209
{kPortraitUp, 0},
203210
{kLandscapeLeft, 90},

0 commit comments

Comments
 (0)