Skip to content

Commit 5480313

Browse files
author
jordanqin
committed
update qcloud sdk to 1.5.63
1 parent 0c0e6fc commit 5480313

File tree

6 files changed

+45
-7
lines changed

6 files changed

+45
-7
lines changed

QCloudFoundation/qcloud-track/src/androidTest/java/com/tencent/qcloud/track/ClsCosDataInputTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void init() {
3535

3636
ClsTrackService clsTrackService = new ClsTrackService();
3737
// clsTrackService.init(appContext, "9ab664b4-f657-4ef9-8b8c-305b819e477d", "ap-guangzhou.cls.tencentcs.com");
38-
clsTrackService.init(appContext, "5a956e13-ba0d-4941-a81b-103d4212e2a8", "ap-guangzhou.cls.tencentcs.com");
38+
clsTrackService.init(appContext, "f8140102-7b5b-4f50-9667-4611a2e23aea", "ap-guangzhou.cls.tencentcs.com");
3939
// 临时秘钥
4040
// clsTrackService.setCredentialProvider(new MyClsLifecycleCredentialProvider());
4141
// 固定秘钥
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.tencent.qcloud.track;
2+
3+
import android.content.Context;
4+
import android.os.Build;
5+
6+
import com.tencent.qcloud.track.utils.NetworkUtils;
7+
8+
import java.util.HashMap;
9+
import java.util.Map;
10+
11+
/**
12+
* 隐私合规服务类
13+
* <p>
14+
* Created by jordanqin on 2024/1/30 11:14.
15+
* Copyright 2010-2024 Tencent Cloud. All Rights Reserved.
16+
*/
17+
public class PrivacyService {
18+
/**
19+
* 获取可能采集的参数
20+
* 这些参数用于分析系统运行状态,优化系统性能和稳定性,不会用于其他用途
21+
* os_version: 系统版本
22+
* client_local_ip: 本地IP地址
23+
* network_type: 网络状态
24+
*/
25+
public static Map<String, String> getPrivacyParams(Context context) {
26+
Map<String, String> params = new HashMap<>();
27+
params.put("os_version", Build.VERSION.RELEASE);
28+
params.put("client_local_ip", NetworkUtils.getLocalMachineIP());
29+
params.put("network_type", NetworkUtils.getNetworkType(context));
30+
return params;
31+
}
32+
33+
/**
34+
* 关闭采集数据上报
35+
* 这些参数用于分析系统运行状态,优化系统性能和稳定性,不会用于其他用途
36+
*/
37+
public static void closeReport(){
38+
QCloudTrackService.getInstance().setIsCloseReport(true);
39+
}
40+
}

QCloudFoundation/qcloud-track/src/main/java/com/tencent/qcloud/track/QCloudTrackService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,13 @@ public void reportSimpleData(String eventCode, Map<String, String> params) {
177177
}
178178

179179
/**
180-
* 设置业务参数,便于在数据分析时个性化使用<br/>
180+
* 设置业务参数,便于在数据分析时个性化使用
181181
* 例如 用户id等
182+
* 给businessParams key拼接business_前缀,防止与SDK内部参数冲突
182183
*
183-
* @param businessParamsArg 业务参数,不能超过10个
184+
* @param businessParamsArg 业务参数
184185
*/
185186
public void setBusinessParams(Map<String, String> businessParamsArg) {
186-
if (businessParamsArg.size() > 10) {
187-
throw new IllegalArgumentException("The number of businessParams cannot be greater than 10");
188-
}
189187
// 给businessParams key拼接business_前缀,防止与SDK内部参数冲突
190188
businessParams = new HashMap<>();
191189
for (Map.Entry<String, String> entry : businessParamsArg.entrySet()) {

QCloudFoundation/qcloud-track/src/main/java/com/tencent/qcloud/track/utils/NetworkUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static String getNetworkType(Context context) {
114114
case TelephonyManager.NETWORK_TYPE_IWLAN: // api<25: replace by 18
115115
case 19: // LTE_CA
116116
return "4G";
117-
case TelephonyManager.NETWORK_TYPE_NR: // api<29: replace by 20
117+
case 20: // api<29: replace by 20
118118
return "5G";
119119
default:
120120
return "?";
-655 KB
Binary file not shown.
-655 KB
Binary file not shown.

0 commit comments

Comments
 (0)