5
5
6
6
#include " public/flutter_tizen.h"
7
7
8
- #include < inttypes.h>
9
- #include < unistd.h>
10
-
11
8
#include " flutter/shell/platform/common/cpp/client_wrapper/include/flutter/plugin_registrar.h"
12
9
#include " flutter/shell/platform/common/cpp/client_wrapper/include/flutter/standard_message_codec.h"
13
10
#include " flutter/shell/platform/common/cpp/incoming_message_dispatcher.h"
@@ -21,62 +18,10 @@ struct FlutterWindowControllerState {
21
18
std::unique_ptr<TizenEmbedderEngine> engine;
22
19
};
23
20
24
- // The pipe used for logging to dlog.
25
- static int logging_pipe[2 ];
26
- // The thread that constantly writes out stdout to dlog through the pipe.
27
- // Only one logging thread should exist per process.
28
- static pthread_t logging_thread;
29
-
30
- static void * LoggingFunction (void *) {
31
- ssize_t size;
32
- char buffer[1024 ];
33
-
34
- while ((size = read (logging_pipe[0 ], buffer, sizeof (buffer) - 1 )) > 0 ) {
35
- buffer[size] = 0 ;
36
- __dlog_print (LOG_ID_MAIN, DLOG_INFO, LOG_TAG, " %s" , buffer);
37
- }
38
-
39
- close (logging_pipe[0 ]);
40
- close (logging_pipe[1 ]);
41
-
42
- return nullptr ;
43
- }
44
-
45
- // Redirects the process's standard output/error to dlog for use by the flutter
46
- // tools.
47
- bool InitializeLogging () {
48
- if (logging_thread) {
49
- FT_LOGD (" The logging thread already exists." );
50
- return true ;
51
- }
52
-
53
- if (pipe (logging_pipe) < 0 ) {
54
- FT_LOGE (" Failed to create a pipe." );
55
- return false ;
56
- }
57
-
58
- if (dup2 (logging_pipe[1 ], 1 ) < 0 || dup2 (logging_pipe[1 ], 2 ) < 0 ) {
59
- FT_LOGE (" Failed to duplicate file descriptors." );
60
- return false ;
61
- }
62
-
63
- if (pthread_create (&logging_thread, 0 , LoggingFunction, 0 ) != 0 ) {
64
- FT_LOGE (" Failed to create a logging thread." );
65
- logging_thread = 0 ;
66
- return false ;
67
- }
68
-
69
- if (pthread_detach (logging_thread) != 0 ) {
70
- FT_LOGE (" Failed to detach the logging thread." );
71
- return false ;
72
- }
73
- return true ;
74
- }
75
-
76
21
FlutterWindowControllerRef FlutterCreateWindow (
77
22
const FlutterWindowProperties& window_properties,
78
23
const FlutterEngineProperties& engine_properties) {
79
- InitializeLogging ();
24
+ StartLogging ();
80
25
81
26
auto state = std::make_unique<FlutterWindowControllerState>();
82
27
state->engine = std::make_unique<TizenEmbedderEngine>(window_properties);
@@ -221,6 +166,7 @@ void FlutterNotifyLowMemoryWarning(FlutterWindowControllerRef controller) {
221
166
222
167
void FlutterRotateWindow (FlutterWindowControllerRef controller,
223
168
int32_t degree) {
169
+ FT_LOGW (" Deprecated API. Use SystemChrome.setPreferredOrientations instead." );
224
170
}
225
171
226
172
int64_t FlutterRegisterExternalTexture (
0 commit comments