Sysui Leaks: Leak check destroyed fragments

Bug: 37220220
Test: mmm SystemUI
Change-Id: I2a9e9941b5f5687d90f7af3eb7f9cd0a79ba2b98
This commit is contained in:
Adrian Roos
2017-04-13 09:14:51 -07:00
parent 1aade4e4a1
commit 4023217984

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);