Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +15 −24 Original line number Original line Diff line number Diff line Loading @@ -550,41 +550,32 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable { public void removeFromTransientContainerForAdditionTo(ViewGroup newParent) { public void removeFromTransientContainerForAdditionTo(ViewGroup newParent) { final ViewParent parent = getParent(); final ViewParent parent = getParent(); final ViewGroup transientContainer = getTransientContainer(); final ViewGroup transientContainer = getTransientContainer(); if (parent == null) { if (parent == null || parent == newParent) { // If this view has no parent, the add will succeed, so just make sure the tracked // If this view's current parent is null or the same as the new parent, the add will // transient container is in sync with the lack of a parent. // succeed, so just make sure the tracked transient container is in sync with the if (transientContainer != null) { // current parent. if (transientContainer != null && transientContainer != parent) { Log.w(TAG, "Expandable view " + this Log.w(TAG, "Expandable view " + this + " has transient container " + transientContainer + " has transient container " + transientContainer + " but no parent"); + " but different parent" + parent); setTransientContainer(null); setTransientContainer(null); } } return; return; } } if (transientContainer == null) { if (transientContainer == null) { throw new IllegalStateException( throw new IllegalStateException("Can't add view " + this + " to container " + newParent "Can't add view " + this + " to container " + newParent + "; current parent " + "; current parent " + parent + " is not a transient container"); + parent + " is not a transient container"); } } if (transientContainer != parent) { if (transientContainer != parent) { String transientContainerOutOfSyncError = "Expandable view " + this + " has transient container " + transientContainer + " but different parent " + parent; if (parent != newParent) { // Crash with details before addView() crashes without any; the view is being added // Crash with details before addView() crashes without any; the view is being added // to a different parent, and the transient container isn't the parent, so we can't // to a different parent, and the transient container isn't the parent, so we can't // even (safely) clean that up. // even (safely) clean that up. throw new IllegalStateException(transientContainerOutOfSyncError); throw new IllegalStateException("Expandable view " + this } else { + " has transient container " + transientContainer Log.w(TAG, transientContainerOutOfSyncError); + " but different parent " + parent); setTransientContainer(null); return; } } if (parent != newParent) { Log.w(TAG, "Moving view " + this + " from transient container " + transientContainer + " to parent " + newParent); } } Log.w(TAG, "Removing view " + this + " from transient container " + transientContainer + " in preparation for moving to parent " + newParent); transientContainer.removeTransientView(this); transientContainer.removeTransientView(this); setTransientContainer(null); setTransientContainer(null); } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableView.java +15 −24 Original line number Original line Diff line number Diff line Loading @@ -550,41 +550,32 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable { public void removeFromTransientContainerForAdditionTo(ViewGroup newParent) { public void removeFromTransientContainerForAdditionTo(ViewGroup newParent) { final ViewParent parent = getParent(); final ViewParent parent = getParent(); final ViewGroup transientContainer = getTransientContainer(); final ViewGroup transientContainer = getTransientContainer(); if (parent == null) { if (parent == null || parent == newParent) { // If this view has no parent, the add will succeed, so just make sure the tracked // If this view's current parent is null or the same as the new parent, the add will // transient container is in sync with the lack of a parent. // succeed, so just make sure the tracked transient container is in sync with the if (transientContainer != null) { // current parent. if (transientContainer != null && transientContainer != parent) { Log.w(TAG, "Expandable view " + this Log.w(TAG, "Expandable view " + this + " has transient container " + transientContainer + " has transient container " + transientContainer + " but no parent"); + " but different parent" + parent); setTransientContainer(null); setTransientContainer(null); } } return; return; } } if (transientContainer == null) { if (transientContainer == null) { throw new IllegalStateException( throw new IllegalStateException("Can't add view " + this + " to container " + newParent "Can't add view " + this + " to container " + newParent + "; current parent " + "; current parent " + parent + " is not a transient container"); + parent + " is not a transient container"); } } if (transientContainer != parent) { if (transientContainer != parent) { String transientContainerOutOfSyncError = "Expandable view " + this + " has transient container " + transientContainer + " but different parent " + parent; if (parent != newParent) { // Crash with details before addView() crashes without any; the view is being added // Crash with details before addView() crashes without any; the view is being added // to a different parent, and the transient container isn't the parent, so we can't // to a different parent, and the transient container isn't the parent, so we can't // even (safely) clean that up. // even (safely) clean that up. throw new IllegalStateException(transientContainerOutOfSyncError); throw new IllegalStateException("Expandable view " + this } else { + " has transient container " + transientContainer Log.w(TAG, transientContainerOutOfSyncError); + " but different parent " + parent); setTransientContainer(null); return; } } if (parent != newParent) { Log.w(TAG, "Moving view " + this + " from transient container " + transientContainer + " to parent " + newParent); } } Log.w(TAG, "Removing view " + this + " from transient container " + transientContainer + " in preparation for moving to parent " + newParent); transientContainer.removeTransientView(this); transientContainer.removeTransientView(this); setTransientContainer(null); setTransientContainer(null); } } Loading