version:4.4

fix:优化解锁后的app显示
update:
This commit is contained in:
tt committed 2022-04-20 16:02:43 +08:00
1 parent 9f6c360a9a
commit 7903e3c21b
7 files changed
+67 -20

No files matched your search

+3 -9
View File
@@ -56,6 +56,7 @@ import com.aoleyun.os.LauncherModel;
import com.aoleyun.os.LauncherSettings;
import com.aoleyun.os.WorkspaceItemInfo;
import com.aoleyun.os.Utilities;
import com.aoleyun.os.comm.JGYActions;
import com.aoleyun.os.compat.AppWidgetManagerCompat;
import com.aoleyun.os.compat.LauncherAppsCompat;
import com.aoleyun.os.compat.PackageInstallerCompat;
@@ -307,15 +308,8 @@ public class LoaderTask implements Runnable {
ContentResolver crv = context.getContentResolver();
ArrayList<Pair<ItemInfo, Object>> installQueue = new ArrayList<>();
final List<UserHandle> profiles = mUserManager.getUserProfiles();
String whiteList = Settings.System.getString(crv, "only_jgy_shortcut_list");
String whiteList = Settings.System.getString(crv, JGYActions.ACTION_JGY_SHORTCUTLIST);
Log.e("verifyApplications", "whiteList: " + whiteList);
int qch_unlock_ipad = Settings.System.getInt(crv, "qch_unlock_ipad", 0);
Log.e("verifyApplications", "qch_unlock_ipad: " + qch_unlock_ipad);
int desktop_clear = Settings.Global.getInt(crv, "desktop_clear", 0);
if (qch_unlock_ipad == 1 && desktop_clear != 1) {
Settings.Global.putInt(crv, "desktop_clear", 1);
JGYUtils.getInstance().cleanAoleLauncher3Cache();
}
for (UserHandle user : profiles) {
final List<LauncherActivityInfo> apps = mLauncherApps.getActivityList(null, user);
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added = new ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo>();
@@ -326,7 +320,7 @@ public class LoaderTask implements Runnable {
if (BuildConfig.APPLICATION_ID.equals(app.getApplicationInfo().packageName))
continue;
/*系统应用*/
if (qch_unlock_ipad == 0) {
if (JGYUtils.getInstance().getDeviceIsLocked()) {
if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
if (!showApp.contains(app.getApplicationInfo().packageName)) {
Log.e("verifyApplications", "skip1: " + app.getApplicationInfo().packageName);
@@ -45,6 +45,7 @@ import com.aoleyun.os.icons.BitmapInfo;
import com.aoleyun.os.icons.LauncherIcons;
import com.aoleyun.os.logging.FileLog;
import com.aoleyun.os.shortcuts.DeepShortcutManager;
import com.aoleyun.os.uiuiutils.JGYUtils;
import com.aoleyun.os.util.FlagOp;
import com.aoleyun.os.util.IntSparseArrayMap;
import com.aoleyun.os.util.ItemInfoMatcher;
@@ -104,7 +105,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
case OP_ADD: {
for (int i = 0; i < N; i++) {
if (DEBUG) Log.e(TAG, "mAllAppsList.addPackage " + packages[i]);
if (hideAppList.contains(packages[i])) continue;
if (JGYUtils.getInstance().getDeviceIsLocked()) {
if (hideAppList.contains(packages[i])) continue;
}
iconCache.updateIconsForPkg(packages[i], mUser);
if (FeatureFlags.LAUNCHER3_PROMISE_APPS_IN_ALL_APPS) {
appsList.removePackage(packages[i], Process.myUserHandle());
@@ -326,7 +329,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
} else if (mOp == OP_UPDATE) {
// Mark disabled packages in the broadcast to be removed
final LauncherAppsCompat launcherApps = LauncherAppsCompat.getInstance(context);
for (int i=0; i<N; i++) {
for (int i = 0; i < N; i++) {
if (!launcherApps.isPackageEnabledForProfile(packages[i], mUser)) {
removedPackages.add(packages[i]);
}
@@ -364,7 +367,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
}
//add for load new install app on workspace
public void updateToWorkSpace(Context context, LauncherAppState app , AllAppsList appsList){
public void updateToWorkSpace(Context context, LauncherAppState app, AllAppsList appsList) {
ArrayList<Pair<ItemInfo, Object>> installQueue = new ArrayList<>();
final List<UserHandle> profiles = UserManagerCompat.getInstance(context).getUserProfiles();
ArrayList<InstallShortcutReceiver.PendingInstallShortcutInfo> added
@@ -375,9 +378,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
synchronized (this) {
for (LauncherActivityInfo info : apps) {
for (AppInfo appInfo : appsList.added) {
if(info.getComponentName().equals(appInfo.componentName)){
if (info.getComponentName().equals(appInfo.componentName)) {
InstallShortcutReceiver.PendingInstallShortcutInfo mPendingInstallShortcutInfo
= new InstallShortcutReceiver.PendingInstallShortcutInfo(info,context);
= new InstallShortcutReceiver.PendingInstallShortcutInfo(info, context);
added.add(mPendingInstallShortcutInfo);
installQueue.add(mPendingInstallShortcutInfo.getItemInfo());
}
@@ -392,10 +395,11 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
/**
* Updates {@param si}'s intent to point to a new ComponentName.
*
* @return Whether the shortcut intent was changed.
*/
private boolean updateWorkspaceItemIntent(Context context,
WorkspaceItemInfo si, String packageName) {
WorkspaceItemInfo si, String packageName) {
// Try to find the best match activity.
Intent intent = new PackageManagerHelper(context).getAppLaunchIntent(packageName, mUser);
if (intent != null) {