Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions shell/platform/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ template("embedder") {
"channels/platform_view_channel.cc",
"channels/settings_channel.cc",
"channels/text_input_channel.cc",
"channels/tizen_shell.cc",
"channels/window_channel.cc",
"external_texture_pixel_gl.cc",
"external_texture_surface_gl.cc",
Expand Down Expand Up @@ -159,13 +158,20 @@ template("embedder") {
"feedback",
"tbm",
"tdm-client",
"tzsh_common",
"tzsh_softkey",
"wayland-client",
"EGL",
"GLESv2",
]

if (target_name == "flutter_tizen_common") {
sources += [ "channels/tizen_shell.cc" ]

libs += [
"tzsh_common",
"tzsh_softkey",
]
}

defines += invoker.defines
defines += [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]

Expand Down
15 changes: 11 additions & 4 deletions shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

#include "flutter/shell/platform/common/json_method_codec.h"
#include "flutter/shell/platform/tizen/channels/feedback_manager.h"
#ifdef COMMON_PROFILE
#include "flutter/shell/platform/tizen/channels/tizen_shell.h"
#endif
#include "flutter/shell/platform/tizen/logger.h"

namespace flutter {
Expand All @@ -25,12 +27,10 @@ constexpr char kClipboardHasStringsMethod[] = "Clipboard.hasStrings";
constexpr char kPlaySoundMethod[] = "SystemSound.play";
constexpr char kHapticFeedbackVibrateMethod[] = "HapticFeedback.vibrate";
constexpr char kSystemNavigatorPopMethod[] = "SystemNavigator.pop";
#ifdef COMMON_PROFILE
constexpr char kRestoreSystemUiOverlaysMethod[] =
"SystemChrome.restoreSystemUIOverlays";
constexpr char kSetEnabledSystemUiOverlaysMethod[] =
"SystemChrome.setEnabledSystemUIOverlays";
#endif
constexpr char kSetPreferredOrientationsMethod[] =
"SystemChrome.setPreferredOrientations";

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

constexpr char kSoundTypeClick[] = "SystemSoundType.click";
#ifdef COMMON_PROFILE
constexpr char kSystemUiOverlayBottom[] = "SystemUiOverlay.bottom";
#endif
constexpr char kPortraitUp[] = "DeviceOrientation.portraitUp";
constexpr char kPortraitDown[] = "DeviceOrientation.portraitDown";
constexpr char kLandscapeLeft[] = "DeviceOrientation.landscapeLeft";
Expand Down Expand Up @@ -120,7 +122,6 @@ void PlatformChannel::HandleMethodCall(
document.AddMember(rapidjson::Value(kValueKey, allocator),
rapidjson::Value(!text_clipboard.empty()), allocator);
result->Success(document);
#ifdef COMMON_PROFILE
} else if (method == kRestoreSystemUiOverlaysMethod) {
RestoreSystemUiOverlays();
result->Success();
Expand All @@ -132,7 +133,6 @@ void PlatformChannel::HandleMethodCall(
}
SetEnabledSystemUiOverlays(overlays);
result->Success();
#endif
} else if (method == kSetPreferredOrientationsMethod) {
const rapidjson::Document& list = arguments[0];
std::vector<std::string> orientations;
Expand Down Expand Up @@ -167,6 +167,8 @@ void PlatformChannel::RestoreSystemUiOverlays() {
if (!renderer_) {
return;
}

#ifdef COMMON_PROFILE
auto& shell = TizenShell::GetInstance();
shell.InitializeSoftkey(renderer_->GetWindowId());

Expand All @@ -175,13 +177,16 @@ void PlatformChannel::RestoreSystemUiOverlays() {
} else {
shell.HideSoftkey();
}
#endif
}

void PlatformChannel::SetEnabledSystemUiOverlays(
const std::vector<std::string>& overlays) {
if (!renderer_) {
return;
}

#ifdef COMMON_PROFILE
auto& shell = TizenShell::GetInstance();
shell.InitializeSoftkey(renderer_->GetWindowId());

Expand All @@ -191,13 +196,15 @@ void PlatformChannel::SetEnabledSystemUiOverlays(
} else {
shell.HideSoftkey();
}
#endif
}

void PlatformChannel::SetPreferredOrientations(
const std::vector<std::string>& orientations) {
if (!renderer_) {
return;
}

static const std::map<std::string, int> orientation_mapping = {
{kPortraitUp, 0},
{kLandscapeLeft, 90},
Expand Down