Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c71dbf9c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Finish injecting GarbageMonitor."

parents c087fbc6 81d76159
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.power.PowerUI;
import com.android.systemui.recents.Recents;
import com.android.systemui.recents.RecentsModule;
import com.android.systemui.util.leak.GarbageMonitor;

import dagger.Binds;
import dagger.Module;
@@ -48,4 +49,10 @@ public abstract class SystemUIBinder {
    @IntoMap
    @ClassKey(Recents.class)
    public abstract SystemUI bindRecents(Recents sysui);

    /** Inject into GarbageMonitor.Service. */
    @Binds
    @IntoMap
    @ClassKey(GarbageMonitor.Service.class)
    public abstract SystemUI bindGarbageMonitorService(GarbageMonitor.Service service);
}
+1 −8
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.content.ContentProvider;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.util.InjectionInflationController;
import com.android.systemui.util.leak.GarbageMonitor;

import javax.inject.Named;
import javax.inject.Singleton;
@@ -43,7 +42,7 @@ import dagger.Component;
public interface SystemUIRootComponent {

    /**
     * Creates a GarbageMonitor.
     * Creates a ContextComponentHelper.
     */
    @Singleton
    ContextComponentHelper getContextComponentHelper();
@@ -71,12 +70,6 @@ public interface SystemUIRootComponent {
     */
    InjectionInflationController.ViewCreator createViewCreator();

    /**
     * Creates a GarbageMonitor.
     */
    @Singleton
    GarbageMonitor createGarbageMonitor();

    /**
     * Whether notification long press is allowed.
     */
+8 −6
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@ import android.util.LongSparseArray;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
import com.android.systemui.SystemUI;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.plugins.qs.QSTile;
import com.android.systemui.qs.QSHost;
import com.android.systemui.qs.tileimpl.QSTileImpl;
@@ -391,9 +390,9 @@ public class GarbageMonitor implements Dumpable {
        private boolean dumpInProgress;

        @Inject
        public MemoryTile(QSHost host) {
        public MemoryTile(QSHost host, GarbageMonitor monitor) {
            super(host);
            gm = SystemUIFactory.getInstance().getRootComponent().createGarbageMonitor();
            gm = monitor;
        }

        @Override
@@ -535,7 +534,12 @@ public class GarbageMonitor implements Dumpable {

    /** */
    public static class Service extends SystemUI implements Dumpable {
        private GarbageMonitor mGarbageMonitor;
        private final GarbageMonitor mGarbageMonitor;

        @Inject
        public Service(GarbageMonitor garbageMonitor) {
            mGarbageMonitor = garbageMonitor;
        }

        @Override
        public void start() {
@@ -543,8 +547,6 @@ public class GarbageMonitor implements Dumpable {
                    Settings.Secure.getInt(
                                    mContext.getContentResolver(), FORCE_ENABLE_LEAK_REPORTING, 0)
                            != 0;
            mGarbageMonitor = SystemUIFactory.getInstance().getRootComponent()
                   .createGarbageMonitor();
            if (LEAK_REPORTING_ENABLED || forceEnable) {
                mGarbageMonitor.startLeakMonitor();
            }