From 7a053a4f259e60da8e96f6a9927d5eebb9e487e2 Mon Sep 17 00:00:00 2001 From: "k.liang" Date: Thu, 31 Mar 2022 16:50:12 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E4=BD=8D=E5=BC=80?= =?utf8?q?=E5=90=AF=E6=97=B6=E4=B8=B4=E6=97=B6=E5=94=A4=E9=86=92doze?= =?utf8?q?=E7=9A=84idle=EF=BC=8C=E5=AE=9A=E4=BD=8D=E7=BB=93=E6=9D=9F?= =?utf8?q?=E5=90=8E=E5=8F=91=E5=B9=BF=E6=92=AD=E8=AE=A9=E8=AE=BE=E5=A4=87?= =?utf8?q?=E8=BF=9B=E5=85=A5doze=E7=9A=84=E4=B8=8B=E4=B8=80=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- app/release/output.json | 2 +- .../java/com/ic/protocolSrv/LocationClient.java | 14 +++++++++++++- app/version_code.properties | 4 ++-- local.properties | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/release/output.json b/app/release/output.json index 3616e576..fd8ddd0d 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":944,"versionName":"2111231630","enabled":true,"outputFile":"ICProtocol81_V944_2111231630_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V944_2111231630_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":955,"versionName":"2203302017","enabled":true,"outputFile":"ICProtocol81_V955_2203302017_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V955_2203302017_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/ic/protocolSrv/LocationClient.java b/app/src/main/java/com/ic/protocolSrv/LocationClient.java index f2371a24..d8bf5798 100644 --- a/app/src/main/java/com/ic/protocolSrv/LocationClient.java +++ b/app/src/main/java/com/ic/protocolSrv/LocationClient.java @@ -411,6 +411,11 @@ public class LocationClient { } public void startGpsLocate() { + //唤醒Doze模式到激活状态,要不然GPS有可能不工作 + PowerManager powerManager = (PowerManager) runtime.getContextProxy().context.getSystemService(Context.POWER_SERVICE);//true为打开,false为关闭 + if(!powerManager.isScreenOn()){ + runtime.getContextProxy().context.sendBroadcast(new Intent("com.ic.action.wake_up_doze")); + } boolean FactoryModeOpening = DeviceInfoUtil.isFactoryTestTopActivity(runtime.getContextProxy().context); boolean needReOpenGPS = runtime.getFactoryTestingStat(); @@ -860,6 +865,11 @@ public class LocationClient { // } // }else { Deliver.sendLocationMSG(msg); + //add k.liang 发完GPS数据后,让doze模式进入下一个阶段状态,以保证来能快速进入Doze的深睡状态 + PowerManager powerManager = (PowerManager) runtime.getContextProxy().context.getSystemService(Context.POWER_SERVICE);//true为打开,false为关闭 + if(!powerManager.isScreenOn()){ + runtime.getContextProxy().context.sendBroadcast(new Intent("com.ic.action.sleep_doze")); + } // } } @@ -899,6 +909,7 @@ public class LocationClient { isLocating = false; startCheckTime = 0L; isWifiScanning = false; + stopGpsLocate(); // ICLogger.i(" stopCheckLocationResult Done "); } @@ -1225,7 +1236,8 @@ public class LocationClient { //响应定位指令 if ("StartLocate".equals(paramStringMessage.cmd())) { forceLocation = 1; - this.startLocationProcess(runtime.getLocationInstance().getWorkingMod()); + //this.startLocationProcess(runtime.getLocationInstance().getWorkingMod()); + this.triggerLocationProcess(); } else if ("setWorkMod".equals(paramStringMessage.cmd())) { //此处不负责给工作模式赋值,在API接收的位置能够直接拿到变量,可以直接赋值较方便。 int mod = runtime.getLocationInstance().getWorkingMod(); diff --git a/app/version_code.properties b/app/version_code.properties index 1a1cbb3b..f0512813 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Tue Nov 23 16:30:30 CST 2021 -VERSION_CODE=944 +#Wed Mar 30 20:17:37 CST 2022 +VERSION_CODE=955 diff --git a/local.properties b/local.properties index c04f4aee..8bd7f3b5 100644 --- a/local.properties +++ b/local.properties @@ -5,4 +5,4 @@ # For customization when using a Version Control System, please read the # header note. #Mon Sep 06 17:17:01 CST 2021 -sdk.dir=E\:\\Android\\Sdk +sdk.dir=D\:\\android\\Android\\sdk -- 2.17.1