From: snickersun Date: Tue, 25 Feb 2020 03:50:41 +0000 (+0800) Subject: 修复亮屏时计步信息仍然不及时更新的问题。 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=a722d6e8973aaddd57708c6a77cbf3b26830a789;p=icsupport.git 修复亮屏时计步信息仍然不及时更新的问题。 --- diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 2c35f7bc..7205f831 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -304,9 +304,10 @@ public class CoreService extends Service { //为了保证唤醒时各个状态及时更新到服务器,发送一个同步心跳包,这样用户体验更好 + CoreService.getInstance().locationClient.updateStepCount(); Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1() { public void call(Long param1Long) { - connection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(runtime))); + connection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(runtime))); } }); diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index 612d9a85..d6efce2c 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -169,7 +169,7 @@ public class LocationClient { } } //计算运动并发送数据 - private void updateStepCount() { + public void updateStepCount() { this.gSensorListener.updateStepCount(); // this.H12StepCount = DeviceInfoUtil.getStepCount((runtime.getContextProxy()).context);