-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":740,"versionName":"2012281508","enabled":true,"outputFile":"ICSer_V740_2012281508_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V740_2012281508_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":742,"versionName":"2012291656","enabled":true,"outputFile":"ICSer_V742_2012291656_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V742_2012291656_release.apk","properties":{}}]
\ No newline at end of file
android:authorities="com.enqualcomm.support"
android:exported="true" />
- <receiver
- android:name=".ICSmsManager"
- android:exported="true">
- <intent-filter>
- <action android:name="android.provider.Telephony.SMS_RECEIVED" />
- <action android:name="com.enqualcomm.support.SMSCMD" />
- <action android:name="com.ic.action.internaltest" />
- </intent-filter>
- </receiver>
+<!-- <receiver-->
+<!-- android:name=".ICSmsManager"-->
+<!-- android:exported="true">-->
+<!-- <intent-filter>-->
+<!-- <action android:name="android.provider.Telephony.SMS_RECEIVED" />-->
+<!-- <action android:name="com.enqualcomm.support.SMSCMD" />-->
+<!-- <action android:name="com.ic.action.internaltest" />-->
+<!-- </intent-filter>-->
+<!-- </receiver>-->
<receiver
android:name=".BootCompleteReceiver"
android:exported="true">
public static final String ACTION_START_FOTA_UPDATE="com.ic.action.startfotaUpdate";
public static final String ACTION_SMSCMD="com.enqualcomm.support.SMSCMD";
public static final String ACTION_SMSCMD_Reply="com.ic.action.fotaUpdateReply";
+ public static final String ACTION_TINTERNAL_TEST="com.ic.action.internaltest";
+
public static final String KeyReplyData="reply";
public static final String ACTION_SMSCMD_TEST="com.ic.action.internaltest";
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.Message;
import android.os.SystemClock;
import android.telephony.SmsMessage;
import static com.enqualcomm.support.Constants.ACTION_SMSCMD_TEST;
import static com.enqualcomm.support.Constants.ACTION_SMS_RECEIVED;
import static com.enqualcomm.support.Constants.ACTION_START_FOTA_UPDATE;
+import static com.enqualcomm.support.Constants.ACTION_TINTERNAL_TEST;
import static com.enqualcomm.support.Constants.KeyReplyData;
import static com.enqualcomm.support.utils.SimSignalUtil.send_at_cmd;
import static com.enqualcomm.support.utils.SimSignalUtil.send_at_setImei0;
mContext = context;
runtime = CoreService.getInstance().runtime;
-
String action = intent.getAction();
ICLogger.i(" onReceive Action " + action);
if (ACTION_SMSCMD.equals(action)) {
this.mContext = runtime.getContextProxy().context;
IntentFilter intentfilter = new IntentFilter();
intentfilter.addAction(ACTION_SMSCMD_Reply);
- this.mContext.registerReceiver(this, intentfilter);
+ intentfilter.addAction(ACTION_SMS_RECEIVED);
+ intentfilter.addAction(ACTION_SMSCMD);
+ intentfilter.addAction(ACTION_TINTERNAL_TEST);
+ mContext.registerReceiver(this, intentfilter);
+ ICLogger.i("ICSmsManager register filter ");
// registerSmsDatabaseChangeObserver(mContext);
- mHandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper(), new Handler.Callback() {
+ HandlerThread handlerThread = new HandlerThread("ic:SMS-thread");
+ handlerThread.start();
+ mHandler = new Handler(handlerThread.getLooper(), new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
switch (message.what) {
}
break;
case 0:
- // sendSMS(phonenumber, "Upload Failed!");
- // if (needshowToast) {
- Util.ShowToast(runtime, "Upload cmd Failed!");
- // }
+ sendSMS(cell_number_to_reply, "Upload Failed!");
+ cell_number_to_reply="";
+ if (needshowToast) {
+ Util.ShowToast(runtime, "Upload cmd Failed!");
+ needshowToast=false;
+ }
break;
case 1:
- // sendSMS(phonenumber, "Upload success!");
- // if (needshowToast) {
- Util.ShowToast(runtime, "Upload cmd success!");
- // }
+ sendSMS(cell_number_to_reply, "Upload success!");
+ cell_number_to_reply="";
+ if (needshowToast) {
+ Util.ShowToast(runtime, "Upload cmd success!");
+ needshowToast=false;
+ }
break;
}
return false;
} else if (sms.startsWith(ENCRYPED_HEADER + "#logctl#=")) {
needshowToast = sms.contains("SDLogInfo:");
-
+ cell_number_to_reply = phonenumber;
String tmp[] = sms.split("=");
if (tmp.length == 2) {
if (tmp[1].equals("current")) {
@Override
public void run() {
String filepath = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + fileOrDir;
- URL serverurl = null;
- try {
- serverurl = new URL(Util.getServerLogfilePath(Config.getFtpServer(mContext), TimeUtil.getSystemTime3(), logfile, runtime));
- } catch (MalformedURLException e) {
- e.printStackTrace();
- ICLogger.e(e.getMessage(), e);
- }
if (new File(filepath).exists()) {
Util.getDBFile();
sendSMS(phonenumber, "start Upload " + filepath + " to " + Config.getFtpServer(mContext) + " ...");
- if (logfile.startsWith("SDLogInfo:")) {
+ if (needshowToast) {
Util.ShowToast(runtime, "start Upload " + filepath + " to " + Config.getFtpServer(mContext) + " ...");
}
String logtime = TimeUtil.getSystemTime3();
-
- if (upload_logs_via_ftp) {
- if (ftpUtils.upload(serverurl, Config.getFtpUser(mContext), Config.getFtpPWD(mContext), new File(filepath))) {
- sendSMS(phonenumber, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " success!");
-
- if (logfile.startsWith("SDLogInfo:")) {
- Util.ShowToast(runtime, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " success!");
- }
- } else {
- sendSMS(phonenumber, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " failed!");
- if (logfile.startsWith("SDLogInfo:")) {
- Util.ShowToast(runtime, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " failed!");
- }
- }
- } else {
- if (ICHttpUtil.uploadFile(filepath, runtime, logtime, mHandler)) {
-// sendSMS(phonenumber, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " success!");
-// if (logfile.startsWith("SDLogInfo:")){
-// Util.ShowToast(runtime,"Upload " + filepath + " to " + Config.getFtpServer(mContext) + " success!");
-// }
- } else {
-// sendSMS(phonenumber, "Upload " + filepath + " to " + Config.getFtpServer(mContext) + " failed!");
-// if (logfile.startsWith("SDLogInfo:")){
-// Util.ShowToast(runtime,"Upload " + filepath + " to " + Config.getFtpServer(mContext) + " failed!");
-// }
- }
- }
+ ICHttpUtil.uploadFile(filepath, runtime, logtime, mHandler);
} else {
sendSMS(phonenumber, filepath + " not exist !");
- if (logfile.startsWith("SDLogInfo:")) {
+ if (needshowToast) {
Util.ShowToast(runtime, filepath + " not exist !");
}
}
@Override
public void run() {
String filepath = Util.getLogfilePath(runtime, logfile);
- URL serverurl = null;
- try {
- serverurl = new URL(Util.getServerLogfilePath(Config.getFtpServer(mContext), TimeUtil.getSystemTime3(), logfile, runtime));
- } catch (MalformedURLException e) {
- e.printStackTrace();
- ICLogger.e(e.getMessage(), e);
- }
if (Util.LogfileExist(runtime, logfile)) {
Util.getDBFile();
sendSMS(phonenumber, "start Upload " + logfile + " to " + Config.getFtpServer(mContext) + " ...");
String logtime = TimeUtil.getSystemTime3();
-
- if (upload_logs_via_ftp) {
- if (ftpUtils.upload(serverurl, Config.getFtpUser(mContext), Config.getFtpPWD(mContext), new File(filepath))) {
- sendSMS(phonenumber, "Upload " + logfile + " to " + Config.getFtpServer(mContext) + " success!");
- } else {
- sendSMS(phonenumber, "Upload " + logfile + " to " + Config.getFtpServer(mContext) + " failed!");
- }
- } else {
- if (ICHttpUtil.uploadFile(filepath, runtime, logtime, mHandler)) {
-// sendSMS(phonenumber, "Upload " + logfile + " to " + Config.getFtpServer(mContext) + " success!");
- } else {
-// sendSMS(phonenumber, "Upload " + logfile + " to " + Config.getFtpServer(mContext) + " failed!");
- }
- }
+ ICHttpUtil.uploadFile(filepath, runtime, logtime, mHandler);
} else {
sendSMS(phonenumber, logfile + " not exist !");
}
}
-// sendSMS(phonenumber, "upload FtpLogServer to " + Config.getFtpServer(mContext) + ", user " + Config.getFtpUser(mContext) + ", pwd " + Config.getFtpPWD(mContext));
-
} else {
sendSMS(phonenumber, "upload logfile format error!");
}
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.Message;
import android.os.PowerManager;
import android.os.SystemClock;
}
}
});
-
- mhandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper(), locationCallback);
+ HandlerThread handlerThread = new HandlerThread("ic:location-thread");
+ handlerThread.start();
+ mhandler = new Handler(handlerThread.getLooper(), locationCallback);
btHelper.setBLEScanTimeout(OneBLEScanTimeOUT);
gLocationCline = this;
//GPS 监听管理初始化
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
+import android.os.HandlerThread;
import android.provider.Settings;
import com.enqualcomm.support.bean.EventLooperHandlerThread;
public NMEAListener(LocationManager paramLocationManager, Runtime paramRuntime) {
this.locationManager = paramLocationManager;
this.runtime = paramRuntime;
-
- temHandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper(), message -> {
+ HandlerThread handlerThread = new HandlerThread("ic:nmea-thread");
+ handlerThread.start();
+ temHandler = new Handler(handlerThread.getLooper(), message -> {
if (message.what == MSG_WHAT_GPS_TIMEOUT || message.what == MSG_WHAT_GPS_NOSTAR) {
//no start
if (lecallback == null)
lecallback = new BLeScanCallback();
if (mHandler == null) {
- mHandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper());
+ HandlerThread handlerThread = new HandlerThread("ic:BT-thread");
+ handlerThread.start();
+ mHandler = new Handler(handlerThread.getLooper());
}
}
if (lecallback == null)
lecallback = new BLeScanCallback();
if (mHandler == null) {
- mHandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper());
+ HandlerThread handlerThread = new HandlerThread("ic:BT-thread");
+ handlerThread.start();
+ mHandler = new Handler(handlerThread.getLooper());
}
mBtAdapter.startLeScan(lecallback);
mHandler.postDelayed(mRunable_stopBleScan, BLETimeoutForOneScan * 1000);
import java.util.ArrayList;
import java.util.Iterator;
-import rx.Observable;
-import rx.Subscriber;
-import rx.schedulers.Schedulers;
-
import static com.enqualcomm.support.Constants.ACTION_ALARM_ALARM_CHANGE;
import static com.enqualcomm.support.Constants.ACTION_ANTIOFF_ALARM_CHANGE;
import static com.enqualcomm.support.bean.Contact.CATEGORY_ADMIN;
* @param resolver
*/
private void addAllContact(ArrayList<Contact> contactArray, ContentResolver resolver) {
- Observable.create(subscriber -> {
- Iterator contactIT = contactArray.iterator();
- while (contactIT.hasNext()) {
- Contact contact = (Contact) contactIT.next();
- ContentValues contentvalues = new ContentValues();
- long raw_contactID = ContentUris.parseId(resolver.insert(RawContacts.CONTENT_URI, contentvalues));
- contentvalues.clear();
- contentvalues.put("raw_contact_id", raw_contactID);
- contentvalues.put("mimetype", "vnd.android.cursor.item/name");
- contentvalues.put("data2", contact.name);
- resolver.insert(Data.CONTENT_URI, contentvalues);
- contentvalues.clear();
- contentvalues.put("raw_contact_id", raw_contactID);
- contentvalues.put("mimetype", "vnd.android.cursor.item/phone_v2");
- contentvalues.put("data1", contact.number);
- contentvalues.put("data2", 2);
- resolver.insert(Data.CONTENT_URI, contentvalues);
- contentvalues.clear();
- }
- }).subscribeOn(Schedulers.io()).subscribe();
+ Iterator contactIT = contactArray.iterator();
+ while (contactIT.hasNext()) {
+ Contact contact = (Contact) contactIT.next();
+ ContentValues contentvalues = new ContentValues();
+ long raw_contactID = ContentUris.parseId(resolver.insert(RawContacts.CONTENT_URI, contentvalues));
+ contentvalues.clear();
+ contentvalues.put("raw_contact_id", raw_contactID);
+ contentvalues.put("mimetype", "vnd.android.cursor.item/name");
+ contentvalues.put("data2", contact.name);
+ resolver.insert(Data.CONTENT_URI, contentvalues);
+ contentvalues.clear();
+ contentvalues.put("raw_contact_id", raw_contactID);
+ contentvalues.put("mimetype", "vnd.android.cursor.item/phone_v2");
+ contentvalues.put("data1", contact.number);
+ contentvalues.put("data2", 2);
+ resolver.insert(Data.CONTENT_URI, contentvalues);
+ contentvalues.clear();
+
+ }
+ ICLogger.i("addAllContact done");
+
}
/**
* @param resolver
*/
private void deleteAllContact(ArrayList<Contact> contactArrayList, String where, ContentResolver resolver) {
- Observable.create(subscriber -> {
- String sb = "where=" + where;
- ICLogger.i(sb);
- for (Contact contact : contactArrayList) {
- deleteContactId(resolver, contact.name);
- }
- resolver.delete(ICContentProvider.CONTACT_URI, where, null);
- }).subscribeOn(Schedulers.io()).subscribe();
+ String sb = "where=" + where;
+ ICLogger.i(sb);
+ for (Contact contact : contactArrayList) {
+ deleteContactId(resolver, contact.name);
+ }
+ resolver.delete(ICContentProvider.CONTACT_URI, where, null);
}
private Uri insertDownLoadInfo(String var1, int var2, int var3, String var4) {
ICLogger.i(log1.toString());
}
- this.cr.bulkInsert(ICContentProvider.CONTACT_URI, contentlist);
+ int rows=this.cr.bulkInsert(ICContentProvider.CONTACT_URI, contentlist);
+ ICLogger.i("Create rows "+rows);
this.addAllContact(contactArray, this.cr);
}
* @param si
*/
public void updateSleepInfo(SleepInfo si) {
- Observable.create(new Observable.OnSubscribe<Object>() {
- @Override
- public void call(Subscriber<? super Object> subscriber) {
- /*计算后的分值,每天会在睡眠结束后计算Records获得*/
- ContentValues values = new ContentValues();
- values.put("DATE", si.getCurrentDate());
- values.put("DEEP_SLEEP", si.getDeepsleep_minutes());
- values.put("LIGHT_SLEEP", si.getLightsleep_minutes());
- values.put("SCORE", si.getScore());
- cr.insert(ICContentProvider.SLEEP_STATUS_URI, values);
- }
- }).subscribeOn(Schedulers.io()).subscribe();
+ /*计算后的分值,每天会在睡眠结束后计算Records获得*/
+ ContentValues values = new ContentValues();
+ values.put("DATE", si.getCurrentDate());
+ values.put("DEEP_SLEEP", si.getDeepsleep_minutes());
+ values.put("LIGHT_SLEEP", si.getLightsleep_minutes());
+ values.put("SCORE", si.getScore());
+ cr.insert(ICContentProvider.SLEEP_STATUS_URI, values);
}
private static String language = "zh-cn";
public static String getCurrentLanguage(){
ICLogger.i(" get Current language "+Locale.getDefault().getDisplayLanguage());
- return language;
+ return Locale.getDefault().getLanguage();
}
import android.os.Bundle;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
public NettyConnection(ConnectionListener paramConnectionListener, Runtime runtime) {
Log.i(TAG, "NettyConnection ");
this.listener = paramConnectionListener;
-
- mHandler = new Handler(EventLooperHandlerThread.getInstance().makeLooper(), new Handler.Callback() {
+ HandlerThread handlerThread = new HandlerThread("ic:netty-handler-thread");
+ handlerThread.start();
+ mHandler = new Handler(handlerThread.getLooper(), new Handler.Callback() {
@Override
public boolean handleMessage(Message message) {
public protocol_ic(Connection connect, Runtime runtime) {
if (mHandler == null) {
- HandlerThread handlerThread = new HandlerThread("ic:protocol-handler-thread");
+ HandlerThread handlerThread = new HandlerThread("ic:protocol_ic-handler-thread");
handlerThread.start();
mHandler = new Handler(handlerThread.getLooper());
}
import android.os.AsyncTask;
import android.os.Binder;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.IBinder;
import android.text.TextUtils;
/**
*
*/
+ HandlerThread handlerThread = new HandlerThread("ic:mqttsrv-handler-thread");
+
private Handler mHandler = null;
/**
private MQTTIdentifierHelper mMqttIdentifierHelper;
private boolean doAutomaticReconnect = false;
- private Handler reconnectHandler = new Handler();
+
+
+
+ private Handler reconnectHandler ;
private Runnable recoonectRunnable = new Runnable() {
@Override
public void run() {
if (DEBUG)
ICLogger.i( "onCreate");
+ handlerThread.start();
+ reconnectHandler = new Handler(handlerThread.getLooper());
+
subscribedTopics = new HashSet<>();
mMqttIdentifierHelper = new MQTTIdentifierHelper();
mConnectedThread.start();
// Start the PINGREQ handler
- mKeepaliveHandler = new Handler(getMainLooper());
+
+ mKeepaliveHandler = new Handler(handlerThread.getLooper());//new Handler(getMainLooper());
mKeepaliveHandler.postDelayed(mPingSender, KEEP_ALIVE_TIMER*1000);
ICLogger.i( "Sending connect message");
-#Fri Dec 25 12:47:34 CST 2020
-VERSION_CODE=739
+#Tue Dec 29 16:56:28 CST 2020
+VERSION_CODE=742
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
-#Tue Dec 29 09:16:53 CST 2020
-sdk.dir=D\:\\Android\\Sdk
+#Tue Dec 29 14:56:41 CST 2020
+sdk.dir=C\:\\Users\\incar\\AppData\\Local\\Android\\Sdk