version:2.4

fix:更换图标,修改桌面隐藏其他应用
add:
This commit is contained in:
2022-02-22 10:10:02 +08:00
parent 6f409d2922
commit c67024dde5
22 changed files with 700 additions and 648 deletions

View File

@@ -35,6 +35,8 @@ import android.content.pm.ShortcutInfo;
import android.os.Handler;
import android.os.Process;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.SettingsValidators;
import android.text.TextUtils;
import android.util.Log;
import android.util.LongSparseArray;
@@ -274,8 +276,8 @@ public class LoaderTask implements Runnable {
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
//system
this.add("com.android.documentsui");
this.add("com.android.messaging");
// this.add("com.android.documentsui");
// this.add("com.android.messaging");
this.add("com.android.music");
this.add("com.android.camera");
this.add("com.android.camera2");
@@ -296,16 +298,26 @@ public class LoaderTask implements Runnable {
final Context context = mApp.getContext();
ArrayList<Pair<ItemInfo, Object>> installQueue = new ArrayList<>();
final List<UserHandle> profiles = mUserManager.getUserProfiles();
String whiteList = Settings.System.getString(context.getContentResolver(), "only_jgy_shortcut_list");
for (UserHandle user : profiles) {
final List<LauncherActivityInfo> apps = mLauncherApps.getActivityList(null, user);
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added = new ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo>();
synchronized (this) {
for (LauncherActivityInfo app : apps) {
if (BuildConfig.APPLICATION_ID.equals(app.getApplicationInfo().packageName))
continue;
Log.e(TAG, "verifyApplications: " + app.getApplicationInfo().packageName);
/*系统应用*/
if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
if (!showApp.contains(app.getApplicationInfo().packageName)) {
continue;
}
} else {
if (TextUtils.isEmpty(whiteList)) {
continue;
} else if (!whiteList.contains(app.getApplicationInfo().packageName)){
continue;
}
}
InstallShortcutReceiver.PendingInstallShortcutInfo pendingInstallShortcutInfo = new InstallShortcutReceiver.PendingInstallShortcutInfo(app, context);
added.add(pendingInstallShortcutInfo);