Merge "Revert "Always check if the view can be recycled."" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
533ce6f9f0
@@ -5746,9 +5746,11 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
// persisted across change, and has the RemoteViews re-applied in a different situation
|
// persisted across change, and has the RemoteViews re-applied in a different situation
|
||||||
// (orientation or size), we throw an exception, since the layouts may be completely
|
// (orientation or size), we throw an exception, since the layouts may be completely
|
||||||
// unrelated.
|
// unrelated.
|
||||||
|
if (hasMultipleLayouts()) {
|
||||||
if (!rvToApply.canRecycleView(v)) {
|
if (!rvToApply.canRecycleView(v)) {
|
||||||
throw new RuntimeException("Attempting to re-apply RemoteViews to a view that"
|
throw new RuntimeException("Attempting to re-apply RemoteViews to a view that" +
|
||||||
+ " that does not share the same root layout id.");
|
" that does not share the same root layout id.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rvToApply.performApply(v, (ViewGroup) v.getParent(), handler, colorResources);
|
rvToApply.performApply(v, (ViewGroup) v.getParent(), handler, colorResources);
|
||||||
@@ -5792,9 +5794,11 @@ public class RemoteViews implements Parcelable, Filter {
|
|||||||
// In the case that a view has this RemoteViews applied in one orientation, is persisted
|
// In the case that a view has this RemoteViews applied in one orientation, is persisted
|
||||||
// across orientation change, and has the RemoteViews re-applied in the new orientation,
|
// across orientation change, and has the RemoteViews re-applied in the new orientation,
|
||||||
// we throw an exception, since the layouts may be completely unrelated.
|
// we throw an exception, since the layouts may be completely unrelated.
|
||||||
|
if (hasMultipleLayouts()) {
|
||||||
if (!rvToApply.canRecycleView(v)) {
|
if (!rvToApply.canRecycleView(v)) {
|
||||||
throw new RuntimeException("Attempting to re-apply RemoteViews to a view that"
|
throw new RuntimeException("Attempting to re-apply RemoteViews to a view that" +
|
||||||
+ " that does not share the same root layout id.");
|
" that does not share the same root layout id.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AsyncApplyTask(rvToApply, (ViewGroup) v.getParent(),
|
return new AsyncApplyTask(rvToApply, (ViewGroup) v.getParent(),
|
||||||
|
|||||||
Reference in New Issue
Block a user