Browse Source

add

newdev_shunjiawei
fdp 1 year ago
parent
commit
d5417ed9a6
  1. 18
      lib/modules/meeting/views/meeting_view.dart
  2. 22
      local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

18
lib/modules/meeting/views/meeting_view.dart

@ -562,11 +562,12 @@ class MeetingView extends GetView<MeetingController> {
icon: Image.asset('assets/images/explore.png',
width: 32.w, height: 32.w),
title: '现场录音',
onTap: () {
onTap: () async {
Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: {
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 0,
});
controller.addMeetingAudio();
// TODO: 实现从文件导入逻辑
},
),
@ -577,12 +578,12 @@ class MeetingView extends GetView<MeetingController> {
icon: Image.asset('assets/images/explore.png',
width: 32.w, height: 32.w),
title: '音、视频录音',
onTap: () {
onTap: () async {
Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: {
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 1,
});
controller.addMeetingAudio();
// TODO: 实现从相册导入逻辑
},
),
@ -604,11 +605,14 @@ class MeetingView extends GetView<MeetingController> {
],
),
title: '通话录音',
onTap: () {
onTap: () async {
Navigator.of(context).pop();
Get.toNamed(Routes.meetingRecord, arguments: {
await Get.toNamed(Routes.meetingRecord, arguments: {
'audioTypes': 2,
});
controller.addMeetingAudio();
// TODO: 实现从其他APP导入逻辑
},
),

22
local_plugins/ota/android/src/main/kotlin/com/example/ota/OtaPlugin.kt

@ -268,6 +268,13 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
streamSink = null
}
})
}
override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "init") {
// 初始化 otaManager 和 bluetoothHelper
ConfigHelper.initialize(context)
otaManager = OTAManager(context)
@ -289,11 +296,9 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
}
Log.i("TAG", "onAttachedToEngine")
result.success("")
}
override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "startUpgrading") {
else if (call.method == "startUpgrading") {
Log.d("TAG", "startUpgrading")
// 接收传入的参数
val arguments = call.arguments as? Map<String, Any>
@ -326,13 +331,16 @@ class OtaPlugin : BleService.Callback, FlutterPlugin, MethodCallHandler {
BleService.isEnterOta = false
}
result.success("")
} else if (call.method == "onOtaClose") {
BleService.isEnterOta = false
isDisconnect = false
otaManager.bluetoothHelper.stopScan()
otaManager.bluetoothHelper.disconnectDevice(otaDevice)
otaManager?.bluetoothHelper?.stopScan()
otaManager?.bluetoothHelper?.disconnectDevice(otaDevice)
result.success("")
} else {
result.notImplemented()
}

Loading…
Cancel
Save