diff options
| author | 2015-07-31 19:43:30 +0000 | |
|---|---|---|
| committer | 2015-07-31 19:43:30 +0000 | |
| commit | 183b589fd4e3381a5f64f2782f3fffad9dd25b0e (patch) | |
| tree | 4cc30d534c9647b9ffada0ddb98502b80078926b | |
| parent | 923850304a00d337e8bd76000c8ff480df25e7e2 (diff) | |
| parent | 92e0c86fa2b84619ebc3acb6d91434dd17113c61 (diff) | |
am 92e0c86f: Merge "Ensuring that we don\'t try to use and propagate null activity labels." into mnc-dev
* commit '92e0c86fa2b84619ebc3acb6d91434dd17113c61':
Ensuring that we don't try to use and propagate null activity labels.
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java | 15 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java | 2 |
2 files changed, 14 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java index b2aa2b67c574..ad25c85860ed 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/model/RecentsTaskLoader.java @@ -343,11 +343,14 @@ public class RecentsTaskLoader { if (infoHandle.info != null) { label = ssp.getActivityLabel(infoHandle.info); mActivityLabelCache.put(taskKey, label); + return label; } else { Log.w(TAG, "Missing ActivityInfo for " + taskKey.baseIntent.getComponent() + " u=" + taskKey.userId); } - return label; + // If the activity info does not exist or fails to load, return an empty label for now, + // but do not cache it + return ""; } /** Returns the content description using as many cached values as we can. */ @@ -358,14 +361,22 @@ public class RecentsTaskLoader { if (label != null) { return label; } + // If the given activity label is empty, don't compute or cache the content description + if (activityLabel.isEmpty()) { + return ""; + } + label = ssp.getContentDescription(taskKey.baseIntent, taskKey.userId, activityLabel, res); if (label != null) { mContentDescriptionCache.put(taskKey, label); + return label; } else { Log.w(TAG, "Missing content description for " + taskKey.baseIntent.getComponent() + " u=" + taskKey.userId); } - return label; + // If the content description does not exist, return an empty label for now, but do not + // cache it + return ""; } /** Returns the activity icon using as many cached values as we can. */ diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java index 78b351279f6e..2e0b80a9a512 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java @@ -316,7 +316,7 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { overscrollRange); // Invalidate to kick off computeScroll mSv.invalidate(); - } else if (mScroller.isScrollOutOfBounds()) { + } else if (mIsScrolling && mScroller.isScrollOutOfBounds()) { // Animate the scroll back into bounds mScroller.animateBoundScroll(); } else if (mActiveTaskView == null) { |