public void fixMemoryLeak() {
if (!"HUAWEI".equalsIgnoreCase(Build.MANUFACTURER)) {
return;
}
try {
Class<?> FastgrabConfigReaderClass = Class.forName("android.rms.iaware.FastgrabConfigReader");
Field mFastgrabConfigReader = FastgrabConfigReaderClass.getDeclaredField("mFastgrabConfigReader");
mFastgrabConfigReader.setAccessible(true);
Object fastgrabConfigReader = mFastgrabConfigReader.get(FastgrabConfigReaderClass);
Field contextField = FastgrabConfigReaderClass.getDeclaredField("mContext");
contextField.setAccessible(true);
if (contextField.get(fastgrabConfigReader) == this) {
contextField.set(fastgrabConfigReader, null);
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (Throwable t) {
t.printStackTrace();
}
}