Background full compaction for CC.
Invoke a full compaction with the CC collector when an app goes to the
background like the HSpace compaction for the CMS collector.
Bug: 31039431
Bug: 12687968
Test: test-art, Ritz EAAC, N9 libartd.so device boot with CC
Change-Id: I119aa26c1d3c167b12983fffcb16164929bf8f68
diff --git a/runtime/gc/collector/concurrent_copying.cc b/runtime/gc/collector/concurrent_copying.cc
index 42816a0..285b111 100644
--- a/runtime/gc/collector/concurrent_copying.cc
+++ b/runtime/gc/collector/concurrent_copying.cc
@@ -202,8 +202,10 @@
immune_spaces_.Reset();
bytes_moved_.StoreRelaxed(0);
objects_moved_.StoreRelaxed(0);
- if (GetCurrentIteration()->GetGcCause() == kGcCauseExplicit ||
- GetCurrentIteration()->GetGcCause() == kGcCauseForNativeAlloc ||
+ GcCause gc_cause = GetCurrentIteration()->GetGcCause();
+ if (gc_cause == kGcCauseExplicit ||
+ gc_cause == kGcCauseForNativeAlloc ||
+ gc_cause == kGcCauseCollectorTransition ||
GetCurrentIteration()->GetClearSoftReferences()) {
force_evacuate_all_ = true;
} else {