versionCode currentVersionCode
versionName "${currentVersionName}"
multiDexEnabled true
-
// buildConfigField "boolean", "DEBUG_MODE", "true" // 调试版本
buildConfigField "boolean", "DEBUG_MODE", "false"
// 正式版本
-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
}
lintOptions {
checkReleaseBuilds false
// }
}
dependencies {
- compileOnly files ('libs/telephony-common-full-debug.jar')
- compileOnly files ('libs/frameworks-full-debug.jar')
- compileOnly files ('libs/frameworks-2-full-debug.jar')
+ compileOnly files('libs/telephony-common-full-debug.jar')
+ compileOnly files('libs/frameworks-full-debug.jar')
+ compileOnly files('libs/frameworks-2-full-debug.jar')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
implementation 'com.github.ChestnutPlus:TestModules:v1.0.16'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:recyclerview-v7:25.1.0'
- implementation files ('libs/android-logging-log4j-1.0.3.jar','libs/ftp4j-1.7.2.jar','libs/log4j-1.2.17.jar','libs/okio-2.4.3.jar' )
- implementation files ('libs/mail.jar' )
- implementation files ('libs/activation.jar','libs/additionnal.jar' )
+ implementation files('libs/android-logging-log4j-1.0.3.jar', 'libs/ftp4j-1.7.2.jar', 'libs/log4j-1.2.17.jar', 'libs/okio-2.4.3.jar')
+ implementation files('libs/mail.jar')
+ implementation files('libs/activation.jar', 'libs/additionnal.jar')
implementation project(path: ':dNSCache')
implementation project(path: ':core')
return new Date().format("yyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
}
+
preBuild {
doLast {
- def imlFile = file( project.name + ".iml")
+ def imlFile = file(project.name + ".iml")
println 'Change ' + project.name + '.iml order'
try {
def parsedXml = (new XmlParser()).parse(imlFile)
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":773,"versionName":"2104021759","enabled":true,"outputFile":"ICSer_V773_2104021759_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V773_2104021759_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":776,"versionName":"2104151936","enabled":true,"outputFile":"ICSer_V776_2104151936_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V776_2104151936_release.apk","properties":{}}]
\ No newline at end of file
--- /dev/null
+
+package com.ic.fzd.weather;
+
+parcelable FZDWeatherInfo;
\ No newline at end of file
--- /dev/null
+
+package com.ic.fzd.weather;
+
+interface IFZDWeatherCallback {
+ void onWeatherInfoLoaded();
+}
\ No newline at end of file
--- /dev/null
+
+package com.ic.fzd.weather;
+
+interface IFZDWeatherService {
+ void registerCallback();
+ void unRegisterCallback();
+ void loadWeahterInfo();
+}
\ No newline at end of file
public static boolean isUsingCustomServer = false;
- public static void setCustomServer(Context context, boolean isusingCutomerServer, String serverip, int serverport) {
+ public static void setCustomServer(Context context,
+ boolean isusingCutomerServer,
+ String serverip,
+ int serverport) {
- if (isusingCutomerServer)
+ if (isusingCutomerServer) {
Util.setSystemProperties("persist.sys.UsingCustomServer", "true");
- else
+ } else {
Util.setSystemProperties("persist.sys.UsingCustomServer", "false");
-
+ }
Util.setSystemProperties("persist.sys.customserverip", serverip);
Util.setSystemProperties("persist.sys.customserverport", String.valueOf(serverport));
setProtocolServerHost(context, serverip);
setProtocolServerPort(context, serverport);
-
loadCustomServerAddr(context);
}
if (tmp.equals("true")) {
ret = true;
}
-
- //isUsingCustomServer = ret;
- isUsingCustomServer = false;
-
+ isUsingCustomServer = ret;
String serverip = "";
int serverport = 0;
if (isUsingCustomServer) {
public interface MemberType {
+ //可以微聊,打电话
int FRIEND = 1;
+ //Members联系人,可以视频/语音聊天/拨打电话,可以微聊
int CONTACT = 2;
+ //白名单,可以拨打电话
+ int WHITE_LIST = 3;
+ //sos通讯录
+ int SOS = 4;
}
public interface MessageType {
String current_sys_status;
if (cursor != null) {
//获取silent免打扰状态 ON/OFF
- for (current_sys_status = null; cursor.moveToNext(); current_sys_status = cursor.getString(5)) {
+ for (current_sys_status = null; cursor.moveToNext();
+ current_sys_status = cursor.getString(5)) {
}
cursor.close();
contentValues.put("WEEK", silent.week);
contentValues.put("STATUS", silent.status);
contentValues.put("CUR_SYS_STATUS", current_sys_status);
- ICLogger.i("add silience " + silent.start + "-" + silent.end + " " + silent.week + " " + silent.status + " " + current_sys_status);
-
+ ICLogger.i("add silience " + silent.start + "-" + silent.end
+ + " " + silent.week + " "
+ + silent.status + " " + current_sys_status);
}
this.cr.bulkInsert(ICContentProvider.SILENT_URI, contentValueslist);
public class ProfileManager {
- //只声音,无振动
+ //只声音,无振动(可用)
public static void ringModel(AudioManager audio) {
audio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
AudioManager.VIBRATE_SETTING_OFF);
}
- //即有声音也有振动
+ //即有声音也有振动(可用)
public static void ringAndVibrate(AudioManager audio) {
audio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
AudioManager.VIBRATE_SETTING_ON);
}
- //只能振动
+ //只能振动(可用)
public static void vibrate(AudioManager audio) {
audio.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER,
public static String getSystemProperties(String prop) {
String str = "";
- Class clazz = null;
+ Class clazz;
try {
clazz = Class.forName("android.os.SystemProperties");
Method get = clazz.getMethod("get", new Class[]{String.class});
--- /dev/null
+package com.ic.fzd.weather;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * 数据有:
+ * 时间,天气描述,天气编号,当前温度,最低温度,最高温度,城市名称,风向,风多少级
+ */
+public class FZDWeatherInfo implements Parcelable {
+ private String weatherText;
+ //0表示晴,1表示阴,2表示雨,3表示雪
+ private int code;
+ //当前温度
+ private int currentTempe;
+ //
+ private int lowTemp;
+ //
+ private int highTemp;
+ //城市名称
+ private String cityName;
+ //风向
+ private String windDirection;
+ //风多少级
+ private String windLev;
+ //时间
+ private String dateTime;
+
+ public String getWeatherText() {
+ return weatherText;
+ }
+
+ public void setWeatherText(String weatherText) {
+ this.weatherText = weatherText;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public void setCode(int code) {
+ this.code = code;
+ }
+
+ public int getCurrentTempe() {
+ return currentTempe;
+ }
+
+ public void setCurrentTempe(int currentTempe) {
+ this.currentTempe = currentTempe;
+ }
+
+ public int getLowTemp() {
+ return lowTemp;
+ }
+
+ public void setLowTemp(int lowTemp) {
+ this.lowTemp = lowTemp;
+ }
+
+ public int getHighTemp() {
+ return highTemp;
+ }
+
+ public void setHighTemp(int highTemp) {
+ this.highTemp = highTemp;
+ }
+
+ public String getCityName() {
+ return cityName;
+ }
+
+ public void setCityName(String cityName) {
+ this.cityName = cityName;
+ }
+
+ public String getWindDirection() {
+ return windDirection;
+ }
+
+ public void setWindDirection(String windDirection) {
+ this.windDirection = windDirection;
+ }
+
+ public String getWindLev() {
+ return windLev;
+ }
+
+ public void setWindLev(String windLev) {
+ this.windLev = windLev;
+ }
+
+ public String getDateTime() {
+ return dateTime;
+ }
+
+ public void setDateTime(String dateTime) {
+ this.dateTime = dateTime;
+ }
+
+ public static Creator<FZDWeatherInfo> getCREATOR() {
+ return CREATOR;
+ }
+
+ protected FZDWeatherInfo(Parcel in) {
+ weatherText = in.readString();
+ code = in.readInt();
+ currentTempe = in.readInt();
+ lowTemp = in.readInt();
+ highTemp = in.readInt();
+ cityName = in.readString();
+ windDirection = in.readString();
+ windLev = in.readString();
+ dateTime = in.readString();
+ }
+
+ public static final Creator<FZDWeatherInfo> CREATOR = new Creator<FZDWeatherInfo>() {
+ @Override
+ public FZDWeatherInfo createFromParcel(Parcel in) {
+ return new FZDWeatherInfo(in);
+ }
+
+ @Override
+ public FZDWeatherInfo[] newArray(int size) {
+ return new FZDWeatherInfo[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(weatherText);
+ dest.writeInt(code);
+ dest.writeInt(currentTempe);
+ dest.writeInt(lowTemp);
+ dest.writeInt(highTemp);
+ dest.writeString(cityName);
+ dest.writeString(windDirection);
+ dest.writeString(windLev);
+ dest.writeString(dateTime);
+ }
+}
ret = protocol_mqtt.defaultServerIP;
break;
}
+ ICLogger.d("ip ==> " + ret);
return ret;
}
return ret;
}
- public static StringMessage genMissedUD2Msg(StringMessage msg){
+ public static StringMessage genMissedUD2Msg(StringMessage msg) {
if (is_protocol_not_Initialled()) return null;
StringMessage ret = null;
switch (Config.protocol_no) {
private static final String CMDHEADERSPLIT = "*";
private static final String CMDSPLIT = ",";
private static final boolean doEncryption = Util.getSystemProperties("persist.sys.encrypt_fzd", "true").equals("true");
- public static final String defaultServerIP = "api.xcloudtech.com";
+ public static final String defaultServerIP = "fzd.xcloudtech.com";
public static final int defaultServerPort = 9000;
private final SharedPreferences sharedPreferences;
private final Handler mHandler;
return genFZDCMD(cmd, sb.toString());
}
-
- public void handleKA(Runtime runtime, String data) {
-
- }
-
- public void handleCENTER(String cmd, String data, Runtime mRuntime) {
+ public void handleCENTER(CMD_TYPE cmd, String data, Runtime mRuntime) {
//把中心号码插入到手中机
ICLogger.d("phoneNum == > " + data);
ContentValues contentValues = new ContentValues();
- contentValues.put(FZDDatabaseHelper.sKey, cmd);
+ contentValues.put(FZDDatabaseHelper.sKey, cmdMap.get(cmd));
contentValues.put(FZDDatabaseHelper.sValue, data);
mRuntime.getContextProxy().getResolver().insert(
Uri.parse(FZDSettingsProvider.SETTINGS),
connection.send(wdstart());
try {
int freq = Integer.parseInt(data);
+ ICLogger.d("freq == > " + freq);
Config.setTemperatureTestCycle(runtime, freq);
CoreService.getInstance().setTempAlarm(true);
} catch (Exception e) {
public void handleSOS(Connection connection, Runtime runtime, String cmd, String data) {
-
connection.send(SOS());
+ //TODO:保存到fzd的联系人里,类型为SOS
if (data != null && data.length() > 0) {
- String list[] = data.split(CMDSPLIT);
+ String[] list = data.split(CMDSPLIT);
+ ArrayList<Contact> contactArray = new ArrayList<Contact>();
+ ContentValues contentValues = new ContentValues();
+ contentValues.put(FZDDatabaseHelper.fType, FZDDatabaseHelper.MemberType.SOS);
if (list.length == 1) {
- ArrayList<Contact> contactArray = new ArrayList<Contact>();
if (regexUtil.isMobileNumber(list[0]) || regexUtil.isPhoneNumber(list[0])) {
contactArray.add(new Contact(Contact.CATEGORY_SOS, "sos1", list[0]));
ICLogger.i("find SOS1 number " + list[0]);
+ contentValues.put(FZDDatabaseHelper.fUserName, "sos1");
+ contentValues.put(FZDDatabaseHelper.fPhoneNum, list[0]);
}
} else if (list.length == 2) {
- ArrayList<Contact> contactArray = new ArrayList<Contact>();
if (regexUtil.isMobileNumber(list[0]) || regexUtil.isPhoneNumber(list[0])) {
contactArray.add(new Contact(Contact.CATEGORY_SOS, "sos1", list[0]));
ICLogger.i("find SOS1 number " + list[0]);
+ contentValues.put(FZDDatabaseHelper.fUserName, "sos1");
+ contentValues.put(FZDDatabaseHelper.fPhoneNum, list[0]);
}
if (regexUtil.isMobileNumber(list[1]) || regexUtil.isPhoneNumber(list[1])) {
contactArray.add(new Contact(Contact.CATEGORY_SOS, "sos2", list[1]));
ICLogger.i("find SOS2 number " + list[1]);
+ contentValues.put(FZDDatabaseHelper.fUserName, "sos2");
+ contentValues.put(FZDDatabaseHelper.fPhoneNum, list[1]);
}
- runtime.getDbHelper().saveContacts(contactArray, false, false, false, false, false, true);
-
}
+ runtime.getDbHelper().saveContacts(contactArray, false, false, false, false, false, true);
+ runtime.getContextProxy().getResolver().insert(Uri.parse(FZDMembersProvider.MEMBERS), contentValues);
}
*/
public void handlePHL(Connection connection, Runtime runtime, String cmd, String data) {
String list[] = data.split(CMDSPLIT);
- int listlen = list.length;
- boolean ispared = ((listlen >= 0) && (listlen % 2 == 0));
- if (ispared) {
+ int listLen = list.length;
+ boolean isPared = ((listLen >= 0) && (listLen % 2 == 0));
+ if (isPared) {
ArrayList<Contact> contactArray = new ArrayList<Contact>();
- for (int i = 0; i < listlen; i += 2) {
- String phonem = list[i];
+ ContentValues contentValues = new ContentValues();
+ for (int i = 0; i < listLen; i += 2) {
+ String phoneNum = list[i];
String name = Util.decodeUnicode2Utf8(list[i + 1]);
- ICLogger.i(i / 2 + " 姓名 " + name + ", 电话 " + phonem);
- contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phonem));
+ ICLogger.i(i / 2 + " 姓名 " + name + ", 电话 " + phoneNum);
+ contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phoneNum));
+ contentValues.put(FZDDatabaseHelper.fType, FZDDatabaseHelper.MemberType.WHITE_LIST);
+ contentValues.put(FZDDatabaseHelper.fPhoneNum, phoneNum);
+ contentValues.put(FZDDatabaseHelper.fID, phoneNum);
+ contentValues.put(FZDDatabaseHelper.fUserName, name);
+ contentValues.put(FZDDatabaseHelper.fCreateTime, System.currentTimeMillis());
+ contentValues.put(FZDDatabaseHelper.fUpdateTime, System.currentTimeMillis());
}
+ //TODO:保存到fzd的联系人列表,类型为白名单
runtime.getDbHelper().saveContacts(contactArray, false, false, true, false, false, false);
+ //保存到新的数据库中,为了防止问题,先兼容原来的库
+ //后面所有地方都切换到新库了,才删除上面的代码
+ // TODO:需要修改白名单拦截的地方.
+ ContentResolver resolver = runtime.getContextProxy().getResolver();
+ resolver.insert(Uri.parse(FZDMembersProvider.MEMBERS), contentValues);
} else {
ICLogger.i("没有电话本!执行清除操作!");
}
break;
case CENTER:
ICLogger.d("收到中心号码设置--> " + data);
- handleCENTER(cmd, data, mRuntime);
+ handleCENTER(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.CENTER)));
break;
case SILENCETIME2:
break;
case LOWBAT:
ICLogger.d("收到低电量警报的开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.LOWBAT)));
break;
case SOSSMS:
ICLogger.d("收到SOS短信警报开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.SOSSMS)));
break;
case REMOVE:
ICLogger.d("收到表带的警报开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.REMOVE)));
break;
case WLKEY:
ICLogger.d("收到白名单功能开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.WLKEY)));
break;
case KEYBRD:
ICLogger.d("收到拨号盘开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.KEYBRD)));
break;
case FALLDOWN:
ICLogger.d("收到跌倒报警开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.FALLDOWN)));
break;
case SHAKE:
ICLogger.d("收到震动提醒开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.SHAKE)));
break;
case PEDO:
ICLogger.d("收到计步功能开关设置");
- handleSettings(cmd, data, mRuntime);
+ handleSettings(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.PEDO)));
break;
case FACTORY:
break;
case SLEEPTIME:
ICLogger.d("收到服务器发来的翻转检测时间设置");
- handleSLEEPTIME(cmd, data, mRuntime);
+ handleSLEEPTIME(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.SLEEPTIME)));
break;
case REMIND:
break;
case profile:
ICLogger.d("收到情景模式设置指令");
- handleProfile(cmd, data, mRuntime);
+ handleProfile(type, data, mRuntime);
mConnection.send(genFZDCMD(cmdMap.get(CMD_TYPE.profile)));
break;
case BOOTOFF:
* @param data
* @param mRuntime
*/
- private void handleProfile(String cmd, String data, Runtime mRuntime) {
+ private void handleProfile(CMD_TYPE cmd, String data, Runtime mRuntime) {
ICLogger.d("profile data == > " + data);
//保存一份到设置里
handleSettings(cmd, data, mRuntime);
ICLogger.d("audioManager == > is null");
return;
}
+ Context context = mRuntime.getContextProxy().context;
//对data进行判断
try {
int type = Integer.parseInt(data);
* @param data
* @param mRuntime
*/
- private void handleSLEEPTIME(String cmd, String data, Runtime mRuntime) {
+ private void handleSLEEPTIME(CMD_TYPE cmd, String data, Runtime mRuntime) {
//数据解析,有可能为空的
ICLogger.d("sleep_time == > " + data);
handleSettings(cmd, data, mRuntime);
* @param data
* @param mRuntime
*/
- private void handleSettings(String cmd, String data, Runtime mRuntime) {
+ private void handleSettings(CMD_TYPE cmd, String data, Runtime mRuntime) {
ICLogger.d(cmd + " trigger setting --> " + data);
ContentResolver resolver = mRuntime.getContextProxy().getResolver();
ContentValues values = new ContentValues();
- values.put(FZDDatabaseHelper.sKey, cmd);
+ values.put(FZDDatabaseHelper.sKey, cmdMap.get(cmd));
values.put(FZDDatabaseHelper.sValue, data);
resolver.insert(Uri.parse(FZDSettingsProvider.SETTINGS), values);
}
import java.util.Date;
import java.util.HashMap;
-import static com.enqualcomm.support.Constants.ACTION_HEATR_RATE_START;
import static com.enqualcomm.support.Constants.FROM_SERVER;
import static com.enqualcomm.support.LocationClient.LOCATION_MODE;
import static java.lang.Math.abs;
if (datetime != null) {
ICLogger.i("===" + timezone + " " + TimeUtil.getDefaultTimeZone());
- TimeUtil.setTimeZone(runtime.getContextProxy().context,timezone);
+ TimeUtil.setTimeZone(runtime.getContextProxy().context, timezone);
ICLogger.i("===" + TimeUtil.getDefaultTimeZone());
- TimeUtil.setSysDateTime(runtime.getContextProxy().context, datetime, timezone,false);
+ TimeUtil.setSysDateTime(runtime.getContextProxy().context, datetime, timezone, false);
ICLogger.i("===" + TimeUtil.getDefaultTimeZone());
}
try {
int cycle_int = Integer.parseInt(cycle.trim());
ICLogger.i("收到服务器指令:设置心率血压周期 " + cycle + "秒" + cycle_int / 60 + "分钟");
- CoreService.getInstance().setHeartRateDetectAlarm(cycle_int/60);
+ CoreService.getInstance().setHeartRateDetectAlarm(cycle_int / 60);
//发送重置PPGCycle的广播,会在CoreServer里面执行
// Intent intent = new Intent();
// intent.putExtra("PPGTestCycle", cycle_int / 60);
case UD:
mConnection.DeliverCMDMessageToSystem("UD", cmd);//通知下面线程状态变化,用Deliver发送的话必须发,表示服务器响应了
break;
-
case AL:
mConnection.DeliverCMDMessageToSystem("AL", cmd);//通知下面线程状态变化,用Deliver发送的话必须发,表示服务器响应了
break;
-
case PEDO:
handlePEDO(mConnection, mRuntime, cmd, data);
- mConnection.DeliverCMDMessageToSystem("PEDO", cmd);//通知下面线程状态变化,用Deliver发送的话必须发,表示服务器响应了
+ //通知下面线程状态变化,用Deliver发送的话必须发,
+ // 表示服务器响应了
+ mConnection.DeliverCMDMessageToSystem("PEDO", cmd);
break;
-
case REMOVE:
handleREMOVE(mConnection, mRuntime, cmd, data);
- mConnection.DeliverCMDMessageToSystem("REMOVE", cmd);//通知下面线程状态变化
+ //通知下面线程状态变化
+ mConnection.DeliverCMDMessageToSystem("REMOVE", cmd);
break;
case CENTER:
handleCENTER(mConnection, mRuntime, cmd, data);
- mConnection.DeliverCMDMessageToSystem("CENTER", cmd);//通知下面线程状态变化
-
+ //通知下面线程状态变化
+ mConnection.DeliverCMDMessageToSystem("CENTER", cmd);
break;
case MONITOR:
handleMONITOR(mConnection, mRuntime, cmd, data);
- mConnection.DeliverCMDMessageToSystem("MONITOR", cmd);//通知下面线程状态变化
+ //通知下面线程状态变化
+ mConnection.DeliverCMDMessageToSystem("MONITOR", cmd);
break;
// case CR:
-#Fri Apr 02 17:59:55 CST 2021
-VERSION_CODE=773
+#Thu Apr 15 19:36:29 CST 2021
+VERSION_CODE=776