Skip to content

Commit aa1c87d

Browse files
committed
Minor clean up
Signed-off-by: swan.seo <[email protected]>
1 parent 0f5a10e commit aa1c87d

9 files changed

+41
-27
lines changed

flutter/shell/platform/tizen/BUILD.gn

+6-6
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,9 @@ template("embedder") {
188188
minor_version = 0
189189
}
190190

191-
if (major_version >= 6 || (major_version >= 5 && minor_version >= 5)) {
192-
sources += [
193-
"tizen_autofill.cc",
194-
]
191+
if (((major_version >= 5 && minor_version >= 5) || major_version >= 6) &&
192+
target_name != "flutter_tizen_wearable") {
193+
sources += [ "tizen_autofill.cc" ]
195194

196195
libs += [
197196
"capi-ui-autofill",
@@ -201,11 +200,12 @@ template("embedder") {
201200
defines += [ "AUTOFILL_SUPPORT" ]
202201
}
203202

204-
if ((major_version >= 7 || (major_version >= 6 && minor_version >= 5)) && target_name != "flutter_tizen_wearable") {
203+
if (((major_version >= 6 && minor_version >= 5) || major_version >= 7) &&
204+
target_name != "flutter_tizen_wearable") {
205205
sources += [
206206
"flutter_tizen_nui.cc",
207-
"tizen_view_nui.cc",
208207
"nui_autofill_popup.cc",
208+
"tizen_view_nui.cc",
209209
]
210210

211211
libs += [

flutter/shell/platform/tizen/channels/text_input_channel.cc

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ constexpr char kMultilineInputType[] = "TextInputType.multiline";
2727
constexpr char kUpdateEditingStateMethod[] =
2828
"TextInputClient.updateEditingState";
2929
constexpr char kPerformActionMethod[] = "TextInputClient.performAction";
30+
constexpr char kRequestAutofillMethod[] = "TextInput.requestAutofill";
3031
constexpr char kSetPlatformViewClient[] = "TextInput.setPlatformViewClient";
3132
constexpr char kTextCapitalization[] = "textCapitalization";
3233
constexpr char kTextEnableSuggestions[] = "enableSuggestions";
@@ -45,8 +46,6 @@ constexpr char kSelectionIsDirectionalKey[] = "selectionIsDirectional";
4546
constexpr char kTextKey[] = "text";
4647
constexpr char kBadArgumentError[] = "Bad Arguments";
4748
constexpr char kInternalConsistencyError[] = "Internal Consistency Error";
48-
49-
constexpr char kRequestAutofillMethod[] = "TextInput.requestAutofill";
5049
constexpr char kAutofill[] = "autofill";
5150
constexpr char kUniqueIdentifier[] = "uniqueIdentifier";
5251
constexpr char kHints[] = "hints";
@@ -70,10 +69,12 @@ TextInputChannel::TextInputChannel(
7069
std::unique_ptr<MethodResult<rapidjson::Document>> result) {
7170
HandleMethodCall(call, std::move(result));
7271
});
72+
#ifdef AUTOFILL_SUPPORT
7373
TizenAutofill& instance = TizenAutofill::GetInstance();
7474
instance.SetPopupCallback(
7575
[this]() { input_method_context_->PopupAutofillItems(); });
7676
instance.SetCommitCallback([this](std::string value) { OnCommit(value); });
77+
#endif
7778
}
7879

7980
TextInputChannel::~TextInputChannel() {}
@@ -318,10 +319,12 @@ void TextInputChannel::HandleMethodCall(
318319
cursor_offset);
319320
}
320321
SendStateUpdate();
321-
#ifdef AUTOFILL_SUPPORT
322322
} else if (method.compare(kRequestAutofillMethod) == 0) {
323+
#ifdef AUTOFILL_SUPPORT
323324
TizenAutofill& instance = TizenAutofill::GetInstance();
324325
instance.RequestAutofill(autofill_hints_, autofill_id_);
326+
#else
327+
result->NotImplemented();
325328
#endif
326329
} else {
327330
result->NotImplemented();

flutter/shell/platform/tizen/nui_autofill_popup.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Copyright 2023 Samsung Electronics Co., Ltd. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
15
#include "flutter/shell/platform/tizen/nui_autofill_popup.h"
26

37
#include <dali-toolkit/dali-toolkit.h>
@@ -6,8 +10,6 @@
610

711
#include "flutter/shell/platform/tizen/tizen_autofill.h"
812

9-
#include "flutter/shell/platform/tizen/logger.h"
10-
1113
namespace flutter {
1214
bool NuiAutofillPopup::OnTouch(Dali::Actor actor,
1315
const Dali::TouchEvent& event) {

flutter/shell/platform/tizen/tizen_autofill.cc

+7-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <autofill_common.h>
99

1010
#include <functional>
11-
#include <memory>
1211

1312
#include "flutter/shell/platform/tizen/logger.h"
1413

@@ -17,15 +16,14 @@ TizenAutofill::TizenAutofill() {
1716
}
1817

1918
TizenAutofill::~TizenAutofill() {
20-
autofill_destroy(ah_);
19+
autofill_destroy(autofill_);
2120
}
2221

2322
void TizenAutofill::InitailizeAutofill() {
24-
autofill_create(&ah_);
23+
autofill_create(&autofill_);
2524

26-
int ret;
27-
ret = autofill_connect(
28-
ah_,
25+
int ret = autofill_connect(
26+
autofill_,
2927
[](autofill_h ah, autofill_connection_status_e status, void* user_data) {
3028
},
3129
NULL);
@@ -34,7 +32,7 @@ void TizenAutofill::InitailizeAutofill() {
3432
}
3533

3634
autofill_fill_response_set_received_cb(
37-
ah_,
35+
autofill_,
3836
[](autofill_h ah, autofill_fill_response_h fill_response, void* data) {
3937
int count = 0;
4038
autofill_fill_response_get_group_count(fill_response, &count);
@@ -110,7 +108,7 @@ void TizenAutofill::RequestAutofill(std::vector<std::string> hints,
110108
}
111109
}
112110

113-
int ret = autofill_fill_request(ah_, view_info);
111+
int ret = autofill_fill_request(autofill_, view_info);
114112
if (ret != AUTOFILL_ERROR_NONE) {
115113
FT_LOG(Error) << "autofill_fill_request error";
116114
}
@@ -145,9 +143,7 @@ void TizenAutofill::RegisterAutofillItem(std::string view_id,
145143
free(app_id);
146144
}
147145

148-
int ret;
149-
150-
ret = autofill_commit(ah_, svi_h);
146+
int ret = autofill_commit(autofill_, svi_h);
151147
if (ret != AUTOFILL_ERROR_NONE) {
152148
FT_LOG(Error) << "autofill_commit error";
153149
}

flutter/shell/platform/tizen/tizen_autofill.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TizenAutofill {
6666
// TODO : implement convert flutter hint to tizen hint function
6767
std::optional<autofill_hint_e> ConvertAutofillHint(std::string hint);
6868

69-
autofill_h ah_;
69+
autofill_h autofill_;
7070

7171
std::vector<std::unique_ptr<AutofillItem>> response_items_;
7272

flutter/shell/platform/tizen/tizen_view_elementary.cc

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#include <string>
99

1010
#include "flutter/shell/platform/tizen/logger.h"
11+
#ifdef AUTOFILL_SUPPORT
1112
#include "flutter/shell/platform/tizen/tizen_autofill.h"
13+
#endif
1214
#include "flutter/shell/platform/tizen/tizen_view_event_handler_delegate.h"
1315

1416
namespace flutter {

flutter/shell/platform/tizen/tizen_view_nui.cc

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "flutter/shell/platform/tizen/tizen_view_nui.h"
66

77
#include <dali/devel-api/common/stage.h>
8+
89
#include <string>
910

1011
#include "flutter/shell/platform/tizen/logger.h"

flutter/shell/platform/tizen/tizen_window_elementary.cc

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#include <memory>
1212

1313
#include "flutter/shell/platform/tizen/logger.h"
14+
#ifdef AUTOFILL_SUPPORT
15+
#include "flutter/shell/platform/tizen/tizen_autofill.h"
16+
#endif
1417
#include "flutter/shell/platform/tizen/tizen_view_event_handler_delegate.h"
1518

1619
namespace flutter {

tools/generate_sysroot.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
'capi-system-system-settings-devel',
4444
'capi-ui-efl-util',
4545
'capi-ui-efl-util-devel',
46-
'capi-ui-autofill',
47-
'capi-ui-autofill-devel',
48-
'capi-ui-autofill-common',
49-
'capi-ui-autofill-common-devel',
5046
'cbhm',
5147
'cbhm-devel',
5248
'coregl',
@@ -117,6 +113,14 @@
117113
'wayland-devel',
118114
]
119115

116+
# Only available for Tizen 5.5 and above.
117+
autofill_packages = [
118+
'capi-ui-autofill',
119+
'capi-ui-autofill-devel',
120+
'capi-ui-autofill-common',
121+
'capi-ui-autofill-common-devel',
122+
]
123+
120124
# Only available for Tizen 6.5 and above.
121125
dali_packages = [
122126
'dali2',
@@ -159,6 +163,9 @@ def generate_sysroot(sysroot: Path, api_version: float, arch: str, quiet=False):
159163
existing_rpms = [f for f in download_path.iterdir() if f.suffix == '.rpm']
160164

161165
packages = base_packages + unified_packages
166+
if api_version >= 5.5:
167+
packages += autofill_packages
168+
162169
if api_version >= 6.5:
163170
packages += dali_packages
164171

0 commit comments

Comments
 (0)