From 535d69817e83737f3da6250fc6fb70da25fc1a4c Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 24 十一月 2022 12:11:36 +0800
Subject: [PATCH] 完善了功能
---
AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java b/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java
index 8e22f63..4a888a2 100644
--- a/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java
+++ b/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java
@@ -292,4 +292,38 @@
};
}
+ /**
+ * 鏍煎紡鍖朣D鍗�
+ * @param deviceId
+ * @param iRecoverSDCardCallBack
+ */
+ public void recoverSDCard(final String deviceId, final IGetDeviceInfoCallBack.IRecoverSDCardCallBack iRecoverSDCardCallBack){
+ final LCBusinessHandler handler = new LCBusinessHandler() {
+ @Override
+ public void handleBusiness(Message msg) {
+ if (iRecoverSDCardCallBack == null) {
+ return;
+ }
+ if (msg.what == HandleMessageCode.HMC_SUCCESS) {
+ //鎴愬姛
+ iRecoverSDCardCallBack.onSuccess("Success");
+ } else {
+ //澶辫触
+ iRecoverSDCardCallBack.onError(BusinessErrorTip.throwError(msg));
+ }
+ }
+ };
+ new BusinessRunnable(handler) {
+ @Override
+ public void doBusiness() throws BusinessException {
+ try {
+ boolean b = DeviceInfoOpenApiManager.recoverSDCard(deviceId);
+ handler.obtainMessage(HandleMessageCode.HMC_SUCCESS, b).sendToTarget();
+ } catch (BusinessException e) {
+ throw e;
+ }
+ }
+ };
+ }
+
}
--
Gitblit v1.8.0