load weather info after network connected.
authorTrillGates <williamtrillgates@gmail.com>
Thu, 22 Jul 2021 13:37:02 +0000 (21:37 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Thu, 22 Jul 2021 13:37:02 +0000 (21:37 +0800)
app/release/ICSer_V898_2107212038_release.apk [moved from app/release/ICSer_V896_2107211614_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/ICSmsManager.java
app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V896_2107211614_release.apk
rename to app/release/ICSer_V898_2107212038_release.apk
index 6be7a98..664ba7b 100644 (file)
Binary files a/app/release/ICSer_V896_2107211614_release.apk and b/app/release/ICSer_V898_2107212038_release.apk differ
index 4b4d881..f0fa0d3 100644 (file)
@@ -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
index ff9e0c4..ced329e 100644 (file)
@@ -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个小时获取一次天气
     }
 
 
index b88fc81..6f7c1e9 100644 (file)
@@ -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 {
 
index f4df614..cbc8487 100644 (file)
@@ -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);
-    }
-
-
 }
index ba57a6c..59f76e4 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Jul 21 16:14:12 CST 2021\r
-VERSION_CODE=896\r
+#Wed Jul 21 20:38:25 CST 2021\r
+VERSION_CODE=898\r