fixed update issues.
authorTrillGates <williamtrillgates@gmail.com>
Fri, 22 Jan 2021 06:56:16 +0000 (14:56 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 22 Jan 2021 06:56:16 +0000 (14:56 +0800)
app/IcL02WorkService/release/IcL02WorkService_V57_202101151444_release.apk [deleted file]
app/IcL02WorkService/release/IcL02WorkService_V57_202101191933_release.apk [new file with mode: 0644]
app/IcL02WorkService/release/output.json
app/src/main/AndroidManifest.xml
app/src/main/aidl/com/ic/work/ITempSensorCallback.aidl
app/src/main/aidl/com/ic/work/ITempSensorService.aidl
app/src/main/java/com/ic/work/SensorDataService.java
app/src/main/java/com/ic/work/hardware/TemperatureHelper.java
app/src/main/java/com/ic/work/utils/StorageUtils.java
app/src/main/java/com/ic/work/utils/TemperatureUtil.java

diff --git a/app/IcL02WorkService/release/IcL02WorkService_V57_202101151444_release.apk b/app/IcL02WorkService/release/IcL02WorkService_V57_202101151444_release.apk
deleted file mode 100644 (file)
index 5361343..0000000
Binary files a/app/IcL02WorkService/release/IcL02WorkService_V57_202101151444_release.apk and /dev/null differ
diff --git a/app/IcL02WorkService/release/IcL02WorkService_V57_202101191933_release.apk b/app/IcL02WorkService/release/IcL02WorkService_V57_202101191933_release.apk
new file mode 100644 (file)
index 0000000..96fb390
Binary files /dev/null and b/app/IcL02WorkService/release/IcL02WorkService_V57_202101191933_release.apk differ
index 2967bc5..0d11387 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.1","enabled":true,"outputFile":"IcL02WorkService_V57_202101151444_release.apk","fullName":"IcL02WorkServiceRelease","baseName":"IcL02WorkService-release"},"path":"IcL02WorkService_V57_202101151444_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.1","enabled":true,"outputFile":"IcL02WorkService_V57_202101191933_release.apk","fullName":"IcL02WorkServiceRelease","baseName":"IcL02WorkService-release"},"path":"IcL02WorkService_V57_202101191933_release.apk","properties":{}}]
\ No newline at end of file
index 6571f55..2cbd87c 100644 (file)
@@ -62,7 +62,9 @@
         </activity>
 
         <service android:name="com.amap.api.location.APSService" />
-        <service android:name=".SensorDataService">
+        <service
+            android:name=".SensorDataService"
+            android:exported="true">
             <intent-filter>
                 <!--掌育通过startService的方式来测量体温/心率-->
                 <action android:name="com.jx.lanucher.action.temperature" />
index ea3c7f1..0734ab8 100644 (file)
@@ -5,8 +5,8 @@ import com.ic.work.domain.Temperature;
 
 interface ITempSensorCallback {
 
-    void onTemperatureGet(in Temperature temperature);
-    void onTemperatureUpdating(in Temperature temperature);
+   oneway void onTemperatureGet(in Temperature temperature);
+   oneway void onTemperatureUpdating(in Temperature temperature);
    void onGettingData();
    void onWaiting();
 }
\ No newline at end of file
index 156a851..4941edd 100644 (file)
@@ -5,5 +5,5 @@ import com.ic.work.ITempSensorCallback;
 interface ITempSensorService {
     void registerCallback(in ITempSensorCallback callback,in String callbackTag);
     void unRegisterCallback(in ITempSensorCallback callback);
-    void getTemperatureInfo(int from,in String callbackTag);
+    oneway void getTemperatureInfo(int from,in String callbackTag);
 }
\ No newline at end of file
index dfa25d4..ee3a3ce 100644 (file)
@@ -154,15 +154,16 @@ public class SensorDataService extends Service implements TemperatureHelper.Temp
         synchronized (mLock) {
             int i = temperatureCallbacks.beginBroadcast();
             IcLog.d(TAG, "temperature callback size == > " + i + " temperature is " + temperature);
-            while (i > 0) {
-                i--;
-                try {
+            try {
+                while (i > 0) {
                     temperatureCallbacks.getBroadcastItem(i).onTemperatureGet(temperature);
-                } catch (RemoteException e) {
-                    e.printStackTrace();
+                    i--;
                 }
+            } catch (RemoteException e) {
+                e.printStackTrace();
+            } finally {
+                temperatureCallbacks.finishBroadcast();
             }
-            temperatureCallbacks.finishBroadcast();
         }
     }
 
@@ -565,16 +566,14 @@ public class SensorDataService extends Service implements TemperatureHelper.Temp
             int i = temperatureCallbacks.beginBroadcast();
             IcLog.d(TAG, "dispatch temperature update == > " + temperature);
             try {
-                while (i > 1) {
+                while (i > 0) {
                     i--;
                     temperatureCallbacks.getBroadcastItem(i).onTemperatureUpdating(temperature);
                 }
             } catch (Exception e) {
                 e.printStackTrace();
             }
-            if (i > 0) {
-                temperatureCallbacks.finishBroadcast();
-            }
+            temperatureCallbacks.finishBroadcast();
         }
     }
 
index 234bc54..9580394 100644 (file)
@@ -1,16 +1,13 @@
 package com.ic.work.hardware;
 
+import android.os.SystemClock;
+
 import com.ic.work.domain.TemperatureItem;
 import com.ic.work.utils.HardwareUtils;
 import com.ic.work.utils.ICLogger;
 import com.ic.work.utils.IcLog;
 import com.ic.work.utils.TemperatureUtil;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
 /**
  * 获取温度的工具类
  */
@@ -56,69 +53,42 @@ public class TemperatureHelper {
                 HardwareUtils.disablePedometer();
                 if (HardwareUtils.enableTemperature()) {
                     IcLog.i(TAG, "getNdkTemperatureValue  enableTemperature");
-                    long begin = System.currentTimeMillis();
-                    while (true) {
-                        if (System.currentTimeMillis() - begin > 1000) {
-                            break;
-                        }
-                    }
+                    SystemClock.sleep(1000);
                 }
-                //这里做超时处理
-                ExecutorService executor = Executors.newSingleThreadExecutor();
-                while (true) {
-                    Future<?> submit = executor.submit(() -> {
-                        IcLog.d(TAG, "do temperature....");
-                        long begin = System.currentTimeMillis();
-                        while (true) {
-                            if (System.currentTimeMillis() - begin > 1000) {
-                                break;
-                            }
+                do {
+                    IcLog.d(TAG, "do temperature....");
+                    SystemClock.sleep(1000);
+                    long getStartTime = System.currentTimeMillis();
+                    lastWristTemp = HardwareUtils.getNdkTemperatureOutValue();
+                    TemperatureItem temperatureItem = TemperatureUtil.doTempTest();
+                    if (temperatureItem != null) {
+                        lastWristTemp = Double.parseDouble(temperatureItem.getBodyTemp());
+                        lastTempOut = Double.parseDouble(temperatureItem.getEvnTemp());
+
+                        if (lastTempOut > 60 || lastTempOut < 1) {
+                            lastTempOut = 0.0f;
                         }
-                        long getStartTime = System.currentTimeMillis();
-                        lastWristTemp = HardwareUtils.getNdkTemperatureOutValue();
-                        TemperatureItem temperatureItem = TemperatureUtil.doTempTest();
-                        if (temperatureItem != null) {
-                            lastWristTemp = Double.parseDouble(temperatureItem.getBodyTemp());
-                            lastTempOut = Double.parseDouble(temperatureItem.getEvnTemp());
-
-                            if (lastTempOut > 60 || lastTempOut < 1) {
-                                lastTempOut = 0.0f;
-                            }
-                            if (lastTempOut > 0.0f) {
-                                lastBodyTemp = TemperatureUtil.getBodyTemp(lastWristTemp, lastTempOut);
-                            } else {
-                                lastBodyTemp = TemperatureUtil.getBodyTemp(lastWristTemp, 26.0f);
-                            }
-                            IcLog.d(TAG, "testing..." + lastWristTemp + " " + lastBodyTemp + " " + lastTempOut);
-                            //前10秒不更新内容,后10秒再更新数据
-                            if (delayTimesInSeconds <= 10 && mListener != null) {
-                                IcLog.d(TAG, "update temperature info..thread name is ." + Thread.currentThread().getName());
-                                //获取
-                                IcLog.d(TAG, "lastWristTemp == > " + lastWristTemp);
-                                IcLog.d(TAG, "lastBodyTemp == > " + lastBodyTemp);
-                                IcLog.d(TAG, "lastTempOut == > " + lastTempOut);
-                                mListener.onTemperatureUpdate(lastWristTemp, lastBodyTemp, lastTempOut);
-                            }
-                            ICLogger.d("get temperature data use time == > " + (System.currentTimeMillis() - getStartTime));
+                        if (lastTempOut > 0.0f) {
+                            lastBodyTemp = TemperatureUtil.getBodyTemp(lastWristTemp, lastTempOut);
+                        } else {
+                            lastBodyTemp = TemperatureUtil.getBodyTemp(lastWristTemp, 26.0f);
                         }
-                    });
-
-                    try {
-                        ICLogger.d("start to get temperature data...");
-                        submit.get(10, TimeUnit.SECONDS);
-                        ICLogger.d("to get temperature end...");
-                    } catch (Exception e) {
-                        ICLogger.d("get temperature data time out...");
-                        continue;
+                        IcLog.d(TAG, "testing..." + lastWristTemp + " " + lastBodyTemp + " " + lastTempOut);
+                        //前10秒不更新内容,后10秒再更新数据
+                        if (delayTimesInSeconds <= 10 && mListener != null) {
+                            IcLog.d(TAG, "update temperature info..thread name is ." + Thread.currentThread().getName());
+                            //获取
+                            IcLog.d(TAG, "lastWristTemp == > " + lastWristTemp);
+                            IcLog.d(TAG, "lastBodyTemp == > " + lastBodyTemp);
+                            IcLog.d(TAG, "lastTempOut == > " + lastTempOut);
+                            mListener.onTemperatureUpdate(lastWristTemp, lastBodyTemp, lastTempOut);
+                        }
+                        ICLogger.d("get temperature data use time == > " + (System.currentTimeMillis() - getStartTime));
                     }
                     delayTimesInSeconds--;
                     IcLog.d(TAG, "delayTimesInSeconds " + delayTimesInSeconds);
                     //延时delay_times_in_seconds秒后停止检测。
-                    if (delayTimesInSeconds <= 0) {
-                        break;
-                    }
-                }
-                executor.shutdown();
+                } while (delayTimesInSeconds > 0);
             } catch (Exception e) {
                 IcLog.e(TAG, "TemperatureRunnable :", e);
             } finally {
index ae72a50..d8107a7 100644 (file)
@@ -17,12 +17,15 @@ package com.ic.work.utils;
 
 import android.content.Context;
 import android.content.pm.PackageManager;
+import android.os.Build;
 import android.os.Environment;
 import android.os.StatFs;
+import android.util.Log;
 
 import java.io.File;
 import java.io.IOException;
 
+import static android.os.Environment.DIRECTORY_DOCUMENTS;
 import static android.os.Environment.MEDIA_MOUNTED;
 
 /**
@@ -33,124 +36,137 @@ import static android.os.Environment.MEDIA_MOUNTED;
  */
 public final class StorageUtils {
 
-       private static final String EXTERNAL_STORAGE_PERMISSION = "android.permission.WRITE_EXTERNAL_STORAGE";
-       private static final String INDIVIDUAL_DIR_NAME = "uil-images";
-
-       private StorageUtils() {
-       }
-
-       public static String getExternalStorageLogDir() {
-
-               if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
-                       File dir = new File(Environment.getExternalStorageDirectory().getPath(), "Android/ic/icprotocol");
-                       String path = dir.getPath();
-                       if (!dir.exists()) {
-                               dir.mkdirs();
-                       }
-                       return path;
-               }
-               return "/storage/emulated/0/Android/ic/icprotocol";
-       }
-       /**
-        * Returns application cache directory. Cache directory will be created on SD card
-        * <i>("/Android/data/[app_package_name]/cache")</i> if card is mounted and app has appropriate permission. Else -
-        * Android defines cache directory on device's file system.
-        *
-        * @param context Application context
-        * @return Cache {@link File directory}.<br />
-        * <b>NOTE:</b> Can be null in some unpredictable cases (if SD card is unmounted and
-        * {@link Context#getCacheDir() Context.getCacheDir()} returns null).
-        */
-       public static File getCacheDirectory(Context context) {
-               return getCacheDirectory(context, true);
-       }
-
-       /**
-        * Returns application cache directory. Cache directory will be created on SD card
-        * <i>("/Android/data/[app_package_name]/cache")</i> (if card is mounted and app has appropriate permission) or
-        * on device's file system depending incoming parameters.
-        *
-        * @param context        Application context
-        * @param preferExternal Whether prefer external location for cache
-        * @return Cache {@link File directory}.<br />
-        * <b>NOTE:</b> Can be null in some unpredictable cases (if SD card is unmounted and
-        * {@link Context#getCacheDir() Context.getCacheDir()} returns null).
-        */
-       public static File getCacheDirectory(Context context, boolean preferExternal) {
-               File appCacheDir = null;
-               if (preferExternal && MEDIA_MOUNTED
-                               .equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context) && haveFreeSpace()) {
-                       appCacheDir = getExternalCacheDir(context);
-               }
-               if (appCacheDir == null) {
-                       appCacheDir = context.getCacheDir();
-               }
-               if (appCacheDir == null) {
-                       String cacheDirPath = "/data/data/" + context.getPackageName() + "/cache/";
-                       appCacheDir = new File(cacheDirPath);
-               }
-               return appCacheDir;
-       }
-
-       /**
-        * Returns individual application cache directory (for only image caching from ImageLoader). Cache directory will be
-        * created on SD card <i>("/Android/data/[app_package_name]/cache/uil-images")</i> if card is mounted and app has
-        * appropriate permission. Else - Android defines cache directory on device's file system.
-        *
-        * @param context Application context
-        * @return Cache {@link File directory}
-        */
-       public static File getIndividualCacheDirectory(Context context) {
-               File cacheDir = getCacheDirectory(context);
-               File individualCacheDir = new File(cacheDir, INDIVIDUAL_DIR_NAME);
-               if (!individualCacheDir.exists()) {
-                       if (!individualCacheDir.mkdir()) {
-                               individualCacheDir = cacheDir;
-                       }
-               }
-               return individualCacheDir;
-       }
-
-       /**
-        * Returns specified application cache directory. Cache directory will be created on SD card by defined path if card
-        * is mounted and app has appropriate permission. Else - Android defines cache directory on device's file system.
-        *
-        * @param context  Application context
-        * @param cacheDir Cache directory path (e.g.: "AppCacheDir", "AppDir/cache/images")
-        * @return Cache {@link File directory}
-        */
-       public static File getOwnCacheDirectory(Context context, String cacheDir) {
-               File appCacheDir = null;
-               if (MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context)) {
-                       appCacheDir = new File(Environment.getExternalStorageDirectory(), cacheDir);
-               }
-               if (appCacheDir == null || (!appCacheDir.exists() && !appCacheDir.mkdirs())) {
-                       appCacheDir = context.getCacheDir();
-               }
-               return appCacheDir;
-       }
-
-       private static File getExternalCacheDir(Context context) {
-               File dataDir = new File(new File(Environment.getExternalStorageDirectory(), "Android"), "data");
-               File appCacheDir = new File(new File(dataDir, context.getPackageName()), "cache");
-               if (!appCacheDir.exists()) {
-                       if (!appCacheDir.mkdirs()) {
-                               return null;
-                       }
-                       try {
-                               new File(appCacheDir, ".nomedia").createNewFile();
-                       } catch (IOException e) {
-                       }
-               }
-               return appCacheDir;
-       }
-
-       private static boolean hasExternalStoragePermission(Context context) {
-               int perm = context.checkCallingOrSelfPermission(EXTERNAL_STORAGE_PERMISSION);
-               return perm == PackageManager.PERMISSION_GRANTED;
-       }
-
-       private static boolean haveFreeSpace() {
+    private static final String EXTERNAL_STORAGE_PERMISSION = "android.permission.WRITE_EXTERNAL_STORAGE";
+    private static final String INDIVIDUAL_DIR_NAME = "uil-images";
+    private static final String TAG = "StorageUtils";
+
+    private StorageUtils() {
+    }
+
+    public static String getExternalStorageLogDir() {
+
+
+        //判断版本,如果是4.4的版本则使用旧的API
+        //如果是8.1的版本,使用publish的API
+        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            File dir;
+            Log.d(TAG, "current system version is == > " + Build.VERSION.SDK_INT);
+            if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
+                dir = new File(Environment.getExternalStoragePublicDirectory(DIRECTORY_DOCUMENTS), "Android/ic/icWorkService");
+            } else {
+                dir = new File(Environment.getExternalStorageDirectory().getPath(), "Android/ic/icprotocol");
+            }
+
+            String path = dir.getPath();
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            return path;
+        }
+
+        return "/storage/emulated/0/Android/ic/icWorkService";
+    }
+
+    /**
+     * Returns application cache directory. Cache directory will be created on SD card
+     * <i>("/Android/data/[app_package_name]/cache")</i> if card is mounted and app has appropriate permission. Else -
+     * Android defines cache directory on device's file system.
+     *
+     * @param context Application context
+     * @return Cache {@link File directory}.<br />
+     * <b>NOTE:</b> Can be null in some unpredictable cases (if SD card is unmounted and
+     * {@link Context#getCacheDir() Context.getCacheDir()} returns null).
+     */
+    public static File getCacheDirectory(Context context) {
+        return getCacheDirectory(context, true);
+    }
+
+    /**
+     * Returns application cache directory. Cache directory will be created on SD card
+     * <i>("/Android/data/[app_package_name]/cache")</i> (if card is mounted and app has appropriate permission) or
+     * on device's file system depending incoming parameters.
+     *
+     * @param context        Application context
+     * @param preferExternal Whether prefer external location for cache
+     * @return Cache {@link File directory}.<br />
+     * <b>NOTE:</b> Can be null in some unpredictable cases (if SD card is unmounted and
+     * {@link Context#getCacheDir() Context.getCacheDir()} returns null).
+     */
+    public static File getCacheDirectory(Context context, boolean preferExternal) {
+        File appCacheDir = null;
+        if (preferExternal && MEDIA_MOUNTED
+                .equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context) && haveFreeSpace()) {
+            appCacheDir = getExternalCacheDir(context);
+        }
+        if (appCacheDir == null) {
+            appCacheDir = context.getCacheDir();
+        }
+        if (appCacheDir == null) {
+            String cacheDirPath = "/data/data/" + context.getPackageName() + "/cache/";
+            appCacheDir = new File(cacheDirPath);
+        }
+        return appCacheDir;
+    }
+
+    /**
+     * Returns individual application cache directory (for only image caching from ImageLoader). Cache directory will be
+     * created on SD card <i>("/Android/data/[app_package_name]/cache/uil-images")</i> if card is mounted and app has
+     * appropriate permission. Else - Android defines cache directory on device's file system.
+     *
+     * @param context Application context
+     * @return Cache {@link File directory}
+     */
+    public static File getIndividualCacheDirectory(Context context) {
+        File cacheDir = getCacheDirectory(context);
+        File individualCacheDir = new File(cacheDir, INDIVIDUAL_DIR_NAME);
+        if (!individualCacheDir.exists()) {
+            if (!individualCacheDir.mkdir()) {
+                individualCacheDir = cacheDir;
+            }
+        }
+        return individualCacheDir;
+    }
+
+    /**
+     * Returns specified application cache directory. Cache directory will be created on SD card by defined path if card
+     * is mounted and app has appropriate permission. Else - Android defines cache directory on device's file system.
+     *
+     * @param context  Application context
+     * @param cacheDir Cache directory path (e.g.: "AppCacheDir", "AppDir/cache/images")
+     * @return Cache {@link File directory}
+     */
+    public static File getOwnCacheDirectory(Context context, String cacheDir) {
+        File appCacheDir = null;
+        if (MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) && hasExternalStoragePermission(context)) {
+            appCacheDir = new File(Environment.getExternalStorageDirectory(), cacheDir);
+        }
+        if (appCacheDir == null || (!appCacheDir.exists() && !appCacheDir.mkdirs())) {
+            appCacheDir = context.getCacheDir();
+        }
+        return appCacheDir;
+    }
+
+    private static File getExternalCacheDir(Context context) {
+        File dataDir = new File(new File(Environment.getExternalStorageDirectory(), "Android"), "data");
+        File appCacheDir = new File(new File(dataDir, context.getPackageName()), "cache");
+        if (!appCacheDir.exists()) {
+            if (!appCacheDir.mkdirs()) {
+                return null;
+            }
+            try {
+                new File(appCacheDir, ".nomedia").createNewFile();
+            } catch (IOException e) {
+            }
+        }
+        return appCacheDir;
+    }
+
+    private static boolean hasExternalStoragePermission(Context context) {
+        int perm = context.checkCallingOrSelfPermission(EXTERNAL_STORAGE_PERMISSION);
+        return perm == PackageManager.PERMISSION_GRANTED;
+    }
+
+    private static boolean haveFreeSpace() {
         if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
             StatFs st = new StatFs(Environment.getExternalStorageDirectory().getPath());
             int blockSize = st.getBlockSize();
index 6838272..5a15ff0 100644 (file)
@@ -90,11 +90,19 @@ public class TemperatureUtil {
                 //数据处理一下
                 cpuTemp = Integer.parseInt(cpuTempStr) / 1000.0f;
                 gpuTemp = Integer.parseInt(gpuTempStr) / 1000.0f;
-                chargeTemp = Integer.parseInt(chargeTempStr) / 1000.0f;
-                paTemp = Integer.parseInt(paTempStr) / 1000.0f;
+                try {
+                    chargeTemp = Integer.parseInt(chargeTempStr) / 1000.0f;
+                } catch (Exception e) {
+                    chargeTemp = 0.0f;
+                }
+                try {
+                    paTemp = Integer.parseInt(paTempStr) / 1000.0f;
+                } catch (Exception e) {
+                    paTemp = 0.0f;
+                }
                 boardTemp = Integer.parseInt(boardTempStr) / 1000.0f;
             } catch (Exception e) {
-                e.printStackTrace();
+               //no crash is okay.
             }
             evnTemp = get_tempOut_value_origin();
             bodyTemp = get_temp_value_adjusted();
@@ -112,7 +120,13 @@ public class TemperatureUtil {
             //========================================================================//
             //环境温度的斜率和Y轴偏移值
             String envSlope = IcSystemProperty.getSystemProperties("persist.sys.envAlgSlope", "");
+            if (TextUtils.isEmpty(envSlope)) {
+                envSlope = "0.6205";
+            }
             String envDy = IcSystemProperty.getSystemProperties("persist.sys.envAlgDy", "");
+            if (TextUtils.isEmpty(envDy)) {
+                envDy = "-22.049";
+            }
             IcLog.d(TAG, "envSlope == > " + envSlope + " envDy == >  " + envDy);
             double resultEnvTemp = evnTemp;
             if (!TextUtils.isEmpty(envDy) && !TextUtils.isEmpty(envSlope) && boardTemp > 39) {
@@ -129,7 +143,13 @@ public class TemperatureUtil {
             }
 
             String bodySlope = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgSlope", "");
+            if (TextUtils.isEmpty(bodySlope)) {
+                bodySlope = "0.4533";
+            }
             String bodyDy = IcSystemProperty.getSystemProperties("persist.sys.bodyAlgDy", "");
+            if (TextUtils.isEmpty(bodyDy)) {
+                bodyDy = "-15.294";
+            }
             IcLog.d(TAG, "bodySlope == > " + bodySlope + " bodyDy == >  " + bodyDy);
             double resultBodyTemp = bodyTemp;
             if (!TextUtils.isEmpty(bodyDy) && !TextUtils.isEmpty(bodySlope)) {