From: snickersun Date: Tue, 11 Aug 2020 17:06:08 +0000 (+0800) Subject: release V38 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=b3c04041b5b34802df55bc85974af2e6434c66cd;p=factoryMode.git release V38 A9项目 1、添加A9项目的检测,通过customname 判断H88、Q3F和A9-YQ 2、修正IC66心率检测界面出错问题 3、适配A9项目窗口大小,以便能让用户直接进行操作。 --- diff --git a/app/release/FactoryMode_V38_202008112317_release.apk b/app/release/FactoryMode_V38_202008112317_release.apk new file mode 100644 index 0000000..a81f202 Binary files /dev/null and b/app/release/FactoryMode_V38_202008112317_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 30e78aa..f668de2 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":37,"versionName":"202008101956","enabled":true,"outputFile":"FactoryMode_V37_202008101956_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V37_202008101956_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":38,"versionName":"202008112317","enabled":true,"outputFile":"FactoryMode_V38_202008112317_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V38_202008112317_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/mobile/miki/BaseActivity.java b/app/src/main/java/mobile/miki/BaseActivity.java index fc3b1a4..7bf0502 100644 --- a/app/src/main/java/mobile/miki/BaseActivity.java +++ b/app/src/main/java/mobile/miki/BaseActivity.java @@ -10,8 +10,12 @@ import android.os.Bundle; import android.os.Handler; import android.os.PowerManager; import android.os.PowerManager.WakeLock; +import android.os.SystemProperties; import android.util.Log; +import android.view.Display; import android.view.View; +import android.view.ViewGroup; +import android.view.Window; public class BaseActivity extends Activity { private static final String TAG = "BaseActivity"; @@ -32,7 +36,18 @@ public class BaseActivity extends Activity { handler.postDelayed(runnable, 1000 * 60 * 30); //30分钟不灭屏 } - + resizewindow(); + } + + private void resizewindow(){ + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ")) { + Display display = getWindowManager().getDefaultDisplay(); // 为获取屏幕宽、高 + Window window = getWindow(); + ViewGroup.LayoutParams windowLayoutParams = window.getAttributes(); // 获取对话框当前的参数值 + windowLayoutParams.width = 170;//(int) (display.getWidth() * 0.7); // 宽度设置为屏幕的0.95 + windowLayoutParams.height = 170;//(int) (display.getHeight() * 0.6); // 高度设置为屏幕的0.6 + } } @Override diff --git a/app/src/main/java/mobile/miki/HeartRate.java b/app/src/main/java/mobile/miki/HeartRate.java index e045f88..0a68c15 100644 --- a/app/src/main/java/mobile/miki/HeartRate.java +++ b/app/src/main/java/mobile/miki/HeartRate.java @@ -44,7 +44,7 @@ public class HeartRate extends BaseActivity implements View.OnClickListener, Sen super.onCreate(savedInstanceState); setContentView(R.layout.heartrate_layout); initView(); - int hrsType = ICJniUtils.isPPGavailable(); + hrsType = ICJniUtils.isPPGavailable(); Log.i("dxc", "heartrate available : " + hrsType); if (hrsType == ICJniUtils.PPG_EGC_SensorType.PPG_EGC_TYPE_IC66.ordinal()) { @@ -69,25 +69,46 @@ public class HeartRate extends BaseActivity implements View.OnClickListener, Sen @Override public boolean handleMessage(Message message) { - if(ICJniUtils.isPPGavailable()>0) { - if (ICJniUtils.isPPGStarted()==0){ - ICJniUtils.enablePPG(); + switch(message.what) + { + case 0: + if(ICJniUtils.isPPGavailable()>0) { + if (ICJniUtils.isPPGStarted()==0){ + ICJniUtils.enablePPG(); + + } + int ppg = ICJniUtils.getPPG(); + int weared = ICJniUtils.isWeared(); + + String wearedstr = String.valueOf(weared); + String ppgstr = String.valueOf(ppg); + + tv_isweared.setText(" "+wearedstr); + tv_ppg.setText(" "+ppgstr); + + Log.d("dxc","Weared:" + wearedstr + " PPG:" + ppgstr ); + }else{ + tv_isweared.setText(" "+HeartRate.this.getResources().getString(R.string.no_heartrate)); + tv_ppg.setText(""); + } + break; + case 1: + Bundle bdl=message.getData(); + String weared=bdl.getString("isweared"); + String ppg=bdl.getString("PPG"); + if (!weared.trim().isEmpty() && !ppg.trim().isEmpty()) + { + tv_isweared.setText(" "+weared); + tv_ppg.setText(" "+ppg); + }else{ + tv_isweared.setText(" "+HeartRate.this.getResources().getString(R.string.no_heartrate)); + tv_ppg.setText(""); + } + + break; - } - int ppg = ICJniUtils.getPPG(); - int weared = ICJniUtils.isWeared(); - - String wearedstr = String.valueOf(weared); - String ppgstr = String.valueOf(ppg); - - tv_isweared.setText(wearedstr); - tv_ppg.setText(ppgstr); - - Log.d("dxc","Weared:" + wearedstr + " PPG:" + ppgstr ); - }else{ - tv_isweared.setText(HeartRate.this.getResources().getString(R.string.no_heartrate)); - tv_ppg.setText(""); } + return false; } }); @@ -162,10 +183,17 @@ public class HeartRate extends BaseActivity implements View.OnClickListener, Sen +" , Weared = "+values[4] ); - int PPG = (int)values[0];//调用底层函数保证状态更新。 - boolean isWared = ((int)values[4] == 2); - tv_isweared.setText(isWared?1:0); - tv_ppg.setText(PPG); + Message msg=new Message(); + Bundle bdl=new Bundle(); + msg.what=1; + bdl.putString("isweared", ((int)values[4] == 2)?"1":"0"); + bdl.putString("PPG",String.valueOf(values[0])); + msg.setData(bdl); + mhandler.sendMessage(msg); + // int PPG = (int)values[0];//调用底层函数保证状态更新。 + // boolean isWared = ((int)values[4] == 2); + // tv_isweared.setText(isWared?1:0); + // tv_ppg.setText(PPG); /*[0]---心率;[1]---血压高压;[2]---血压低压;[3]---血氧;[4]---佩戴检测(1--脱手,2--上手);*/ } diff --git a/app/src/main/java/mobile/miki/util/Config.java b/app/src/main/java/mobile/miki/util/Config.java index 998d415..63ec037 100644 --- a/app/src/main/java/mobile/miki/util/Config.java +++ b/app/src/main/java/mobile/miki/util/Config.java @@ -272,15 +272,8 @@ public class Config { testResultList.add("bt"); testResultList.add("dsp"); testResultList.add("heartrate"); - } else if (FTUtils.isQ3F()){ - list.add(context.getString(R.string.test_keypad)); - list.add(context.getString(R.string.shakeTest)); - list.add(context.getString(R.string.heartrate)); - testResultList.add("keys"); - testResultList.add("vibrator"); - testResultList.add("heartrate"); - } else if (FTUtils.isH88()){ + } else if (FTUtils.hasHRS_TEMP()){ //list.add(context.getString(R.string.test_keypad)); list.add(context.getString(R.string.heartrate)); @@ -290,6 +283,14 @@ public class Config { testResultList.add("heartrate"); testResultList.add("temperature"); testResultList.remove("camera"); + } else if (FTUtils.isQ3F()){ + + list.add(context.getString(R.string.test_keypad)); + list.add(context.getString(R.string.shakeTest)); + list.add(context.getString(R.string.heartrate)); + testResultList.add("keys"); + testResultList.add("vibrator"); + testResultList.add("heartrate"); } stateArr = new String[testResultList.size()]; return list; diff --git a/app/src/main/java/mobile/miki/util/FTUtils.java b/app/src/main/java/mobile/miki/util/FTUtils.java index 416c9d4..b89afb2 100644 --- a/app/src/main/java/mobile/miki/util/FTUtils.java +++ b/app/src/main/java/mobile/miki/util/FTUtils.java @@ -205,9 +205,14 @@ public class FTUtils { } return false; } - public static boolean isH88(){ - - if (getMODEL().contains("H88")||SystemProperties.get("ro.product.isH88","").equalsIgnoreCase("true") || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("H88") ) { + public static boolean hasHRS_TEMP(){ + + if (getMODEL().contains("H88") + ||SystemProperties.get("ro.product.isH88","").equalsIgnoreCase("true") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("H88") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ") + ) { return true; } return false; diff --git a/app/version_code.properties b/app/version_code.properties index e534dad..bed6355 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Mon Aug 10 19:56:33 CST 2020 -VERSION_CODE=37 +#Tue Aug 11 23:17:08 CST 2020 +VERSION_CODE=38