1 // Copyright 2013 The Flutter Authors. 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 5 #ifndef SHELL_PLATFORM_ANDROID_FLUTTER_MAIN_H_ 6 #define SHELL_PLATFORM_ANDROID_FLUTTER_MAIN_H_ 7 8 #include <jni.h> 9 10 #include "flutter/common/settings.h" 11 #include "flutter/fml/macros.h" 12 #include "flutter/runtime/dart_service_isolate.h" 13 14 namespace flutter { 15 16 class FlutterMain { 17 public: 18 ~FlutterMain(); 19 20 static bool Register(JNIEnv* env); 21 22 static FlutterMain& Get(); 23 24 const flutter::Settings& GetSettings() const; 25 26 private: 27 const flutter::Settings settings_; 28 DartServiceIsolate::CallbackHandle observatory_uri_callback_; 29 30 FlutterMain(flutter::Settings settings); 31 32 static void Init(JNIEnv* env, 33 jclass clazz, 34 jobject context, 35 jobjectArray jargs, 36 jstring kernelPath, 37 jstring appStoragePath, 38 jstring engineCachesPath); 39 40 void SetupObservatoryUriCallback(JNIEnv* env); 41 42 FML_DISALLOW_COPY_AND_ASSIGN(FlutterMain); 43 }; 44 45 } // namespace flutter 46 47 #endif // SHELL_PLATFORM_ANDROID_FLUTTER_MAIN_H_ 48