Skip to content

Commit a4dd301

Browse files
committed
Debug code for window transition crash
https://b.corp.google.com/7060284 - Throw exception before we try to start window transition with null thumb - also remove some old unneeded debug code Change-Id: Ic9693372724cbfaa4c4cb2594128ca10677d9d8f
1 parent e94831e commit a4dd301

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ public View createView(ViewGroup parent) {
164164
public View getView(int position, View convertView, ViewGroup parent) {
165165
if (convertView == null) {
166166
convertView = createView(parent);
167-
if (convertView.getParent() != null) {
168-
throw new RuntimeException("Recycled child has parent");
169-
}
170-
} else {
171-
if (convertView.getParent() != null) {
172-
throw new RuntimeException("Recycled child has parent");
173-
}
174167
}
175168
ViewHolder holder = (ViewHolder) convertView.getTag();
176169

@@ -600,6 +593,9 @@ public void handleOnClick(View view) {
600593
usingDrawingCache = true;
601594
}
602595

596+
if (bm == null) {
597+
throw new RuntimeException("Recents thumbnail is null");
598+
}
603599
ActivityOptions opts = ActivityOptions.makeThumbnailScaleUpAnimation(
604600
holder.thumbnailViewImage, bm, 0, 0, null);
605601

packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,18 @@ protected void toggleRecentsActivity() {
488488
.getDimensionPixelSize(R.dimen.status_bar_recents_thumbnail_width);
489489
float thumbHeight = res
490490
.getDimensionPixelSize(R.dimen.status_bar_recents_thumbnail_height);
491+
if (first == null) {
492+
throw new RuntimeException("Recents thumbnail is null");
493+
}
491494
if (first.getWidth() != thumbWidth || first.getHeight() != thumbHeight) {
492495
first = Bitmap.createScaledBitmap(first, (int) thumbWidth, (int) thumbHeight,
493496
true);
497+
if (first == null) {
498+
throw new RuntimeException("Recents thumbnail is null");
499+
}
494500
}
495501

502+
496503
DisplayMetrics dm = new DisplayMetrics();
497504
mDisplay.getMetrics(dm);
498505
// calculate it here, but consider moving it elsewhere
@@ -521,8 +528,7 @@ protected void toggleRecentsActivity() {
521528
+ thumbBgPadding + thumbLeftMargin);
522529
y = (int) (dm.heightPixels
523530
- res.getDimensionPixelSize(R.dimen.status_bar_recents_thumbnail_height) - thumbBgPadding);
524-
} else { // if (config.orientation ==
525-
// Configuration.ORIENTATION_LANDSCAPE) {
531+
} else { // if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
526532
float thumbTopMargin = res
527533
.getDimensionPixelSize(R.dimen.status_bar_recents_thumbnail_top_margin);
528534
float thumbBgPadding = res

0 commit comments

Comments
 (0)