Browse Source

1.部分系统应用不在上传使用时间。

20241218TB223FC(测试jar包)
wangwanlei 11 months ago
parent
commit
5db04dd908

+ 23
- 40
app/src/main/java/com/xhly/manageapp/workmanager/TimingWorker.kt View File

@@ -60,28 +60,6 @@ class TimingWorker(context: Context, workerParams: WorkerParameters) :
60 60
             if (appInfo.size > 0) {
61 61
                 logService.postLogAppStartAdd(appInfo)
62 62
             }
63
-            /*
64
-                        try {
65
-                            val location = PadLocationConst.currentLocation
66
-                            val lastLocation = PadLocationConst.lastLocation
67
-                            if (location.lat!=null&&location.lon!=null&&(lastLocation.lon!=location.lon&&lastLocation.lat!=location.lat)){
68
-                                lastLocation.lat=location.lat
69
-                                lastLocation.lon=location.lon
70
-                                ManageApplication.getDeviceInfo()?.let {
71
-                                    location.sn=it
72
-                                }
73
-                                userBean?.let {
74
-                                    location.userid=it.userid
75
-                                }
76
-                                logService.postPadLocation(location)
77
-                                LogShow("真没有位置")
78
-                            }else{
79
-                                LogShow("没有位置")
80
-                            }
81
-                        }catch (e:Exception){
82
-                            LogShow("没有位置问题"+e.toString())
83
-                        }
84
-            */
85 63
             UIEvent(Const.STARTLOCATION).post()
86 64
             userBean?.let {
87 65
                 val map = HashMap<String, Any>()
@@ -154,16 +132,19 @@ class TimingWorker(context: Context, workerParams: WorkerParameters) :
154 132
                         val first =
155 133
                             dataList.firstOrNull { event.packageName.equals(it.packageName) }
156 134
                         first?.let {
157
-                            sn?.let {
158
-                                appStartBean.sn = sn
135
+                            //只上传不在这个集合中的应用
136
+                            if (!Const.systemSetAppList.contains(first.packageName)){
137
+                                sn?.let {
138
+                                    appStartBean.sn = sn
139
+                                }
140
+                                appStartBean.appName = first.name
141
+                                appStartBean.appPackage = first.packageName
142
+                                appStartBean.starttime = event.timeStamp.toFormat()
143
+                                appStartBean.ltype = 1
144
+                                appStartBean.versionName = first.versionName
145
+                                appStartBean.versionNum = first.versionNum
146
+                                startList.add(appStartBean)
159 147
                             }
160
-                            appStartBean.appName = first.name
161
-                            appStartBean.appPackage = first.packageName
162
-                            appStartBean.starttime = event.timeStamp.toFormat()
163
-                            appStartBean.ltype = 1
164
-                            appStartBean.versionName = first.versionName
165
-                            appStartBean.versionNum = first.versionNum
166
-                            startList.add(appStartBean)
167 148
                         }
168 149
                     }
169 150
 
@@ -172,16 +153,18 @@ class TimingWorker(context: Context, workerParams: WorkerParameters) :
172 153
                         var first =
173 154
                             dataList.firstOrNull { event.packageName.equals(it.packageName) }
174 155
                         first?.let {
175
-                            sn?.let {
176
-                                appStartBean.sn = sn
156
+                            if (!Const.systemSetAppList.contains(first.packageName)){
157
+                                sn?.let {
158
+                                    appStartBean.sn = sn
159
+                                }
160
+                                appStartBean.appName = first.name
161
+                                appStartBean.appPackage = first.packageName
162
+                                appStartBean.starttime = event.timeStamp.toFormat()
163
+                                appStartBean.ltype = 2
164
+                                appStartBean.versionName = first.versionName
165
+                                appStartBean.versionNum = first.versionNum
166
+                                startList.add(appStartBean)
177 167
                             }
178
-                            appStartBean.appName = first.name
179
-                            appStartBean.appPackage = first.packageName
180
-                            appStartBean.starttime = event.timeStamp.toFormat()
181
-                            appStartBean.ltype = 2
182
-                            appStartBean.versionName = first.versionName
183
-                            appStartBean.versionNum = first.versionNum
184
-                            startList.add(appStartBean)
185 168
                         }
186 169
                     }
187 170
                 }

+ 20
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt View File

@@ -281,6 +281,11 @@ object Const {
281 281
      */
282 282
     const val ANDROIDGALLERY6 = "com.android.gallery3d"
283 283
 
284
+    /**
285
+     * 联想设置包名
286
+     */
287
+    const val LENOVOSEETING="com.android.settings"
288
+
284 289
     /**
285 290
      * 这几个应用由学校设置接口处理
286 291
      */
@@ -295,6 +300,21 @@ object Const {
295 300
         ANDROIDGALLERY6
296 301
     )
297 302
 
303
+    /**
304
+     * 这几个应用不在上传使用时间
305
+     */
306
+    val systemSetAppList = arrayListOf(
307
+        ANDROIDPHONE,
308
+        ANDROIDMMS,
309
+        ANDROIDCALENDAR,
310
+        ANDROIDDESKCLOCK,
311
+        ANDROIDCAMERA,
312
+        ANDROIDCAMERA6,
313
+        ANDROIDGALLERY,
314
+        ANDROIDGALLERY6,
315
+        LENOVOSEETING
316
+    )
317
+
298 318
     /**
299 319
      *标记自定义的一键清理名称
300 320
      */

Loading…
Cancel
Save