Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +5 −7 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,7 @@ public class RecentsTaskLoadPlan { Context mContext; Context mContext; int mPreloadedUserId; List<ActivityManager.RecentTaskInfo> mRawTasks; List<ActivityManager.RecentTaskInfo> mRawTasks; TaskStack mStack; TaskStack mStack; ArraySet<Integer> mCurrentQuietProfiles = new ArraySet<Integer>(); ArraySet<Integer> mCurrentQuietProfiles = new ArraySet<Integer>(); Loading @@ -83,9 +84,6 @@ public class RecentsTaskLoadPlan { private void updateCurrentQuietProfilesCache(int currentUserId) { private void updateCurrentQuietProfilesCache(int currentUserId) { mCurrentQuietProfiles.clear(); mCurrentQuietProfiles.clear(); if (currentUserId == UserHandle.USER_CURRENT) { currentUserId = SystemServicesProxy.getInstance(mContext).getCurrentUser(); } UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); List<UserInfo> profiles = userManager.getProfiles(currentUserId); List<UserInfo> profiles = userManager.getProfiles(currentUserId); if (profiles != null) { if (profiles != null) { Loading @@ -105,9 +103,10 @@ public class RecentsTaskLoadPlan { * Note: Do not lock, callers should synchronize on the loader before making this call. * Note: Do not lock, callers should synchronize on the loader before making this call. */ */ void preloadRawTasks(boolean includeFrontMostExcludedTask) { void preloadRawTasks(boolean includeFrontMostExcludedTask) { int currentUserId = UserHandle.USER_CURRENT; updateCurrentQuietProfilesCache(currentUserId); SystemServicesProxy ssp = Recents.getSystemServices(); SystemServicesProxy ssp = Recents.getSystemServices(); int currentUserId = ssp.getCurrentUser(); updateCurrentQuietProfilesCache(currentUserId); mPreloadedUserId = currentUserId; mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(), mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(), currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles); currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles); Loading Loading @@ -135,7 +134,6 @@ public class RecentsTaskLoadPlan { preloadRawTasks(includeFrontMostExcludedTask); preloadRawTasks(includeFrontMostExcludedTask); } } SystemServicesProxy ssp = SystemServicesProxy.getInstance(mContext); SparseArray<Task.TaskKey> affiliatedTasks = new SparseArray<>(); SparseArray<Task.TaskKey> affiliatedTasks = new SparseArray<>(); SparseIntArray affiliatedTaskCounts = new SparseIntArray(); SparseIntArray affiliatedTaskCounts = new SparseIntArray(); SparseBooleanArray lockedUsers = new SparseBooleanArray(); SparseBooleanArray lockedUsers = new SparseBooleanArray(); Loading @@ -143,7 +141,7 @@ public class RecentsTaskLoadPlan { R.string.accessibility_recents_item_will_be_dismissed); R.string.accessibility_recents_item_will_be_dismissed); String appInfoDescFormat = mContext.getString( String appInfoDescFormat = mContext.getString( R.string.accessibility_recents_item_open_app_info); R.string.accessibility_recents_item_open_app_info); int currentUserId = ssp.getCurrentUser(); int currentUserId = mPreloadedUserId; long legacyLastStackActiveTime = migrateLegacyLastStackActiveTime(currentUserId); long legacyLastStackActiveTime = migrateLegacyLastStackActiveTime(currentUserId); long lastStackActiveTime = Settings.Secure.getLongForUser(mContext.getContentResolver(), long lastStackActiveTime = Settings.Secure.getLongForUser(mContext.getContentResolver(), Secure.OVERVIEW_LAST_STACK_ACTIVE_TIME, legacyLastStackActiveTime, currentUserId); Secure.OVERVIEW_LAST_STACK_ACTIVE_TIME, legacyLastStackActiveTime, currentUserId); Loading Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +5 −7 Original line number Original line Diff line number Diff line Loading @@ -71,6 +71,7 @@ public class RecentsTaskLoadPlan { Context mContext; Context mContext; int mPreloadedUserId; List<ActivityManager.RecentTaskInfo> mRawTasks; List<ActivityManager.RecentTaskInfo> mRawTasks; TaskStack mStack; TaskStack mStack; ArraySet<Integer> mCurrentQuietProfiles = new ArraySet<Integer>(); ArraySet<Integer> mCurrentQuietProfiles = new ArraySet<Integer>(); Loading @@ -83,9 +84,6 @@ public class RecentsTaskLoadPlan { private void updateCurrentQuietProfilesCache(int currentUserId) { private void updateCurrentQuietProfilesCache(int currentUserId) { mCurrentQuietProfiles.clear(); mCurrentQuietProfiles.clear(); if (currentUserId == UserHandle.USER_CURRENT) { currentUserId = SystemServicesProxy.getInstance(mContext).getCurrentUser(); } UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); List<UserInfo> profiles = userManager.getProfiles(currentUserId); List<UserInfo> profiles = userManager.getProfiles(currentUserId); if (profiles != null) { if (profiles != null) { Loading @@ -105,9 +103,10 @@ public class RecentsTaskLoadPlan { * Note: Do not lock, callers should synchronize on the loader before making this call. * Note: Do not lock, callers should synchronize on the loader before making this call. */ */ void preloadRawTasks(boolean includeFrontMostExcludedTask) { void preloadRawTasks(boolean includeFrontMostExcludedTask) { int currentUserId = UserHandle.USER_CURRENT; updateCurrentQuietProfilesCache(currentUserId); SystemServicesProxy ssp = Recents.getSystemServices(); SystemServicesProxy ssp = Recents.getSystemServices(); int currentUserId = ssp.getCurrentUser(); updateCurrentQuietProfilesCache(currentUserId); mPreloadedUserId = currentUserId; mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(), mRawTasks = ssp.getRecentTasks(ActivityManager.getMaxRecentTasksStatic(), currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles); currentUserId, includeFrontMostExcludedTask, mCurrentQuietProfiles); Loading Loading @@ -135,7 +134,6 @@ public class RecentsTaskLoadPlan { preloadRawTasks(includeFrontMostExcludedTask); preloadRawTasks(includeFrontMostExcludedTask); } } SystemServicesProxy ssp = SystemServicesProxy.getInstance(mContext); SparseArray<Task.TaskKey> affiliatedTasks = new SparseArray<>(); SparseArray<Task.TaskKey> affiliatedTasks = new SparseArray<>(); SparseIntArray affiliatedTaskCounts = new SparseIntArray(); SparseIntArray affiliatedTaskCounts = new SparseIntArray(); SparseBooleanArray lockedUsers = new SparseBooleanArray(); SparseBooleanArray lockedUsers = new SparseBooleanArray(); Loading @@ -143,7 +141,7 @@ public class RecentsTaskLoadPlan { R.string.accessibility_recents_item_will_be_dismissed); R.string.accessibility_recents_item_will_be_dismissed); String appInfoDescFormat = mContext.getString( String appInfoDescFormat = mContext.getString( R.string.accessibility_recents_item_open_app_info); R.string.accessibility_recents_item_open_app_info); int currentUserId = ssp.getCurrentUser(); int currentUserId = mPreloadedUserId; long legacyLastStackActiveTime = migrateLegacyLastStackActiveTime(currentUserId); long legacyLastStackActiveTime = migrateLegacyLastStackActiveTime(currentUserId); long lastStackActiveTime = Settings.Secure.getLongForUser(mContext.getContentResolver(), long lastStackActiveTime = Settings.Secure.getLongForUser(mContext.getContentResolver(), Secure.OVERVIEW_LAST_STACK_ACTIVE_TIME, legacyLastStackActiveTime, currentUserId); Secure.OVERVIEW_LAST_STACK_ACTIVE_TIME, legacyLastStackActiveTime, currentUserId); Loading