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

Commit 1e3b508b authored by Evan Laird's avatar Evan Laird
Browse files

Add CastController to DumpManager

It seems to have gone missing from when we transitioned it away from
Dependency. This CL adds it to DumpManager so we can see its state in
bug reports

Test: adb shell dumpsys activity service SystemUI | grep CastController
Bug: 158713111
Change-Id: I33266fbc983d54e20efd9ba64dfef38a0f4ab218
parent cf4c9d11
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