1、重新配置编译环境,与icprotocol 一致
authorsnickersun <scy@incartech.cn>
Sun, 16 Aug 2020 15:20:39 +0000 (23:20 +0800)
committersnickersun <scy@incartech.cn>
Sun, 16 Aug 2020 15:20:39 +0000 (23:20 +0800)
2、修复 温度校准 到负数仍然计时的问题。

12 files changed:
app/build.gradle
app/libs/frameworks-full-debug.jar [new file with mode: 0644]
app/libs/telephony_common-full-debug.jar [new file with mode: 0644]
app/src/main/java/mobile/miki/TemperatureAdjustActivity.java
app/src/main/jni/Android.mk [deleted file]
app/src/main/jni/Application.mk [deleted file]
app/src/main/jni/dbmd4_test_jni.cpp [deleted file]
app/src/main/jni/heartrate.cpp [deleted file]
build.gradle
factorymode.iml
gradle/wrapper/gradle-wrapper.properties
watchlibrary/watchlibrary.iml

index 084e71d..11fdce8 100644 (file)
@@ -87,9 +87,8 @@ android {
 }\r
 \r
 dependencies {\r
-//    implementation 'com.android.support:support-v4:20.0.0'\r
-   // compileOnly files('libs/framework.jar')\r
-    compileOnly files('libs/framework.jar')\r
+    compileOnly files ('libs/frameworks-full-debug.jar')\r
+    provided files ('libs/telephony_common-full-debug.jar')\r
     implementation 'com.squareup.okhttp3:okhttp:3.4.1'\r
     implementation 'io.reactivex:rxandroid:1.2.1'\r
     implementation 'com.liulishuo.filedownloader:library:1.6.3'\r
diff --git a/app/libs/frameworks-full-debug.jar b/app/libs/frameworks-full-debug.jar
new file mode 100644 (file)
index 0000000..8b3dde7
Binary files /dev/null and b/app/libs/frameworks-full-debug.jar differ
diff --git a/app/libs/telephony_common-full-debug.jar b/app/libs/telephony_common-full-debug.jar
new file mode 100644 (file)
index 0000000..e6a112c
Binary files /dev/null and b/app/libs/telephony_common-full-debug.jar differ
index 0a01d0c..cb1f75c 100644 (file)
@@ -30,8 +30,7 @@ import mobile.miki.mainui.TestMainActivity;
 import mobile.miki.mainui.TestMainList;\r
 import mobile.miki.util.Config;\r
 import mobile.miki.util.Logger;\r
-import rx.Observable;\r
-import rx.functions.Action1;\r
+\r
 \r
 import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP;\r
 import static android.os.PowerManager.SCREEN_DIM_WAKE_LOCK;\r
@@ -143,7 +142,7 @@ public class TemperatureAdjustActivity extends Activity implements View.OnClickL
             String tail = "秒。。。";\r
             long time_cost = (System.currentTimeMillis() - timestamp_start) / 1000;\r
             adjust_start_seconds_left = (adjust_timeout_time - time_cost);\r
-            if (adjust_start_seconds_left == 0) {\r
+            if (adjust_start_seconds_left <= 0) {\r
 \r
                 int ret= ICJniUtils.doTempCalibration(37.0f);\r
                 tv_mesg.setText("体温校准完毕,偏差数据"+String.format("%1$.2f",(avg_temp-37.0f))+"摄氏度!ret "+ret);\r
diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk
deleted file mode 100644 (file)
index 6edf3e1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := dbmd4_test_jni.cpp
-LOCAL_CERTIFICATE := platform
-
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-LOCAL_SHARED_LIBRARIES := liblog libandroid_runtime libtinyalsa libcutils
-LOCAL_PRELINK_MODULE := false
-
-LOCAL_MODULE := libdbmd4_test_jni
-include $(BUILD_SHARED_LIBRARY)
-
diff --git a/app/src/main/jni/Application.mk b/app/src/main/jni/Application.mk
deleted file mode 100644 (file)
index 1678532..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#APP_ABI := armeabi armeabi-v7a arm64-v8a\r
-#APP_ABI := armeabi arm64-v8a\r
-APP_ABI := armeabi armeabi-v7a arm64-v8a
\ No newline at end of file
diff --git a/app/src/main/jni/dbmd4_test_jni.cpp b/app/src/main/jni/dbmd4_test_jni.cpp
deleted file mode 100644 (file)
index 331c60d..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-#include <tinyalsa/asoundlib.h>
-#include <signal.h>
-#include <stdio.h>
-#include <utils/Log.h>
-#include <jni.h>
-#include <android_runtime/AndroidRuntime.h>
-#include <android_runtime/android_app_NativeActivity.h>
-
-using namespace android;
-
-static const char *classPathName = "mobile/miki/DSPActivity";
-
-static jint dbmd4_open(JNIEnv *env, jobject thiz,jint card ,jint device,jint channels,jint bits,jint rate){
-       
-       struct pcm_config config;
-       enum pcm_format format;
-       struct pcm *pcm = NULL;
-       
-       ALOGE("dbmd4_open card=%d device=%d channels=%d bits=%d rate=%d\n",card,device,channels,bits,rate);
-       memset(&config,0,sizeof(config));
-    switch (bits) {
-    case 32:
-        format = PCM_FORMAT_S32_LE;
-        break;
-    case 24:
-        format = PCM_FORMAT_S24_LE;
-        break;
-    case 16:
-        format = PCM_FORMAT_S16_LE;
-        break;
-    default:
-        ALOGE("%d bits is not supported.\n", bits);
-        return 0;
-    }
-
-    config.channels = channels;//2
-       config.format = format;//16
-    config.rate = rate;//16000
-    config.period_size = 1024;//default
-    config.period_count = 4; //default
-    config.start_threshold = 0;
-    config.stop_threshold = 0;
-    config.silence_threshold = 0;
-       
-    pcm = pcm_open(card, device, PCM_IN, &config);
-    if (!pcm || !pcm_is_ready(pcm)) {
-        ALOGE("Unable to open PCM device\n");
-        return 0;
-    }
-       
-       return (int)pcm;
-}
-
-static jint dbmd4_get_buffersize(JNIEnv *env, jobject thiz,jint dbmd4_handle){
-       int buffersize;
-       struct pcm *pcm = (struct pcm *)dbmd4_handle;
-       
-       buffersize = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm));
-       ALOGE("dbmd4_get_buffersize buffersize=%d\n",buffersize);
-       return buffersize;
-}
-
-static jint dbmd4_read_buffer(JNIEnv *env, jobject thiz,jint dbmd4_handle,jbyteArray buffer, jint length){
-       
-       int ret;
-       struct pcm *pcm = (struct pcm *)dbmd4_handle;
-       jbyte* buf = (jbyte *)malloc(length);
-       ALOGE("dbmd4_read_buffer buffer length=%d\n",length);
-       if(!buf){
-               ALOGE("dbmd4_read_buffer alloc buf failed\n");
-               return 0;
-       }
-       memset(buf,0,length);
-       ret = pcm_read(pcm, buf, length);
-       if(!ret){
-               ALOGE("dbmd4_read_buffer read pcm data failed\n");
-               free(buf);
-               return 0;
-       }
-       env->SetByteArrayRegion(buffer, 0, length, buf);
-       free(buf);
-       return length;
-
-}
-
-static void dbmd4_close(JNIEnv *env, jobject thiz,jint dbmd4_handle){
-       ALOGE("dbmd4_close\n");
-       pcm_close((struct pcm *)dbmd4_handle);
-}
-
-static JNINativeMethod methods[] =
-{
-    {"dbmd4_open",  "(IIIII)I", (void*)dbmd4_open },
-    {"dbmd4_get_buffersize", "(I)I", (void*)dbmd4_get_buffersize},    
-    {"dbmd4_read_buffer", "(I[BI)I", (void*)dbmd4_read_buffer },
-    {"dbmd4_close", "(I)V", (void*)dbmd4_close },
-    
-};
-
-/*
- * Register several native methods for one class.
- */
-static int registerNativeMethods(JNIEnv* env, const char* className,
-                                 JNINativeMethod* gMethods, int numMethods)
-{
-    jclass clazz;
-
-    clazz = env->FindClass(className);
-    if (clazz == NULL)
-    {
-        //LOGE("Native registration unable to find class '%s'", className);
-        return JNI_FALSE;
-    }
-    if (env->RegisterNatives(clazz, gMethods, numMethods) < 0)
-    {
-        //LOGE("RegisterNatives failed for '%s'", className);
-        return JNI_FALSE;
-    }
-
-    return JNI_TRUE;
-}
-
-/*
- * Register native methods for all classes we know about.
- *
- * returns JNI_TRUE on success.
- */
-static int registerNatives(JNIEnv* env)
-{
-    if (!registerNativeMethods(env, classPathName,
-                               methods, sizeof(methods) / sizeof(methods[0])))
-    {
-        return JNI_FALSE;
-    }
-
-    return JNI_TRUE;
-}
-
-
-// ----------------------------------------------------------------------------
-
-/*
- * This is called by the VM when the shared library is first loaded.
- */
-
-typedef union
-{
-    JNIEnv* env;
-    void* venv;
-} UnionJNIEnvToVoid;
-
-jint JNI_OnLoad(JavaVM* vm, void* reserved)
-{
-    UnionJNIEnvToVoid uenv;
-    uenv.venv = NULL;
-    jint result = -1;
-    JNIEnv* env = NULL;
-
-    //LOGI("JNI_OnLoad");
-
-    if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK)
-    {
-        //LOGE("ERROR: GetEnv failed");
-        goto bail;
-    }
-    env = uenv.env;
-
-    if (registerNatives(env) != JNI_TRUE)
-    {
-        //LOGE("ERROR: registerNatives failed");
-        goto bail;
-    }
-
-    result = JNI_VERSION_1_4;
-
-bail:
-    return result;
-}
-
-
diff --git a/app/src/main/jni/heartrate.cpp b/app/src/main/jni/heartrate.cpp
deleted file mode 100644 (file)
index 7f8e2a0..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-\r
-\r
-#include <signal.h>\r
-#include <stdio.h>\r
-#include <utils/Log.h>\r
-#include <jni.h>\r
-#include <android_runtime/AndroidRuntime.h>\r
-#include <android_runtime/android_app_NativeActivity.h>\r
-#include <linux/ioctl.h>\r
-#include <stdlib.h>\r
-#include <fcntl.h>\r
-\r
-using namespace android;\r
-\r
-#define HEARTRATE_DEVICE_NAME         "/sys/class/input/input2/heartrate"//"/dev/heartrate"\r
-\r
-\r
-#define DEV_LOG_TAG "heartrate"\r
-#define  LOGW(...)  __android_log_print(ANDROID_LOG_WARN,DEV_LOG_TAG,__VA_ARGS__)\r
-\r
-#define HRS3300_IOCTL_BASE                             87 //0x1D\r
-#define HRS3300_IOCTL_GET_HEART_VALUE          _IO(HRS3300_IOCTL_BASE,5)\r
-\r
-static const char *classPathName = "mobile/miki/HeartRate";\r
-\r
-\r
-static jint get_heartrate(JNIEnv *env, jobject thiz)\r
-{\r
-    int fd = -1;\r
-    int ret = -1;\r
-    int heartrate = -1;\r
-\r
-    LOGW("[open_heartrate].");\r
-    fd = open(HEARTRATE_DEVICE_NAME, O_RDONLY);\r
-    if(fd < 0) \r
-    {\r
-        LOGW("Failed to open device: heart rate.");\r
-        return -1;\r
-    }\r
-    \r
-/*    if (ioctl(fd, HRS3300_IOCTL_GET_HEART_VALUE,&heartrate) < 0)\r
-    {\r
-        LOGW("get  heartrate failed.");\r
-    } else {\r
-        LOGW("get  heartrate successed.");     \r
-    }*/\r
-    close(fd);\r
-               return 80;\r
-    return heartrate;\r
-               \r
-}\r
-\r
-\r
-\r
-static JNINativeMethod methods[] =\r
-{\r
-    {"get_heartrate",  "()I", (void*)get_heartrate },\r
-    \r
-};\r
-/*\r
- * Register several native methods for one class.\r
- */\r
-static int registerNativeMethods(JNIEnv* env, const char* className,\r
-                                 JNINativeMethod* gMethods, int numMethods)\r
-{\r
-    jclass clazz;\r
-\r
-    clazz = env->FindClass(className);\r
-    if (clazz == NULL)\r
-    {\r
-        //LOGE("Native registration unable to find class '%s'", className);\r
-        return JNI_FALSE;\r
-    }\r
-    if (env->RegisterNatives(clazz, gMethods, numMethods) < 0)\r
-    {\r
-        //LOGE("RegisterNatives failed for '%s'", className);\r
-        return JNI_FALSE;\r
-    }\r
-\r
-    return JNI_TRUE;\r
-}\r
-\r
-/*\r
- * Register native methods for all classes we know about.\r
- *\r
- * returns JNI_TRUE on success.\r
- */\r
-static int registerNatives(JNIEnv* env)\r
-{\r
-    if (!registerNativeMethods(env, classPathName,\r
-                               methods, sizeof(methods) / sizeof(methods[0])))\r
-    {\r
-        return JNI_FALSE;\r
-    }\r
-\r
-    return JNI_TRUE;\r
-}\r
-\r
-\r
-// ----------------------------------------------------------------------------\r
-\r
-/*\r
- * This is called by the VM when the shared library is first loaded.\r
- */\r
-\r
-typedef union\r
-{\r
-    JNIEnv* env;\r
-    void* venv;\r
-} UnionJNIEnvToVoid;\r
-\r
-jint JNI_OnLoad(JavaVM* vm, void* reserved)\r
-{\r
-    UnionJNIEnvToVoid uenv;\r
-    uenv.venv = NULL;\r
-    jint result = -1;\r
-    JNIEnv* env = NULL;\r
-\r
-    //LOGI("JNI_OnLoad");\r
-\r
-    if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK)\r
-    {\r
-        //LOGE("ERROR: GetEnv failed");\r
-        goto bail;\r
-    }\r
-    env = uenv.env;\r
-\r
-    if (registerNatives(env) != JNI_TRUE)\r
-    {\r
-        //LOGE("ERROR: registerNatives failed");\r
-        goto bail;\r
-    }\r
-\r
-    result = JNI_VERSION_1_4;\r
-\r
-bail:\r
-    return result;\r
-}\r
-\r
-\r
index 232f30a..35c4663 100644 (file)
@@ -1,24 +1,39 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.\r
+\r
 buildscript {\r
     repositories {\r
         jcenter()\r
+        maven {\r
+            url 'https://maven.google.com/'\r
+            name 'Google'\r
+        }\r
         google()\r
     }\r
     dependencies {\r
-        classpath 'com.android.tools.build:gradle:3.1.3'\r
+        classpath 'com.android.tools.build:gradle:3.5.3'\r
+        classpath 'me.tatarka:gradle-retrolambda:3.2.3'\r
+\r
+        // NOTE: Do not place your application dependencies here; they belong\r
+        // in the individual module build.gradle files\r
     }\r
 }\r
 \r
 allprojects {\r
     repositories {\r
         jcenter()\r
-        google()\r
+        maven { url 'https://jitpack.io' }\r
+        maven {\r
+            url 'https://maven.google.com/'\r
+            name 'Google'\r
+        }\r
     }\r
-\r
     gradle.projectsEvaluated {\r
         tasks.withType(JavaCompile) {\r
-            options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\framework.jar')\r
+            options.compilerArgs.add('-Xbootclasspath/p:app\\libs\\frameworks-full-debug.jar')\r
         }\r
     }\r
+}\r
 \r
