}\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
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
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
+++ /dev/null
-# 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)
-
+++ /dev/null
-#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
+++ /dev/null
-
-
-#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;
-}
-
-
+++ /dev/null
-\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
// 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
<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
-#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
<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