You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.2 KiB
Kotlin
53 lines
2.2 KiB
Kotlin
package com.ejada.hmg
|
|
|
|
import android.view.WindowManager
|
|
import com.ejada.hmg.utils.*
|
|
import com.ejada.hmg.*
|
|
import io.flutter.embedding.android.FlutterFragmentActivity
|
|
import io.flutter.embedding.engine.FlutterEngine
|
|
import io.flutter.plugins.GeneratedPluginRegistrant
|
|
import com.lepu.blepro.observer.BleChangeObserver
|
|
|
|
@Suppress("DEPRECATION")
|
|
class MainActivity : FlutterFragmentActivity() {
|
|
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
|
GeneratedPluginRegistrant.registerWith(flutterEngine);
|
|
|
|
|
|
// Create Flutter Platform Bridge
|
|
this.window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON)
|
|
PlatformBridge(flutterEngine, this).create()
|
|
OpenTokPlatformBridge(flutterEngine, this).create()
|
|
BleBridge(flutterEngine, this).create()
|
|
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
// val mChannel = NotificationChannel("video_call_noti", "video call", NotificationManager.IMPORTANCE_HIGH)
|
|
// val soundUri = Uri.parse("android.resource://" + getApplicationContext()
|
|
// .getPackageName() + "/" + R.raw.alert)
|
|
// System.out.println("soundUri");
|
|
// System.out.println("soundUri: $soundUri");
|
|
// System.out.println("soundUri : ${soundUri.path}");
|
|
// val att = AudioAttributes.Builder()
|
|
// .setUsage(AudioAttributes.USAGE_NOTIFICATION)
|
|
// .setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
|
// .build();
|
|
// mChannel.setSound(soundUri , att)
|
|
// mChannel.description = "Video Call Notifications"
|
|
// val notificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
|
// notificationManager.createNotificationChannel(mChannel)
|
|
// }
|
|
|
|
// val time = timeToMillis("04:00:00", "HH:mm:ss")
|
|
|
|
}
|
|
|
|
|
|
// override fun onBleStateChanged(model: Int, state: Int) {
|
|
// println("onBleStateChanged")
|
|
// println("model $model, state: $state")
|
|
//
|
|
// }
|
|
|
|
override fun onResume() {
|
|
super.onResume()
|
|
}
|
|
} |