package com.xiaomi.push.service; import android.content.Context; import android.content.SharedPreferences; import android.text.TextUtils; import com.xiaomi.mipush.sdk.Constants; import com.xiaomi.push.bp; import java.util.ArrayList; import java.util.List; public class t { private static t a; /* renamed from: a reason: collision with other field name */ private Context f7633a; /* renamed from: a reason: collision with other field name */ private List<String> f7634a = new ArrayList(); private final List<String> b = new ArrayList(); private final List<String> c = new ArrayList(); private t(Context context) { Context applicationContext = context.getApplicationContext(); this.f7633a = applicationContext; if (applicationContext == null) { this.f7633a = context; } SharedPreferences sharedPreferences = this.f7633a.getSharedPreferences("mipush_app_info", 0); String[] split = sharedPreferences.getString("unregistered_pkg_names", "").split(Constants.ACCEPT_TIME_SEPARATOR_SP); for (String str : split) { if (TextUtils.isEmpty(str)) { this.f7634a.add(str); } } String[] split2 = sharedPreferences.getString("disable_push_pkg_names", "").split(Constants.ACCEPT_TIME_SEPARATOR_SP); for (String str2 : split2) { if (!TextUtils.isEmpty(str2)) { this.b.add(str2); } } String[] split3 = sharedPreferences.getString("disable_push_pkg_names_cache", "").split(Constants.ACCEPT_TIME_SEPARATOR_SP); for (String str3 : split3) { if (!TextUtils.isEmpty(str3)) { this.c.add(str3); } } } public static t a(Context context) { if (a == null) { a = new t(context); } return a; } public void a(String str) { synchronized (this.f7634a) { if (!this.f7634a.contains(str)) { this.f7634a.add(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("unregistered_pkg_names", bp.a(this.f7634a, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } /* renamed from: a reason: collision with other method in class */ public boolean m9742a(String str) { boolean contains; synchronized (this.f7634a) { contains = this.f7634a.contains(str); } return contains; } public void b(String str) { synchronized (this.b) { if (!this.b.contains(str)) { this.b.add(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("disable_push_pkg_names", bp.a(this.b, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } /* renamed from: b reason: collision with other method in class */ public boolean m9743b(String str) { boolean contains; synchronized (this.b) { contains = this.b.contains(str); } return contains; } public void c(String str) { synchronized (this.c) { if (!this.c.contains(str)) { this.c.add(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("disable_push_pkg_names_cache", bp.a(this.c, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } /* renamed from: c reason: collision with other method in class */ public boolean m9744c(String str) { boolean contains; synchronized (this.c) { contains = this.c.contains(str); } return contains; } public void d(String str) { synchronized (this.f7634a) { if (this.f7634a.contains(str)) { this.f7634a.remove(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("unregistered_pkg_names", bp.a(this.f7634a, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } public void e(String str) { synchronized (this.b) { if (this.b.contains(str)) { this.b.remove(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("disable_push_pkg_names", bp.a(this.b, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } public void f(String str) { synchronized (this.c) { if (this.c.contains(str)) { this.c.remove(str); this.f7633a.getSharedPreferences("mipush_app_info", 0).edit().putString("disable_push_pkg_names_cache", bp.a(this.c, Constants.ACCEPT_TIME_SEPARATOR_SP)).commit(); } } } }