Skip to content

Commit

Permalink
fix: 关闭时处理缓存问题,彻底关掉共享式Bugly上报
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahzzhang committed Apr 17, 2024
1 parent 05632d4 commit 50cad7d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/com/tencent/msdk/dns/base/bugly/SharedBugly.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ public class SharedBugly {
public static void init(Context context) {
try {
if (DnsService.getDnsConfig().experimentalBuglyEnable) {
SharedPreferences settings = context.getSharedPreferences("BuglySdkInfos", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit();
editor.putString(appId, appVersion);//必填信息
SharedPreferences sharedPreferences = context.getSharedPreferences("BuglySdkInfos", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(appId, appVersion); //必填信息
editor.commit();
DnsLog.d("shared bugly inited success");
} else {

SharedPreferences sharedPreferences = context.getSharedPreferences("BuglySdkInfos",
Context.MODE_PRIVATE);
if (sharedPreferences.contains(appId)) {
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.remove(appId);
editor.apply();
}
}
} catch (Exception e) {
DnsLog.d("shared bugly inited error " + e);
Expand Down

0 comments on commit 50cad7d

Please sign in to comment.