Merge "Sysui Leaks: Leak check destroyed fragments" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-14 19:24:36 +00:00
committed by Android (Google) Code Review

View File

@@ -35,6 +35,7 @@ import android.view.View;
import com.android.settingslib.applications.InterestingConfigChanges;
import com.android.systemui.Dependency;
import com.android.systemui.plugins.Plugin;
import com.android.systemui.util.leak.LeakDetector;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -77,6 +78,11 @@ public class FragmentHostManager {
public void onFragmentViewDestroyed(FragmentManager fm, Fragment f) {
FragmentHostManager.this.onFragmentViewDestroyed(f);
}
@Override
public void onFragmentDestroyed(FragmentManager fm, Fragment f) {
Dependency.get(LeakDetector.class).trackGarbage(f);
}
};
mFragments.getFragmentManager().registerFragmentLifecycleCallbacks(mLifecycleCallbacks,
true);