+task clean(type: Delete) {\r
+    delete rootProject.buildDir\r
 }\r
index 6bbc01d..e438926 100644 (file)
@@ -13,7 +13,7 @@
     <content url="file://$MODULE_DIR$">\r
       <excludeFolder url="file://$MODULE_DIR$/.gradle" />\r
     </content>\r
-    <orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />\r
+    <orderEntry type="inheritedJdk" />\r
     <orderEntry type="sourceFolder" forTests="false" />\r
   </component>\r
 </module>
\ No newline at end of file
index efc27cb..cc8c069 100644 (file)
@@ -1,6 +1,6 @@
-#Sat Jan 13 09:12:34 PST 2018
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
+#Sun Aug 16 22:50:44 CST 2020\r
+distributionBase=GRADLE_USER_HOME\r
+distributionPath=wrapper/dists\r
+zipStoreBase=GRADLE_USER_HOME\r
+zipStorePath=wrapper/dists\r
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip\r
index 36172a0..ff1a55f 100644 (file)
@@ -7,21 +7,13 @@
         <option name="BUILDABLE" value="false" />\r
       </configuration>\r
     </facet>\r
-    <facet type="android-gradle" name="Android-Gradle">\r
-      <configuration>\r
-        <option name="GRADLE_PROJECT_PATH" value=":watchlibrary" />\r
-        <option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" />\r
-        <option name="LAST_KNOWN_AGP_VERSION" />\r
-      </configuration>\r
-    </facet>\r
   </component>\r
   <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">\r
     <exclude-output />\r
     <content url="file://$MODULE_DIR$">\r
       <excludeFolder url="file://$MODULE_DIR$/.gradle" />\r
-      <excludeFolder url="file://$MODULE_DIR$/build" />\r
     </content>\r
-    <orderEntry type="jdk" jdkName="JDK" jdkType="JavaSDK" />\r
+    <orderEntry type="inheritedJdk" />\r
     <orderEntry type="sourceFolder" forTests="false" />\r
   </component>\r
 </module>
\ No newline at end of file