version:1.1.5
update: bugfixes:优化闹钟自动接听
This commit is contained in:
@@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.activity.main.MainActivity;
|
||||
import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
|
||||
@@ -35,11 +36,16 @@ public class AppStatusManager {
|
||||
this.add("com.android.documentsui");
|
||||
this.add("com.android.calculator2");
|
||||
this.add("com.android.calendar");
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.android.settings");
|
||||
}};
|
||||
|
||||
private static final Set<String> mExcludeApp = new HashSet<String>() {{
|
||||
this.add("com.android.contacts");
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.mediatek.camera");
|
||||
}};
|
||||
|
||||
|
||||
private AppStatusManager(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
@@ -70,13 +76,13 @@ public class AppStatusManager {
|
||||
public void addHidedApp(String pkg) {
|
||||
this.hidedAppSet.add(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public void removeHidedApp(String pkg) {
|
||||
this.hidedAppSet.remove(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
mContext.sendBroadcast(new Intent(MainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public List<DailyAppBean> getPackageList() {
|
||||
@@ -89,6 +95,9 @@ public class AppStatusManager {
|
||||
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
|
||||
for (ResolveInfo packageInfo : resolveinfoList) {
|
||||
String pkg = packageInfo.activityInfo.packageName;
|
||||
if (mExcludeApp.contains(pkg)) {
|
||||
continue;
|
||||
}
|
||||
if (hidedAppSet.contains(pkg)) {
|
||||
Log.e(TAG, "getPackageList: " + pkg);
|
||||
DailyAppBean appSelectBean = new DailyAppBean(packageInfo.activityInfo.loadLabel(pm).toString(),
|
||||
|
||||
Reference in New Issue
Block a user