summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-11-02 19:07:48 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-11-02 19:07:48 +0000
commit1c3b93b10a8fff3e9bcd7d2bdc6da7c3cc434852 (patch)
tree04547888f165c3e62fefb3f033997d3ff16b7c10
parentb027e634e862272b8a63fdcc89cf695d8d8a5aed (diff)
parent8011a28559c3974d075ac2533a67a8eeba9b42bf (diff)
Merge "Always check if the view can be recycled." into sc-v2-dev
-rw-r--r--core/java/android/widget/RemoteViews.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 2357d13c8d41..57b7d618917d 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -5746,11 +5746,9 @@ public class RemoteViews implements Parcelable, Filter {
// 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
// unrelated.
- if (hasMultipleLayouts()) {
- if (!rvToApply.canRecycleView(v)) {
- throw new RuntimeException("Attempting to re-apply RemoteViews to a view that" +
- " that does not share the same root layout id.");
- }
+ if (!rvToApply.canRecycleView(v)) {
+ throw new RuntimeException("Attempting to re-apply RemoteViews to a view that"
+ + " that does not share the same root layout id.");
}
rvToApply.performApply(v, (ViewGroup) v.getParent(), handler, colorResources);
@@ -5794,11 +5792,9 @@ public class RemoteViews implements Parcelable, Filter {
// 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,
// we throw an exception, since the layouts may be completely unrelated.
- if (hasMultipleLayouts()) {
- if (!rvToApply.canRecycleView(v)) {
- throw new RuntimeException("Attempting to re-apply RemoteViews to a view that" +
- " that does not share the same root layout id.");
- }
+ if (!rvToApply.canRecycleView(v)) {
+ throw new RuntimeException("Attempting to re-apply RemoteViews to a view that"
+ + " that does not share the same root layout id.");
}
return new AsyncApplyTask(rvToApply, (ViewGroup) v.getParent(),