|
@@ -3,6 +3,7 @@ package com.hh.lib_record;
|
|
|
import static com.hh.lib_base.Constants.LogcatValue.WARP;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.util.Log;
|
|
|
|
|
|
import com.alipay.arome.aromecli.AromeServiceInvoker;
|
|
|
import com.google.gson.JsonObject;
|
|
@@ -10,14 +11,17 @@ import com.hh.lib_ampe.bean.BaseAmpeRequestBean;
|
|
|
import com.hh.lib_ampe.utils.AromeInvoker;
|
|
|
import com.hh.lib_ampe.utils.MyTypeToken;
|
|
|
import com.hh.lib_base.BaseApplication;
|
|
|
+import com.hh.lib_base.ConfigData;
|
|
|
import com.hh.lib_base.Constants;
|
|
|
import com.hh.lib_base.bean.ampe.BaseAmpeAppletResultBean;
|
|
|
+import com.hh.lib_base.bean.device.DeviceConfigResultBean;
|
|
|
import com.hh.lib_base.log.AppLogUtils;
|
|
|
import com.hh.lib_base.log.UploadLogUtils;
|
|
|
import com.hh.lib_base.utils.GsonUtils;
|
|
|
import com.hh.lib_base.utils.StringUtils;
|
|
|
import com.hh.lib_base.utils.device.DeviceUtils;
|
|
|
import com.hh.lib_record.bean.AmpeRequestRecordBean;
|
|
|
+import com.hh.lib_record.bean.MicrophoneTypeEnum;
|
|
|
import com.hh.lib_record.microphone.IMicroPhoneSizeCallback;
|
|
|
import com.hh.lib_record.microphone.ZlwRecordManager;
|
|
|
import com.hh.lib_record.recorder.RecordService;
|
|
@@ -46,7 +50,11 @@ public class RecordInvoker {
|
|
|
if (dataBean == null) {
|
|
|
return;
|
|
|
}
|
|
|
- dataBean.setBridgeCallback(bridgeCallback);
|
|
|
+ if(isUnEnabledHardware(dataBean,bridgeCallback)){
|
|
|
+ AromeInvoker.getAromeInvoker()
|
|
|
+ .hardwareNotEnabled(dataBean, bridgeCallback);
|
|
|
+ return;
|
|
|
+ }
|
|
|
switch (dataBean.getAction()) {
|
|
|
case Constants.Ampe.ACTION_START_MICROPHONE_LISTENER:
|
|
|
BaseAmpeRequestBean<AmpeRequestRecordBean> newBean= MyTypeToken.
|
|
@@ -66,6 +74,35 @@ public class RecordInvoker {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @author xwh
|
|
|
+ * Time 2024/12/13
|
|
|
+ * Description: 是否未开启该模块
|
|
|
+ * @return true:是该模块的消息并且未启用该模块
|
|
|
+ **/
|
|
|
+ private boolean isUnEnabledHardware(BaseAmpeRequestBean dataBean, AromeServiceInvoker.BridgeCallback bridgeCallback) {
|
|
|
+ DeviceConfigResultBean configResultBean = ConfigData.getDeviceConfigResultBean();
|
|
|
+ boolean isOpenMicrophone = true;
|
|
|
+ if (configResultBean != null) {
|
|
|
+ isOpenMicrophone = configResultBean.isOpenMicrophone();
|
|
|
+ }
|
|
|
+ int microphoneType = configResultBean.getMicrophoneType();
|
|
|
+
|
|
|
+ String action = dataBean.getAction();
|
|
|
+ if(action != null && (Constants.Ampe.ACTION_START_MICROPHONE_LISTENER.equals(action) ||
|
|
|
+ Constants.Ampe.ACTION_STOP_MICROPHONE_LISTENER.equals(action) )){
|
|
|
+ if(!isOpenMicrophone){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if(microphoneType != MicrophoneTypeEnum
|
|
|
+ .NATIVE_AUDI0.getValue()){ //MicrophoneTypeEnum.NATIVE_AUDI0.getValue() A原生语音) //不是A原生语音也拦截
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
// 麦克风
|
|
|
public void initRecord(){
|
|
|
String deviceModel = DeviceUtils.getDeviceModel();
|