Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +8 −2 Original line number Diff line number Diff line Loading @@ -808,13 +808,19 @@ public class SystemServicesProxy { * Returns the content description for a given task, badging it if necessary. The content * description joins the app and activity labels. */ public String getBadgedContentDescription(ActivityInfo info, int userId, Resources res) { public String getBadgedContentDescription(ActivityInfo info, int userId, ActivityManager.TaskDescription td, Resources res) { // If we are mocking, then return a mock label if (RecentsDebugFlags.Static.EnableMockTasks) { return "Recent Task Content Description: " + userId; } String activityLabel = info.loadLabel(mPm).toString(); String activityLabel; if (td != null && td.getLabel() != null) { activityLabel = td.getLabel(); } else { activityLabel = info.loadLabel(mPm).toString(); } String applicationLabel = info.applicationInfo.loadLabel(mPm).toString(); String badgedApplicationLabel = getBadgedLabel(applicationLabel, userId); return applicationLabel.equals(activityLabel) ? badgedApplicationLabel Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +2 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,8 @@ public class RecentsTaskLoadPlan { // Load the title, icon, and color ActivityInfo info = loader.getAndUpdateActivityInfo(taskKey); String title = loader.getAndUpdateActivityTitle(taskKey, t.taskDescription); String titleDescription = loader.getAndUpdateContentDescription(taskKey, res); String titleDescription = loader.getAndUpdateContentDescription(taskKey, t.taskDescription, res); String dismissDescription = String.format(dismissDescFormat, titleDescription); String appInfoDescription = String.format(appInfoDescFormat, titleDescription); Drawable icon = isStackTask Loading packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java +11 −3 Original line number Diff line number Diff line Loading @@ -449,7 +449,8 @@ public class RecentsTaskLoader { * Returns the cached task content description if the task key is not expired, updating the * cache if it is. */ String getAndUpdateContentDescription(Task.TaskKey taskKey, Resources res) { String getAndUpdateContentDescription(Task.TaskKey taskKey, ActivityManager.TaskDescription td, Resources res) { SystemServicesProxy ssp = Recents.getSystemServices(); // Return the cached content description if it exists Loading @@ -461,8 +462,15 @@ public class RecentsTaskLoader { // All short paths failed, load the label from the activity info and cache it ActivityInfo activityInfo = getAndUpdateActivityInfo(taskKey); if (activityInfo != null) { label = ssp.getBadgedContentDescription(activityInfo, taskKey.userId, res); label = ssp.getBadgedContentDescription(activityInfo, taskKey.userId, td, res); if (td == null) { // Only add to the cache if the task description is null, otherwise, it is possible // for the task description to change between calls without the last active time // changing (ie. between preloading and Overview starting) which would lead to stale // content descriptions // TODO: Investigate improving this mContentDescriptionCache.put(taskKey, label); } return label; } // If the content description does not exist, return an empty label for now, but do not Loading Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +8 −2 Original line number Diff line number Diff line Loading @@ -808,13 +808,19 @@ public class SystemServicesProxy { * Returns the content description for a given task, badging it if necessary. The content * description joins the app and activity labels. */ public String getBadgedContentDescription(ActivityInfo info, int userId, Resources res) { public String getBadgedContentDescription(ActivityInfo info, int userId, ActivityManager.TaskDescription td, Resources res) { // If we are mocking, then return a mock label if (RecentsDebugFlags.Static.EnableMockTasks) { return "Recent Task Content Description: " + userId; } String activityLabel = info.loadLabel(mPm).toString(); String activityLabel; if (td != null && td.getLabel() != null) { activityLabel = td.getLabel(); } else { activityLabel = info.loadLabel(mPm).toString(); } String applicationLabel = info.applicationInfo.loadLabel(mPm).toString(); String badgedApplicationLabel = getBadgedLabel(applicationLabel, userId); return applicationLabel.equals(activityLabel) ? badgedApplicationLabel Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoadPlan.java +2 −1 Original line number Diff line number Diff line Loading @@ -182,7 +182,8 @@ public class RecentsTaskLoadPlan { // Load the title, icon, and color ActivityInfo info = loader.getAndUpdateActivityInfo(taskKey); String title = loader.getAndUpdateActivityTitle(taskKey, t.taskDescription); String titleDescription = loader.getAndUpdateContentDescription(taskKey, res); String titleDescription = loader.getAndUpdateContentDescription(taskKey, t.taskDescription, res); String dismissDescription = String.format(dismissDescFormat, titleDescription); String appInfoDescription = String.format(appInfoDescFormat, titleDescription); Drawable icon = isStackTask Loading
packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java +11 −3 Original line number Diff line number Diff line Loading @@ -449,7 +449,8 @@ public class RecentsTaskLoader { * Returns the cached task content description if the task key is not expired, updating the * cache if it is. */ String getAndUpdateContentDescription(Task.TaskKey taskKey, Resources res) { String getAndUpdateContentDescription(Task.TaskKey taskKey, ActivityManager.TaskDescription td, Resources res) { SystemServicesProxy ssp = Recents.getSystemServices(); // Return the cached content description if it exists Loading @@ -461,8 +462,15 @@ public class RecentsTaskLoader { // All short paths failed, load the label from the activity info and cache it ActivityInfo activityInfo = getAndUpdateActivityInfo(taskKey); if (activityInfo != null) { label = ssp.getBadgedContentDescription(activityInfo, taskKey.userId, res); label = ssp.getBadgedContentDescription(activityInfo, taskKey.userId, td, res); if (td == null) { // Only add to the cache if the task description is null, otherwise, it is possible // for the task description to change between calls without the last active time // changing (ie. between preloading and Overview starting) which would lead to stale // content descriptions // TODO: Investigate improving this mContentDescriptionCache.put(taskKey, label); } return label; } // If the content description does not exist, return an empty label for now, but do not Loading