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/res/values-en/strings.xml | 1
AndroidOpenDemo/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java | 16 ++++
AndroidOpenDemo/app/src/main/java/com/utils/HdlToLcUtils.java | 6
AndroidOpenDemo/app/src/main/res/values/strings.xml | 1
AndroidOpenDemo/.idea/workspace.xml | 100 ++++++++++++------------
AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java | 2
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java | 2
AndroidOpenDemo/.idea/caches/build_file_checksums.ser | 0
AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java | 22 +++++
AndroidOpenDemo/app/src/main/java/com/common/openapi/MethodConst.java | 2
AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceDetailService.java | 34 ++++++++
AndroidOpenDemo/app/src/main/res/layout/fragment_device_detail_main.xml | 17 ++++
AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java | 12 ++-
13 files changed, 156 insertions(+), 59 deletions(-)
diff --git a/AndroidOpenDemo/.idea/caches/build_file_checksums.ser b/AndroidOpenDemo/.idea/caches/build_file_checksums.ser
index 10e6da6..6399dbe 100644
--- a/AndroidOpenDemo/.idea/caches/build_file_checksums.ser
+++ b/AndroidOpenDemo/.idea/caches/build_file_checksums.ser
Binary files differ
diff --git a/AndroidOpenDemo/.idea/workspace.xml b/AndroidOpenDemo/.idea/workspace.xml
index bc65b4b..b6acf35 100644
--- a/AndroidOpenDemo/.idea/workspace.xml
+++ b/AndroidOpenDemo/.idea/workspace.xml
@@ -18,10 +18,17 @@
<list default="true" id="7bacc5cf-316f-4ad4-b191-7f5297eb7bcf" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/caches/build_file_checksums.ser" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/caches/build_file_checksums.ser" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/app/AndroidManifest123456.xml" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" beforeDir="false" afterPath="$PROJECT_DIR$/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/DeviceDetailService.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/DeviceDetailService.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/MethodConst.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/common/openapi/MethodConst.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/app/src/main/java/com/utils/DeviceUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/utils/DeviceUtils.java" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/app/src/main/res/layout/activity_device_online_media_play.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/activity_device_online_media_play.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/java/com/utils/HdlToLcUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/utils/HdlToLcUtils.java" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/res/layout/fragment_device_detail_main.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/layout/fragment_device_detail_main.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/res/values-en/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values-en/strings.xml" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -133,8 +140,8 @@
<property name="android-custom-view/Users/hdl/Library/Developer/Xamarin/android-sdk-macosx/sources/android-29/android/view/View.java_SELECTED" value="View" />
<property name="cidr.known.project.marker" value="true" />
<property name="dart.analysis.tool.window.visible" value="false" />
- <property name="last_opened_file_path" value="$PROJECT_DIR$" />
- <property name="memory.settings.postsync.last.time.stamp" value="1669194142378" />
+ <property name="last_opened_file_path" value="$PROJECT_DIR$/app/src/main/res/layout" />
+ <property name="memory.settings.postsync.last.time.stamp" value="1669180114457" />
<property name="multi-representation-preview/Users/hdl/Library/Developer/Xamarin/android-sdk-macosx/sources/android-29/android/view/View.java_selected" value="Custom views" />
<property name="project.structure.last.edited" value="Dependencies" />
<property name="project.structure.proportion" value="0.17" />
@@ -150,15 +157,16 @@
<recent name="com" />
</key>
<key name="CopyClassDialog.RECENTS_KEY">
+ <recent name="com.common.openapi" />
<recent name="com.utils" />
<recent name="com.mm.android.deviceaddmodule.utils" />
</key>
<key name="CopyFile.RECENT_KEYS">
+ <recent name="$PROJECT_DIR$/app/src/main/res/layout" />
+ <recent name="$PROJECT_DIR$/app/src/main/java/com/utils" />
+ <recent name="$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui" />
<recent name="$PROJECT_DIR$/DeviceAddModule/libs" />
<recent name="$PROJECT_DIR$/app/src/main/java/com/hdl" />
- <recent name="$PROJECT_DIR$/app/src/main/res/drawable" />
- <recent name="$PROJECT_DIR$/app/src/main/res/mipmap-xhdpi" />
- <recent name="$PROJECT_DIR$/app/src/main/res/layout" />
</key>
</component>
<component name="RunManager" selected="Android App.app">
@@ -363,67 +371,54 @@
</ignored-roots>
</component>
<component name="WindowStateProjectService">
- <state x="453" y="91" key="#com.intellij.ide.util.MemberChooser" timestamp="1669107811029">
+ <state x="321" y="0" key="#app" timestamp="1669252776150">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state x="453" y="91" key="#com.intellij.ide.util.MemberChooser/0.0.1280.800@0.0.1280.800" timestamp="1669107811029" />
- <state x="180" y="331" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1669107459555">
+ <state x="321" y="0" key="#app/0.0.1280.800@0.0.1280.800" timestamp="1669252776150" />
+ <state x="453" y="113" key="#com.intellij.ide.util.MemberChooser" timestamp="1669257253970">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state x="180" y="331" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog/0.0.1280.800@0.0.1280.800" timestamp="1669107459555" />
- <state x="326" y="276" width="628" height="256" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes" timestamp="1669169928930">
+ <state x="453" y="113" key="#com.intellij.ide.util.MemberChooser/0.0.1280.800@0.0.1280.800" timestamp="1669257253970" />
+ <state width="1236" height="418" key="GridCell.Tab.0.bottom" timestamp="1669257607924">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state x="326" y="276" width="628" height="256" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes/0.0.1280.800@0.0.1280.800" timestamp="1669169928930" />
- <state x="326" y="288" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.packages" timestamp="1669107461906">
+ <state width="1236" height="418" key="GridCell.Tab.0.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
+ <state width="1236" height="164" key="GridCell.Tab.0.bottom/0.23.1280.777@0.23.1280.777" timestamp="1669257377595" />
+ <state width="1236" height="418" key="GridCell.Tab.0.center" timestamp="1669257607924">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state x="326" y="288" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.packages/0.0.1280.800@0.0.1280.800" timestamp="1669107461905" />
- <state width="503" height="480" key="DebuggerActiveHint" timestamp="1669195478136">
- <screen x="0" y="23" width="1280" height="777" />
- </state>
- <state width="503" height="480" key="DebuggerActiveHint/0.0.1280.800@0.0.1280.800" timestamp="1669194412110" />
- <state width="503" height="480" key="DebuggerActiveHint/0.23.1280.777@0.23.1280.777" timestamp="1669195478136" />
- <state width="1236" height="164" key="GridCell.Tab.0.bottom" timestamp="1669195789335">
+ <state width="1236" height="418" key="GridCell.Tab.0.center/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
+ <state width="1236" height="164" key="GridCell.Tab.0.center/0.23.1280.777@0.23.1280.777" timestamp="1669257377593" />
+ <state width="1236" height="418" key="GridCell.Tab.0.left" timestamp="1669257607923">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.0.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669195789335" />
- <state width="1236" height="206" key="GridCell.Tab.0.bottom/0.23.1280.777@0.23.1280.777" timestamp="1669007123738" />
- <state width="1236" height="164" key="GridCell.Tab.0.center" timestamp="1669195789334">
+ <state width="1236" height="418" key="GridCell.Tab.0.left/0.0.1280.800@0.0.1280.800" timestamp="1669257607923" />
+ <state width="1236" height="164" key="GridCell.Tab.0.left/0.23.1280.777@0.23.1280.777" timestamp="1669257377592" />
+ <state width="1236" height="418" key="GridCell.Tab.0.right" timestamp="1669257607924">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.0.center/0.0.1280.800@0.0.1280.800" timestamp="1669195789333" />
- <state width="1236" height="206" key="GridCell.Tab.0.center/0.23.1280.777@0.23.1280.777" timestamp="1669007123735" />
- <state width="1236" height="164" key="GridCell.Tab.0.left" timestamp="1669195789333">
+ <state width="1236" height="418" key="GridCell.Tab.0.right/0.0.1280.800@0.0.1280.800" timestamp="1669257607924" />
+ <state width="1236" height="164" key="GridCell.Tab.0.right/0.23.1280.777@0.23.1280.777" timestamp="1669257377594" />
+ <state width="1236" height="164" key="GridCell.Tab.1.bottom" timestamp="1669257522605">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.0.left/0.0.1280.800@0.0.1280.800" timestamp="1669195789333" />
- <state width="1236" height="206" key="GridCell.Tab.0.left/0.23.1280.777@0.23.1280.777" timestamp="1669007123734" />
- <state width="1236" height="164" key="GridCell.Tab.0.right" timestamp="1669195789334">
+ <state width="1236" height="164" key="GridCell.Tab.1.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669257522605" />
+ <state width="1236" height="164" key="GridCell.Tab.1.center" timestamp="1669257522603">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.0.right/0.0.1280.800@0.0.1280.800" timestamp="1669195789334" />
- <state width="1236" height="206" key="GridCell.Tab.0.right/0.23.1280.777@0.23.1280.777" timestamp="1669007123736" />
- <state width="1236" height="164" key="GridCell.Tab.1.bottom" timestamp="1669195789336">
+ <state width="1236" height="164" key="GridCell.Tab.1.center/0.0.1280.800@0.0.1280.800" timestamp="1669257522603" />
+ <state width="1236" height="164" key="GridCell.Tab.1.left" timestamp="1669257522602">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.1.bottom/0.0.1280.800@0.0.1280.800" timestamp="1669195789336" />
- <state width="1236" height="164" key="GridCell.Tab.1.center" timestamp="1669195789336">
+ <state width="1236" height="164" key="GridCell.Tab.1.left/0.0.1280.800@0.0.1280.800" timestamp="1669257522602" />
+ <state width="1236" height="164" key="GridCell.Tab.1.right" timestamp="1669257522604">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.1.center/0.0.1280.800@0.0.1280.800" timestamp="1669195789336" />
- <state width="1236" height="164" key="GridCell.Tab.1.left" timestamp="1669195789335">
+ <state width="1236" height="164" key="GridCell.Tab.1.right/0.0.1280.800@0.0.1280.800" timestamp="1669257522604" />
+ <state x="332" y="155" width="708" height="490" key="find.popup" timestamp="1669259388351">
<screen x="0" y="0" width="1280" height="800" />
</state>
- <state width="1236" height="164" key="GridCell.Tab.1.left/0.0.1280.800@0.0.1280.800" timestamp="1669195789335" />
- <state width="1236" height="164" key="GridCell.Tab.1.right" timestamp="1669195789336">
- <screen x="0" y="0" width="1280" height="800" />
- </state>
- <state width="1236" height="164" key="GridCell.Tab.1.right/0.0.1280.800@0.0.1280.800" timestamp="1669195789336" />
- <state x="215" y="44" width="1065" height="629" key="find.popup" timestamp="1669195142751">
- <screen x="0" y="0" width="1280" height="800" />
- </state>
- <state x="215" y="44" width="1065" height="629" key="find.popup/0.0.1280.800@0.0.1280.800" timestamp="1669195142751" />
+ <state x="332" y="155" width="708" height="490" key="find.popup/0.0.1280.800@0.0.1280.800" timestamp="1669259388351" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
@@ -460,7 +455,7 @@
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java</url>
- <line>77</line>
+ <line>73</line>
<option name="timeStamp" value="61" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
@@ -469,14 +464,19 @@
<option name="timeStamp" value="84" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
+ <url>file://$PROJECT_DIR$/app/src/main/java/com/lechange/demo/adapter/DeviceListAdapter.java</url>
+ <line>48</line>
+ <option name="timeStamp" value="92" />
+ </line-breakpoint>
+ <line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/DeviceRecordListActivity.java</url>
<line>36</line>
<option name="timeStamp" value="94" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="java-line">
<url>file://$PROJECT_DIR$/app/src/main/java/com/lechange/demo/ui/DeviceOnlineMediaPlayActivity.java</url>
- <line>411</line>
- <option name="timeStamp" value="103" />
+ <line>410</line>
+ <option name="timeStamp" value="98" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
diff --git a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java
index e0bc9ad..12a46fc 100644
--- a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java
+++ b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java
@@ -68,10 +68,10 @@
private static JsonObject doPost(String url, Map<String, Object> map, int timeOut) throws BusinessException {
Gson gson = new Gson();
- map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
String json;
JsonObject jsonObject;
if(CONST.isHdlServer()) {
+ map.put("homeId", LCDeviceEngine.newInstance().getHomeId());
if (map.containsKey("params")) {
Map<String, Object> tempMap = (Map<String, Object>) map.get("params");
map.remove("params");
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;
+ }
+ }
+ };
+ }
+
}
diff --git a/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java b/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java
index 3ceda8d..3283b52 100644
--- a/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java
+++ b/AndroidOpenDemo/app/src/main/java/com/common/openapi/DeviceInfoOpenApiManager.java
@@ -14,11 +14,7 @@
import com.google.gson.JsonObject;
import com.mm.android.deviceaddmodule.LCDeviceEngine;
import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessException;
-import com.mm.android.deviceaddmodule.mobilecommon.common.Constants;
-import com.mm.android.deviceaddmodule.mobilecommon.utils.PreferencesHelper;
import com.mm.android.deviceaddmodule.openapi.HttpSend;
-
-import org.json.JSONObject;
import java.util.HashMap;
@@ -127,6 +123,14 @@
return true;
}
+ public static boolean recoverSDCard(String deviceId) throws BusinessException{
+ HashMap<String, Object> paramsMap = new HashMap<String, Object>();
+ paramsMap.put("token", LCDeviceEngine.newInstance().accessToken);
+ paramsMap.put("deviceId", deviceId);
+ HttpSend.execute(paramsMap, MethodConst.RECOVER_SDCARD,TIME_OUT);
+ return true;
+ }
+
/**
* 鑾峰彇璁惧鐗堟湰鍜屽彲鍗囩骇淇℃伅
*
diff --git a/AndroidOpenDemo/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java b/AndroidOpenDemo/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java
index 5d0b016..236b583 100644
--- a/AndroidOpenDemo/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java
+++ b/AndroidOpenDemo/app/src/main/java/com/common/openapi/IGetDeviceInfoCallBack.java
@@ -214,6 +214,22 @@
void onError(Throwable throwable);
}
+ public interface IRecoverSDCardCallBack {
+ /**
+ * 鎴愬姛
+ *
+ * @param result
+ */
+ void onSuccess(String result);
+
+ /**
+ * 閿欒鍥炶皟
+ *
+ * @param throwable
+ */
+ void onError(Throwable throwable);
+ }
+
}
diff --git a/AndroidOpenDemo/app/src/main/java/com/common/openapi/MethodConst.java b/AndroidOpenDemo/app/src/main/java/com/common/openapi/MethodConst.java
index 94e3517..d87da16 100644
--- a/AndroidOpenDemo/app/src/main/java/com/common/openapi/MethodConst.java
+++ b/AndroidOpenDemo/app/src/main/java/com/common/openapi/MethodConst.java
@@ -38,6 +38,8 @@
public static String DELETE_DEVICE_PERMISSION = "deleteDevicePermission";
+ public static String RECOVER_SDCARD = "recoverSDCard";
+
public static String SD_STATUE_QUERY = "deviceSdcardStatus";
public static String GET_DEVICE_CLOUD = "getDeviceCloud";
diff --git a/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java b/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java
index f593375..db12d50 100644
--- a/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java
+++ b/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/DeviceDetailMainFragment.java
@@ -55,6 +55,7 @@
private IGetDeviceInfoCallBack.IModifyDeviceName modifyNameListener;
private String fromWhere;
private TextView tvDeploymentTip;
+ private TextView tvFormat_sd;
public static DeviceDetailMainFragment newInstance() {
DeviceDetailMainFragment fragment = new DeviceDetailMainFragment();
@@ -92,11 +93,13 @@
tvDeviceVersion = view.findViewById(R.id.tv_device_version);
tvCurrentWifi = view.findViewById(R.id.tv_current_wifi);
rlCurWifi = view.findViewById(R.id.rl_cur_wifi);
+ tvFormat_sd =view.findViewById(R.id.tvFormat_sd);
rlDeployment.setOnClickListener(this);
rlDetele.setOnClickListener(this);
rlDeviceDetail.setOnClickListener(this);
rlCurWifi.setOnClickListener(this);
+ tvFormat_sd.setOnClickListener(this);
DeviceDetailActivity deviceDetailActivity = (DeviceDetailActivity) getActivity();
deviceDetailActivity.tvTitle.setText(getResources().getString(R.string.lc_demo_device_detail_title));
if (arguments == null) {
@@ -271,6 +274,25 @@
deviceDetailService.unBindDevice(deviceUnBindData, this);*/
deviceDetailService.deletePermission(deviceListBean.deviceId,null,this);
}
+ else if(id==R.id.tvFormat_sd){
+ deviceDetailActivity.rlLoading.setVisibility(View.VISIBLE);
+ DeviceDetailService deviceDetailService = ClassInstanceManager.newInstance().getDeviceDetailService();
+ /* DeviceUnBindData deviceUnBindData = new DeviceUnBindData();
+ deviceUnBindData.data.deviceId = deviceListBean.deviceId;
+ deviceDetailService.unBindDevice(deviceUnBindData, this);*/
+ deviceDetailService.recoverSDCard(deviceListBean.deviceId, new IGetDeviceInfoCallBack.IRecoverSDCardCallBack() {
+ @Override
+ public void onSuccess(String result) {
+ deviceDetailActivity.rlLoading.setVisibility(View.GONE);
+ }
+
+ @Override
+ public void onError(Throwable throwable) {
+ deviceDetailActivity.rlLoading.setVisibility(View.GONE);
+ }
+ });
+
+ }
}
@Override
diff --git a/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java b/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java
index 807af2e..91306bf 100644
--- a/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java
+++ b/AndroidOpenDemo/app/src/main/java/com/lechange/demo/ui/EnvGuideActivity.java
@@ -70,7 +70,7 @@
HdlToLcUtils.getInstance().initData(this, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", "https://test-gz.hdlcontrol.com");
HdlToLcUtils.getInstance().setHomeId("1547099040465408002");
- HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI0YTJhNzZiYTUxNzU0ZmFmODZlYjhhNDZiODUzZWRjMCIsImNvbXBhbnlJZCI6IjIwMiIsInJvbGUiOiIiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidXNlckFjY291bnQiOiJ3eHIiLCJ0ZW5hbnRJZCI6IjIwIiwidXNlclR5cGUiOiJVU0VSX0IiLCJ0b2tlblR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJ1c2VyTmFtZSI6Ind4ciIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NjkyMDEzODYsIm5iZiI6MTY2OTE5NDE4Nn0.jlXwyCbdy41f4tkObmnKup6r2xGRzk5fLtHfNgaNSdJ6deyzKFVLQcDH3FMW_AntAo2ghkTQLZGnMXt8k7uoC0fa6XLHA8bTNYvjx4-2X1ky2FMcvv_sDTmmPMo6EbqOeRNkCoiLly2iTB4Ch6FJRSQo0UFkpOJtJJuCCo92B5c");
+ HdlToLcUtils.getInstance().setToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3MmI0OTEwYWRkYmE0ZjA3YjAxNzQxYmZhOGIzOTIyMSIsImNvbXBhbnlJZCI6IjIwMiIsInJvbGUiOiIiLCJoZWFkZXJQcmVmaXgiOiJCZWFyZXIgIiwidXNlckFjY291bnQiOiJ3eHIiLCJ0ZW5hbnRJZCI6IjIwIiwidXNlclR5cGUiOiJVU0VSX0IiLCJ0b2tlblR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJ1c2VyTmFtZSI6Ind4ciIsIm9wZW5BcHBsaWNhdGlvbklkIjoiMCIsInVzZXJJZCI6IjEzOTIwMzU1NjgyMDQ0MjMxNjkiLCJleHAiOjE2NjkyNTk5NTUsIm5iZiI6MTY2OTI1Mjc1NX0.T0Ni3_QGu25At2UNmsqB3lfo_ueRUZTmeRLbeVK4JpvqzwlwYykCnxXZ6pyWmTPEtAvsr68e8xSIMTKp1J8X61CXipHjRBBvgOkcwpuS-436RCQR3cg_uaCQ4Ac63C6N6G94FG6zukbSYRbgBaBQqKcOBbqEYD0hCa8BaXg6sCM");
HdlToLcUtils.getInstance().setSubAccessToken("St_00003ee84eda32b14126af958052f20a");
// HdlToLcUtils.getInstance().openActivity();
diff --git a/AndroidOpenDemo/app/src/main/java/com/utils/HdlToLcUtils.java b/AndroidOpenDemo/app/src/main/java/com/utils/HdlToLcUtils.java
index 602d5f4..674a8e3 100644
--- a/AndroidOpenDemo/app/src/main/java/com/utils/HdlToLcUtils.java
+++ b/AndroidOpenDemo/app/src/main/java/com/utils/HdlToLcUtils.java
@@ -61,9 +61,9 @@
// mUrl = CONST.Envirment.CHINA_TEST.url;
// ProviderManager.getAppProvider().setAppType(0);
// } else {
-// mAppSecret = "017fc27bb987496f9a677e4e6f0c88";
-// mAppid = "lc0285433bc7e8423d";
-// mUrl = CONST.Envirment.OVERSEAS_PRO.url;
+// secretKey = "017fc27bb987496f9a677e4e6f0c88";
+// appKey = "lc0285433bc7e8423d";
+// url = CONST.Envirment.OVERSEAS_PRO.url;
ProviderManager.getAppProvider().setAppType(1);
// }
diff --git a/AndroidOpenDemo/app/src/main/res/layout/fragment_device_detail_main.xml b/AndroidOpenDemo/app/src/main/res/layout/fragment_device_detail_main.xml
index 6dc6914..a46d781 100644
--- a/AndroidOpenDemo/app/src/main/res/layout/fragment_device_detail_main.xml
+++ b/AndroidOpenDemo/app/src/main/res/layout/fragment_device_detail_main.xml
@@ -122,6 +122,23 @@
android:src="@mipmap/lc_demo_common_btn_next"></ImageView>
</RelativeLayout>
<RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/px_130"
+ android:background="@color/lc_demo_color_ffffff"
+ android:gravity="center_vertical"
+ android:paddingLeft="@dimen/px_30"
+ android:paddingRight="@dimen/px_30">
+
+ <TextView
+ android:id="@+id/tvFormat_sd"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:text="@string/format_sd"
+ android:textColor="@color/lc_demo_color_2c2c2c"
+ android:textSize="@dimen/px_36"></TextView>
+ </RelativeLayout>
+ <RelativeLayout
android:visibility="gone"
android:layout_marginTop="@dimen/px_1"
android:id="@+id/rl_cur_wifi"
diff --git a/AndroidOpenDemo/app/src/main/res/values-en/strings.xml b/AndroidOpenDemo/app/src/main/res/values-en/strings.xml
index c09df0b..461165a 100644
--- a/AndroidOpenDemo/app/src/main/res/values-en/strings.xml
+++ b/AndroidOpenDemo/app/src/main/res/values-en/strings.xml
@@ -78,4 +78,5 @@
<string name="lc_demo_device_today_no_record">today no record</string>
<string name="lc_demo_device_local_sd">No storage medium</string>
<string name="lc_demo_device_cloud_not_open">Cloud storage is not enabled</string>
+ <string name="format_sd">Format sd card</string>
</resources>
diff --git a/AndroidOpenDemo/app/src/main/res/values/strings.xml b/AndroidOpenDemo/app/src/main/res/values/strings.xml
index 4278f8c..fdfcdf3 100644
--- a/AndroidOpenDemo/app/src/main/res/values/strings.xml
+++ b/AndroidOpenDemo/app/src/main/res/values/strings.xml
@@ -78,4 +78,5 @@
<string name="lc_demo_device_today_no_record">浠婃棩鏆傛棤褰曞儚</string>
<string name="lc_demo_device_local_sd">鏃犲瓨鍌ㄤ粙璐�</string>
<string name="lc_demo_device_cloud_not_open">浜戝瓨鍌ㄦ湭寮�閫�</string>
+ <string name="format_sd">鏍煎紡鍖朣D鍗�</string>
</resources>
--
Gitblit v1.8.0