Merge "Run explicit GC to clear references to bitmaps earlier." into oc-dev
am: fd6b3c6da3
Change-Id: Ia156853dacf464f80ea46b35806c1f40d3107ecd
This commit is contained in:
@@ -519,6 +519,9 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD
|
|||||||
RecentsActivityLaunchState launchState = config.getLaunchState();
|
RecentsActivityLaunchState launchState = config.getLaunchState();
|
||||||
launchState.reset();
|
launchState.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force a gc to attempt to clean up bitmap references more quickly (b/38258699)
|
||||||
|
Recents.getSystemServices().gc();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -361,6 +361,19 @@ public class SystemServicesProxy {
|
|||||||
return sSystemServicesProxy;
|
return sSystemServicesProxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Requests a gc() from the background thread.
|
||||||
|
*/
|
||||||
|
public void gc() {
|
||||||
|
BackgroundThread.getHandler().post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
System.gc();
|
||||||
|
System.runFinalization();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return whether the provided {@param className} is blacklisted
|
* @return whether the provided {@param className} is blacklisted
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user