Fixing crash.

am: f21c3dac

* commit 'f21c3dace89b168f5e5e4e96532d977b8b0a1cf5':
  Fixing crash.

Change-Id: Ic5bec6333691edf57eb99387167f3e7dc00fa999
This commit is contained in:
Winson
2016-04-14 01:37:16 +00:00
committed by android-build-merger
3 changed files with 12 additions and 2 deletions

View File

@@ -315,6 +315,15 @@ public class Task {
return key.id != affiliationTaskId;
}
/**
* Returns the top activity component.
*/
public ComponentName getTopComponent() {
return topActivity != null
? topActivity
: key.baseIntent.getComponent();
}
@Override
public boolean equals(Object o) {
// Check that the id matches

View File

@@ -541,7 +541,7 @@ public class RecentsView extends FrameLayout {
true /* scaleUp */);
MetricsLogger.action(mContext, MetricsEvent.ACTION_WINDOW_DOCK_DRAG_DROP,
event.task.topActivity.flattenToShortString());
event.task.getTopComponent().flattenToShortString());
} else {
// Animate the overlay alpha back to 0
updateVisibleDockRegions(null, true /* isDefaultDockState */, -1,

View File

@@ -162,7 +162,8 @@ public class RecentsViewTouchHandler {
mVisibleDockStates.clear();
if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()
&& mDividerSnapAlgorithm.isSplitScreenFeasible()) {
Recents.logDockAttempt(mRv.getContext(), event.task.topActivity, event.task.resizeMode);
Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(),
event.task.resizeMode);
if (!event.task.isDockable) {
EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
} else {