From: TrillGates Date: Thu, 22 Jul 2021 13:37:02 +0000 (+0800) Subject: load weather info after network connected. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=d5a5725f6a802ef826b77f663c4751016e873b69;p=protocol_srv.git load weather info after network connected. --- diff --git a/app/release/ICSer_V896_2107211614_release.apk b/app/release/ICSer_V898_2107212038_release.apk similarity index 77% rename from app/release/ICSer_V896_2107211614_release.apk rename to app/release/ICSer_V898_2107212038_release.apk index 6be7a984..664ba7b4 100644 Binary files a/app/release/ICSer_V896_2107211614_release.apk and b/app/release/ICSer_V898_2107212038_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 4b4d881d..f0fa0d31 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":896,"versionName":"2107211614","enabled":true,"outputFile":"ICSer_V896_2107211614_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V896_2107211614_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":898,"versionName":"2107212038","enabled":true,"outputFile":"ICSer_V898_2107212038_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V898_2107212038_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index ff9e0c49..ced329ee 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -440,6 +440,14 @@ public class CoreService extends Service { return; coreService.connectionServiceChain.processConnectionOpen(coreService.connection, coreService.runtime); ICLogger.i("onConnectionOpen"); + mHandler.postDelayed(() -> { + //链接上了,去加载一下天气 + //连接成功,去获取一次天气 + //如果防走丢的协议的话 + ICLogger.d("getFZDWeatherInfo ... "); + coreService.getFZDWeatherInfo(); + }, 30 * 1000); + } public void onReceive(StringMessage param1StringMessage) { @@ -1726,11 +1734,6 @@ public class CoreService extends Service { ICLogger.i("retry 如果连接成功则停止重试!"); no_network_Heartbeats_Count = 0; stopConnectionRetryTimer(); - //连接成功,去获取一次天气 - //如果防走丢的协议的话 - ICLogger.d("getFZDWeatherInfo ... "); - getFZDWeatherInfo(); - } else { if (retry_connect_count >= retry_connect_max_times) { no_network_Heartbeats_Count++; @@ -1866,8 +1869,9 @@ public class CoreService extends Service { } }; - private void getFZDWeatherInfo() { + public void getFZDWeatherInfo() { protocolAPIHelper.doWeatherGet(connection, runtime); + //TODO:定时,3个小时获取一次天气 } diff --git a/app/src/main/java/com/enqualcomm/support/ICSmsManager.java b/app/src/main/java/com/enqualcomm/support/ICSmsManager.java index b88fc81f..6f7c1e94 100644 --- a/app/src/main/java/com/enqualcomm/support/ICSmsManager.java +++ b/app/src/main/java/com/enqualcomm/support/ICSmsManager.java @@ -175,7 +175,6 @@ public class ICSmsManager extends BroadcastReceiver { private void createNotification(String title, String type) { ContentValues contentValues = new ContentValues(); - //分类是心率的包名 contentValues.put(ICDatabaseHelper.notification_category, "com.ic.mms"); contentValues.put(ICDatabaseHelper.notification_title, title); contentValues.put(ICDatabaseHelper.notification_type, type); @@ -184,18 +183,8 @@ public class ICSmsManager extends BroadcastReceiver { contentValues.put(ICDatabaseHelper.notification_create_time, System.currentTimeMillis()); ContentResolver resolver = runtime.getContextProxy().getResolver(); resolver.insert(Uri.parse(ICNotificationProvider.NOTIFICATIONS), contentValues); - //创建警告消息未读的设置项 - updateSettingsValue(); } - private void updateSettingsValue() { - ContentValues contentValues = new ContentValues(); - contentValues.put(ICDatabaseHelper.sKey, "physical_warning_notification"); - //1表示有,0表示没有 - contentValues.put(ICDatabaseHelper.sValue, 1); - ContentResolver resolver = runtime.getContextProxy().getResolver(); - resolver.insert(Uri.parse(ICGlobalSettingsProvider.SETTINGS), contentValues); - } public class ReplayLocation implements LocationClient.LocationResponseUrl { diff --git a/app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java b/app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java index f4df6140..cbc8487a 100644 --- a/app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java +++ b/app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java @@ -11,7 +11,6 @@ import android.telephony.ServiceState; import android.text.TextUtils; import com.enqualcomm.support.provider.ICDatabaseHelper; -import com.enqualcomm.support.provider.ICGlobalSettingsProvider; import com.enqualcomm.support.provider.ICNotificationProvider; import com.enqualcomm.support.utils.ICLogger; @@ -91,7 +90,6 @@ public class PhoneCallListener extends PhoneStateListener { private void createNotification(String phoneNum) { ICLogger.d("createNotification==> " + phoneNum); ContentValues contentValues = new ContentValues(); - //分类是心率的包名 contentValues.put(ICDatabaseHelper.notification_category, "com.ic.phone"); contentValues.put(ICDatabaseHelper.notification_title, phoneNum); contentValues.put(ICDatabaseHelper.notification_type, "missed_phone"); @@ -100,17 +98,6 @@ public class PhoneCallListener extends PhoneStateListener { contentValues.put(ICDatabaseHelper.notification_create_time, System.currentTimeMillis()); ContentResolver resolver = mContext.getContentResolver(); resolver.insert(Uri.parse(ICNotificationProvider.NOTIFICATIONS), contentValues); - updateSettingsValue(resolver); } - private void updateSettingsValue(ContentResolver resolver) { - ContentValues contentValues = new ContentValues(); - //分类是心率的包名 - contentValues.put(ICDatabaseHelper.sKey, "physical_warning_notification"); - //1表示有,0表示没有 - contentValues.put(ICDatabaseHelper.sValue, 1); - resolver.insert(Uri.parse(ICGlobalSettingsProvider.SETTINGS), contentValues); - } - - } diff --git a/app/version_code.properties b/app/version_code.properties index ba57a6c2..59f76e45 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Jul 21 16:14:12 CST 2021 -VERSION_CODE=896 +#Wed Jul 21 20:38:25 CST 2021 +VERSION_CODE=898