version:1.3.5
fix: update:增加学习资源下载,修复退出桌面再进入卡顿,增加语音助手
This commit is contained in:
@@ -21,6 +21,7 @@ import com.uiui.zyos.BuildConfig;
|
||||
import com.uiui.zyos.R;
|
||||
import com.uiui.zyos.bean.DesktopIcon;
|
||||
import com.uiui.zyos.config.CommonConfig;
|
||||
import com.uiui.zyos.manager.RemoteManager;
|
||||
import com.uiui.zyos.receiver.InstallResultReceiver;
|
||||
|
||||
import java.io.File;
|
||||
@@ -93,26 +94,27 @@ public class ApkUtils {
|
||||
|
||||
private static HashSet<String> showPackageName = new HashSet<String>() {{
|
||||
this.add("com.android.dialer");
|
||||
this.add("com.android.gallery3d");
|
||||
this.add("com.android.settings");
|
||||
// this.add("com.android.gallery3d");
|
||||
// this.add("com.android.settings");
|
||||
this.add("com.android.messaging");
|
||||
this.add("com.android.camera2");
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.android.mms");
|
||||
this.add("com.uiui.city");
|
||||
this.add("com.android.fmradio");
|
||||
this.add("com.android.documentsui");
|
||||
// this.add("com.uiui.city");
|
||||
// this.add("com.android.fmradio");
|
||||
// this.add("com.android.documentsui");
|
||||
this.add("com.android.calculator2");
|
||||
this.add("cn.wps.moffice_eng");
|
||||
this.add("com.baidu.searchbox.lite");
|
||||
this.add("com.ss.android.article.video");
|
||||
this.add("com.ss.android.ugc.aweme");
|
||||
this.add("com.smile.gifmaker");
|
||||
this.add("com.kuaikan.comic");
|
||||
this.add("com.jxw.launcher");
|
||||
this.add("com.tencent.android.qqdownloader");
|
||||
this.add("com.alldocube.store");
|
||||
this.add("com.android.calendar");
|
||||
// this.add("cn.wps.moffice_eng");
|
||||
// this.add("com.baidu.searchbox.lite");
|
||||
// this.add("com.ss.android.article.video");
|
||||
// this.add("com.ss.android.ugc.aweme");
|
||||
// this.add("com.smile.gifmaker");
|
||||
// this.add("com.kuaikan.comic");
|
||||
// this.add("com.jxw.launcher");
|
||||
// this.add("com.tencent.android.qqdownloader");
|
||||
// this.add("com.alldocube.store");
|
||||
// this.add("com.android.calendar");
|
||||
this.add("com.mediatek.camera");
|
||||
this.add("com.uiui.zybrowser");
|
||||
}};
|
||||
private static HashSet<String> allHintPackage = new HashSet<String>() {{
|
||||
this.add("com.android.uiuios");
|
||||
@@ -120,6 +122,7 @@ public class ApkUtils {
|
||||
|
||||
public static final String ANDROID_LAUNCHER3_PACKAGE_NAME = "com.android.launcher3";
|
||||
public static final String ANDROID_LAUNCHER3_CLASS_NAME = "com.android.launcher3.Launcher";
|
||||
public static final String ANDROID_LAUNCHER3_Quickstep_CLASS_NAME = "com.android.launcher3.uioverrides.QuickstepLauncher";
|
||||
|
||||
private static String TAG = ApkUtils.class.getSimpleName();
|
||||
|
||||
@@ -198,7 +201,7 @@ public class ApkUtils {
|
||||
Set<String> allowPackages = new HashSet();
|
||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||
Log.i(TAG, "queryFilterAppInfo: " + resolveInfo.activityInfo.packageName);
|
||||
Log.i(TAG, "queryFilterAppInfo: " + resolveInfo.activityInfo.name);
|
||||
Log.i(TAG, "queryFilterAppInfo: class: " + resolveInfo.activityInfo.name);
|
||||
allowPackages.add(resolveInfo.activityInfo.packageName);
|
||||
}
|
||||
String appListString = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
|
||||
@@ -206,26 +209,34 @@ public class ApkUtils {
|
||||
if (!TextUtils.isEmpty(appListString)) {
|
||||
packageList = new ArrayList<>(Arrays.asList(appListString.split(",")));
|
||||
}
|
||||
int setting_other_appInstaller = Settings.Global.getInt(context.getContentResolver(), CommonConfig.SETTING_OTHER_APPINSTALLER_KEY, 1);
|
||||
List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
||||
Log.i(TAG, "queryFilterAppInfo: adminapp = " + adminApp);
|
||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||
String pkg = resolveInfo.activityInfo.packageName;
|
||||
if (appIsDisable(context, pkg)) {
|
||||
Log.e(TAG, "queryFilterAppInfo: disable = " + pkg);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isSystemApp(context, pkg))//通过flag排除系统应用,会将电话、短信也排除掉
|
||||
{
|
||||
// if (showPackageName.contains(pkg)) {
|
||||
// resolveInfos.add(resolveInfo);
|
||||
// }
|
||||
if (showPackageName.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
} else {
|
||||
// int setting_other_appInstaller = Settings.Global.getInt(context.getContentResolver(), CommonConfig.SETTING_OTHER_APPINSTALLER_KEY, 1);
|
||||
// if (setting_other_appInstaller == 0) {//不显示自己安装的
|
||||
// if (packageList.contains(pkg)) {
|
||||
// resolveInfos.add(resolveInfo);
|
||||
// }
|
||||
// } else {
|
||||
|
||||
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
if (adminApp.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
} else if (showPackageName.contains(pkg)) {
|
||||
resolveInfos.add(resolveInfo);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
@@ -378,6 +389,7 @@ public class ApkUtils {
|
||||
context.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "openPackage: " + e.getMessage());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -592,9 +604,19 @@ public class ApkUtils {
|
||||
}
|
||||
|
||||
public static void gotoLauncher(Context context) {
|
||||
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //android123提示如果是服务里调用,必须加入new task标识
|
||||
i.addCategory(Intent.CATEGORY_HOME);
|
||||
context.startActivity(i);
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
|
||||
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
|
||||
homeIntent.setPackage("com.android.launcher3");
|
||||
homeIntent.addCategory(Intent.CATEGORY_HOME);
|
||||
homeIntent.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(homeIntent);
|
||||
} else {
|
||||
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //android123提示如果是服务里调用,必须加入new task标识
|
||||
i.addCategory(Intent.CATEGORY_HOME);
|
||||
i.addCategory(Intent.CATEGORY_DEFAULT);
|
||||
context.startActivity(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user