GMO版本最近应用列表界面显示模糊的解决方案
GMO版本由于是LOW_RAM的设计,所以对Recent中显示的缩略图进行了Slim处理,所以看起来会没有非GMO版本清楚,通常不建议修改,若确实有需要修改成非GMO版本的显示效果,而又不在意对RAM的消耗,可以参考如下方法。
在/frameworks/base/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java文件中搜索GMO关键字,将针对GMO版本做特别处理的代码屏蔽掉即可。
主要有两处:
(1)
public class SystemServicesProxy {
……
// M: Slim thumbnail's size for GMO @{
if (FeatureOptions.LOW_RAM_SUPPORT) {
sBitmapOptions.inSampleSize = 2;
}
// @}
if (FeatureOptions.LOW_RAM_SUPPORT) {
sBitmapOptions.inSampleSize = 2;
}
// @}
……
}
(2)
public void getThumbnail(int taskId, ThumbnailData thumbnailDataOut)
{
……
// M: Slim thumbnail's size for GMO @{
} else if (thumbnail != null && FeatureOptions.LOW_RAM_SUPPORT) {
ByteArrayOutputStream tbOutput = new ByteArrayOutputStream();
thumbnail.compress(Bitmap.CompressFormat.JPEG,100,tbOutput);
ByteArrayInputStream tbInput = new ByteArrayInputStream(tbOutput.toByteArray());
thumbnail = BitmapFactory.decodeStream(tbInput,null,sBitmapOptions);
try {
if (tbOutput != null) tbOutput.close();
if (tbInput != null) tbInput.close();
} catch (IOException e) {
e.printStackTrace();
}
} else if (thumbnail != null && FeatureOptions.LOW_RAM_SUPPORT) {
ByteArrayOutputStream tbOutput = new ByteArrayOutputStream();
thumbnail.compress(Bitmap.CompressFormat.JPEG,100,tbOutput);
ByteArrayInputStream tbInput = new ByteArrayInputStream(tbOutput.toByteArray());
thumbnail = BitmapFactory.decodeStream(tbInput,null,sBitmapOptions);
try {
if (tbOutput != null) tbOutput.close();
if (tbInput != null) tbInput.close();
} catch (IOException e) {
e.printStackTrace();
}
}
……
}
将这两代码屏蔽掉,即可达到非GMO版本的效果,但是会增加对内存的消耗。