From: k.liang Date: Thu, 31 Mar 2022 08:50:12 +0000 (+0800) Subject: 修改定位开启时临时唤醒doze的idle,定位结束后发广播让设备进入doze的下一步 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=7a053a4f259e60da8e96f6a9927d5eebb9e487e2;p=protocol_srv.git 修改定位开启时临时唤醒doze的idle,定位结束后发广播让设备进入doze的下一步 --- 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