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

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

Merge "Add CastController to DumpManager"

parents f627c043 1e3b508b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import androidx.annotation.VisibleForTesting;

import com.android.internal.annotations.GuardedBy;
import com.android.systemui.R;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.util.Utils;

import java.io.FileDescriptor;
@@ -68,7 +69,7 @@ public class CastControllerImpl implements CastController {
    private MediaProjectionInfo mProjection;

    @Inject
    public CastControllerImpl(Context context) {
    public CastControllerImpl(Context context, DumpManager dumpManager) {
        mContext = context;
        mMediaRouter = (MediaRouter) context.getSystemService(Context.MEDIA_ROUTER_SERVICE);
        mMediaRouter.setRouterGroupId(MediaRouter.MIRRORING_GROUP_ID);
@@ -76,6 +77,7 @@ public class CastControllerImpl implements CastController {
                context.getSystemService(Context.MEDIA_PROJECTION_SERVICE);
        mProjection = mProjectionManager.getActiveProjectionInfo();
        mProjectionManager.addCallback(mProjectionCallback, new Handler());
        dumpManager.registerDumpable(TAG, this);
        if (DEBUG) Log.d(TAG, "new CastController()");
    }

+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ import android.testing.TestableLooper;
import androidx.test.filters.SmallTest;

import com.android.systemui.SysuiTestCase;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.statusbar.policy.CastController.Callback;

import org.junit.Before;
@@ -51,7 +52,7 @@ public class CastControllerImplTest extends SysuiTestCase {
        mContext.addMockSystemService(MediaProjectionManager.class, mMediaProjectionManager);
        when(mMediaProjectionManager.getActiveProjectionInfo()).thenReturn(mProjection);

        mController = new CastControllerImpl(mContext);
        mController = new CastControllerImpl(mContext, mock(DumpManager.class));
    }

    @Test