修改定位开启时临时唤醒doze的idle,定位结束后发广播让设备进入doze的下一步
authork.liang <liangkang648253071@126.com>
Thu, 31 Mar 2022 08:50:12 +0000 (16:50 +0800)
committerk.liang <liangkang648253071@126.com>
Thu, 31 Mar 2022 08:50:12 +0000 (16:50 +0800)
app/release/output.json
app/src/main/java/com/ic/protocolSrv/LocationClient.java
app/version_code.properties
local.properties

index 3616e57..fd8ddd0 100644 (file)
@@ -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
index f2371a2..d8bf579 100644 (file)
@@ -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();
index 1a1cbb3..f051281 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Nov 23 16:30:30 CST 2021\r
-VERSION_CODE=944\r
+#Wed Mar 30 20:17:37 CST 2022\r
+VERSION_CODE=955\r
index c04f4ae..8bd7f3b 100644 (file)
@@ -5,4 +5,4 @@
 # For customization when using a Version Control System, please read the\r
 # header note.\r
 #Mon Sep 06 17:17:01 CST 2021\r
-sdk.dir=E\:\\Android\\Sdk\r
+sdk.dir=D\:\\android\\Android\\sdk\r