version:4.5

fix:
update:优化爱华解锁
This commit is contained in:
2022-06-21 10:58:13 +08:00
parent 086677f4c4
commit 4f0685cfcd
5 changed files with 13 additions and 6 deletions

View File

@@ -1289,7 +1289,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
if (appPasswdBeans != null) {
for (AppPasswdBean bean : appPasswdBeans) {
Log.e(TAG, "removeRecentTask: " + bean.getApp_package());
Utils.removeTask(bean.getApp_package());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
Utils.removeTask(bean.getApp_package());
}
}
}
}

View File

@@ -316,18 +316,18 @@ public class LoaderTask implements Runnable {
final List<UserHandle> profiles = mUserManager.getUserProfiles();
String whiteList = Settings.System.getString(crv, JGYActions.ACTION_JGY_SHORTCUTLIST);
Log.e("verifyApplications", "whiteList: " + whiteList);
int aihuaUnlock = Settings.Global.getInt(context.getContentResolver(), "Aihua_unlock_state", 0);
Log.e(TAG, "verifyApplications: aihuaUnlock = " + aihuaUnlock);
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) {
Log.e("verifyApplications", "AllAPP: " + app.getApplicationInfo().packageName);
if (BuildConfig.APPLICATION_ID.equals(app.getApplicationInfo().packageName))
continue;
/*系统应用*/
int aihuaUnlock = Settings.Global.getInt(context.getContentResolver(), "Aihua_unlock_state", 0);
if (JGYUtils.getInstance().getDeviceIsLocked() || aihuaUnlock == 1) {
if (JGYUtils.getInstance().getDeviceIsLocked() && aihuaUnlock != 1) {
if ((app.getApplicationFlags() & ApplicationInfo.FLAG_SYSTEM) == 1) {
if (!showApp.contains(app.getApplicationInfo().packageName)) {
Log.e("verifyApplications", "skip1: " + app.getApplicationInfo().packageName);

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.ActivityManagerNative;
import android.app.ActivityTaskManager;
import android.app.IActivityTaskManager;
import android.content.Context;
import android.content.pm.UserInfo;
import android.os.Build;
@@ -99,9 +100,10 @@ public class Utils {
*/
public static List<ActivityManager.RecentTaskInfo> getRecentTasks(int numTasks, int userId) {
try {
return ActivityTaskManager.getService().getRecentTasks(numTasks,
IActivityTaskManager iActivityTaskManager = ActivityTaskManager.getService();
return iActivityTaskManager.getRecentTasks(numTasks,
RECENT_IGNORE_UNAVAILABLE, userId).getList();
} catch (RemoteException e) {
} catch (Exception e) {
Log.e(TAG, "Failed to get recent tasks " + e);
return new ArrayList<>();
}