|
@@ -542,7 +542,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
|
|
|
deleteRecordAllFile();
|
|
|
|
|
@@ -1098,6 +1098,10 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
isCloseMicrophoneMessage = false;
|
|
|
|
|
|
+ if(zlwRecordManager == null){
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
+ }
|
|
|
+
|
|
|
// 开始录音,主动推送的
|
|
|
zlwRecordManager.startRecordSize(intervalTime, new IMicroPhoneSizeCallback() {
|
|
|
@Override
|
|
@@ -1340,7 +1344,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
// 成功
|
|
|
appletId = ampeConfigResultBean.getMiniProgramAppid();
|
|
|
AppLogUtils.e("initAndActive--appId&appletId:" + appletId);
|
|
|
-
|
|
|
+ // 启动小程序
|
|
|
launchApplet(appletId);
|
|
|
} else if (errorCode == 2002) {
|
|
|
// 可能是设备ampe未授权
|
|
@@ -2313,7 +2317,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
ampeActionMap.put(ACTION_START_MICROPHONE, startMicroBean);
|
|
|
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
|
|
|
// 语音生成mp3
|
|
@@ -2331,7 +2335,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
//
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
|
|
|
zlwRecordManager.stopResultListener(new IMicroPhoneResultCallback() {
|
|
@@ -2359,7 +2363,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
isCloseMicrophoneMessage = false;
|
|
|
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
|
|
|
AppLogUtils.e("ACTION_START_MICROPHONE_LISTENER---1");
|
|
@@ -2398,7 +2402,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
isCloseMicrophoneMessage = true;
|
|
|
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
|
|
|
stopMicrophoneListener();
|
|
@@ -2420,7 +2424,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
ampeActionMap.put(ACTION_MICROPHONE_STATE, microStateBean);
|
|
|
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
|
|
|
zlwRecordManager.getState(new IMicroPhoneStateCallback() {
|
|
@@ -2643,7 +2647,7 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
private void startMicroPhone(String event, String taskId, AromeServiceInvoker.BridgeCallback bridgeCallback) {
|
|
|
|
|
|
if (zlwRecordManager == null) {
|
|
|
- zlwRecordManager = new ZlwRecordManager();
|
|
|
+ zlwRecordManager = ZlwRecordManager.getInstance(mContext);
|
|
|
}
|
|
|
zlwRecordManager.start();
|
|
|
|
|
@@ -3534,7 +3538,13 @@ public class MainActivity extends BaseHHActivity implements DeviceConfigContract
|
|
|
|
|
|
|
|
|
// 打印初始化
|
|
|
- iPrinter.initPrint(new PrintInitResultCallback() {
|
|
|
+ if(iPrinter == null){
|
|
|
+ iPrinter = BasePrinter.getInstance().getPrinter(mContext);
|
|
|
+ }
|
|
|
+
|
|
|
+ iPrinter
|
|
|
+ .initPrint(
|
|
|
+ new PrintInitResultCallback() {
|
|
|
@Override
|
|
|
public void onPrintInitSuccess() {
|
|
|
// 日志打印和保存(本地和网络)
|