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

Commit 5a7e18f0 authored by wenyu zhang's avatar wenyu zhang
Browse files

Rename MediaOutputController

No functional changes. Rename MediaOutputController since it is expanded
to also support audio input routing.

Change-Id: I1351707bab48a0491830bff971b46cd1fd8f5478
Bug: b/355684672, b/357122624
Test: atest AudioSwitchControllerTest, MediaOutputAdapterTest,
MediaOutputBaseDialogTest, MediaOutputBroadcastDIalogTest,
MediaOutputDialogTest
Flag: com.android.media.flags.enable_audio_input_device_routing_and_volume_control
parent ada98fa1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ filegroup {
        "tests/src/**/systemui/clipboardoverlay/ClipboardListenerTest.java",
        "tests/src/**/systemui/doze/DozeScreenStateTest.java",
        "tests/src/**/systemui/keyguard/WorkLockActivityControllerTest.java",
        "tests/src/**/systemui/media/dialog/MediaOutputControllerTest.java",
        "tests/src/**/systemui/media/dialog/MediaSwitchingControllerTest.java",
        "tests/src/**/systemui/navigationbar/views/NavigationBarTest.java",
        "tests/src/**/systemui/power/PowerNotificationWarningsTest.java",
        "tests/src/**/systemui/power/PowerUITest.java",
+5 −3
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
    private static final float DEVICE_CONNECTED_ALPHA = 1f;
    protected List<MediaItem> mMediaItemList = new CopyOnWriteArrayList<>();

    public MediaOutputAdapter(MediaOutputController controller) {
    public MediaOutputAdapter(MediaSwitchingController controller) {
        super(controller);
        setHasStableIds(true);
    }
@@ -531,8 +531,10 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
    @RequiresApi(34)
    private static class Api34Impl {
        @DoNotInline
        static View.OnClickListener getClickListenerBasedOnSelectionBehavior(MediaDevice device,
                MediaOutputController controller, View.OnClickListener defaultTransferListener) {
        static View.OnClickListener getClickListenerBasedOnSelectionBehavior(
                MediaDevice device,
                MediaSwitchingController controller,
                View.OnClickListener defaultTransferListener) {
            switch (device.getSelectionBehavior()) {
                case SELECTION_BEHAVIOR_NONE:
                    return null;
+3 −3
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public abstract class MediaOutputBaseAdapter extends
    static final int CUSTOMIZED_ITEM_GROUP = 2;
    static final int CUSTOMIZED_ITEM_DYNAMIC_GROUP = 3;

    protected final MediaOutputController mController;
    protected final MediaSwitchingController mController;

    private static final int UNMUTE_DEFAULT_VOLUME = 2;

@@ -73,7 +73,7 @@ public abstract class MediaOutputBaseAdapter extends
    int mCurrentActivePosition;
    private boolean mIsInitVolumeFirstTime;

    public MediaOutputBaseAdapter(MediaOutputController controller) {
    public MediaOutputBaseAdapter(MediaSwitchingController controller) {
        mController = controller;
        mIsDragging = false;
        mCurrentActivePosition = -1;
@@ -127,7 +127,7 @@ public abstract class MediaOutputBaseAdapter extends
        return mCurrentActivePosition;
    }

    public MediaOutputController getController() {
    public MediaSwitchingController getController() {
        return mController;
    }

+40 −40
Original line number Diff line number Diff line
@@ -65,11 +65,9 @@ import com.android.systemui.statusbar.phone.SystemUIDialog;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * Base dialog for media output UI
 */
public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        MediaOutputController.Callback, Window.Callback {
/** Base dialog for media output UI */
public abstract class MediaOutputBaseDialog extends SystemUIDialog
        implements MediaSwitchingController.Callback, Window.Callback {

    private static final String TAG = "MediaOutputDialog";
    private static final String EMPTY_TITLE = " ";
@@ -82,7 +80,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    private final RecyclerView.LayoutManager mLayoutManager;

    final Context mContext;
    final MediaOutputController mMediaOutputController;
    final MediaSwitchingController mMediaSwitchingController;
    final BroadcastSender mBroadcastSender;

    /**
@@ -212,22 +210,22 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        @Override
        public void onLayoutCompleted(RecyclerView.State state) {
            super.onLayoutCompleted(state);
            mMediaOutputController.setRefreshing(false);
            mMediaOutputController.refreshDataSetIfNeeded();
            mMediaSwitchingController.setRefreshing(false);
            mMediaSwitchingController.refreshDataSetIfNeeded();
        }
    }

    public MediaOutputBaseDialog(
            Context context,
            BroadcastSender broadcastSender,
            MediaOutputController mediaOutputController,
            MediaSwitchingController mediaSwitchingController,
            boolean includePlaybackAndAppMetadata) {
        super(context, R.style.Theme_SystemUI_Dialog_Media);

        // Save the context that is wrapped with our theme.
        mContext = getContext();
        mBroadcastSender = broadcastSender;
        mMediaOutputController = mediaOutputController;
        mMediaSwitchingController = mediaSwitchingController;
        mLayoutManager = new LayoutManagerWrapper(mContext);
        mListMaxHeight = context.getResources().getDimensionPixelSize(
                R.dimen.media_output_dialog_list_max_height);
@@ -279,9 +277,9 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        // Init bottom buttons
        mDoneButton.setOnClickListener(v -> dismiss());
        mStopButton.setOnClickListener(v -> onStopButtonClick());
        mAppButton.setOnClickListener(mMediaOutputController::tryToLaunchMediaApplication);
        mAppButton.setOnClickListener(mMediaSwitchingController::tryToLaunchMediaApplication);
        mMediaMetadataSectionLayout.setOnClickListener(
                mMediaOutputController::tryToLaunchMediaApplication);
                mMediaSwitchingController::tryToLaunchMediaApplication);

        mDismissing = false;
    }
@@ -298,10 +296,10 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements

    @Override
    public void start() {
        mMediaOutputController.start(this);
        mMediaSwitchingController.start(this);
        if (isBroadcastSupported() && !mIsLeBroadcastCallbackRegistered) {
            mMediaOutputController.registerLeBroadcastServiceCallback(mExecutor,
                    mBroadcastCallback);
            mMediaSwitchingController.registerLeBroadcastServiceCallback(
                    mExecutor, mBroadcastCallback);
            mIsLeBroadcastCallbackRegistered = true;
        }
    }
@@ -311,11 +309,11 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
        // unregister broadcast callback should only depend on profile and registered flag
        // rather than remote device or broadcast state
        // otherwise it might have risks of leaking registered callback handle
        if (mMediaOutputController.isBroadcastSupported() && mIsLeBroadcastCallbackRegistered) {
            mMediaOutputController.unregisterLeBroadcastServiceCallback(mBroadcastCallback);
        if (mMediaSwitchingController.isBroadcastSupported() && mIsLeBroadcastCallbackRegistered) {
            mMediaSwitchingController.unregisterLeBroadcastServiceCallback(mBroadcastCallback);
            mIsLeBroadcastCallbackRegistered = false;
        }
        mMediaOutputController.stop();
        mMediaSwitchingController.stop();
    }

    @VisibleForTesting
@@ -326,18 +324,17 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    void refresh(boolean deviceSetChanged) {
        // TODO(287191450): remove binder calls in this method from the UI thread.
        // If the dialog is going away or is already refreshing, do nothing.
        if (mDismissing || mMediaOutputController.isRefreshing()) {
        if (mDismissing || mMediaSwitchingController.isRefreshing()) {
            return;
        }
        mMediaOutputController.setRefreshing(true);
        mMediaSwitchingController.setRefreshing(true);
        // Update header icon
        final int iconRes = getHeaderIconRes();
        final IconCompat headerIcon = getHeaderIcon();
        final IconCompat appSourceIcon = getAppSourceIcon();
        boolean colorSetUpdated = false;
        mCastAppLayout.setVisibility(
                mMediaOutputController.shouldShowLaunchSection()
                        ? View.VISIBLE : View.GONE);
                mMediaSwitchingController.shouldShowLaunchSection() ? View.VISIBLE : View.GONE);
        if (iconRes != 0) {
            mHeaderIcon.setVisibility(View.VISIBLE);
            mHeaderIcon.setImageResource(iconRes);
@@ -371,10 +368,10 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
            mAppResourceIcon.setVisibility(View.GONE);
        } else if (appSourceIcon != null) {
            Icon appIcon = appSourceIcon.toIcon(mContext);
            mAppResourceIcon.setColorFilter(mMediaOutputController.getColorItemContent());
            mAppResourceIcon.setColorFilter(mMediaSwitchingController.getColorItemContent());
            mAppResourceIcon.setImageIcon(appIcon);
        } else {
            Drawable appIconDrawable = mMediaOutputController.getAppSourceIconFromPackage();
            Drawable appIconDrawable = mMediaSwitchingController.getAppSourceIconFromPackage();
            if (appIconDrawable != null) {
                mAppResourceIcon.setImageDrawable(appIconDrawable);
            } else {
@@ -387,7 +384,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
                    R.dimen.media_output_dialog_header_icon_padding);
            mHeaderIcon.setLayoutParams(new LinearLayout.LayoutParams(size + padding, size));
        }
        mAppButton.setText(mMediaOutputController.getAppSourceName());
        mAppButton.setText(mMediaSwitchingController.getAppSourceName());

        if (!mIncludePlaybackAndAppMetadata) {
            mHeaderTitle.setVisibility(View.GONE);
@@ -424,23 +421,26 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
                mAdapter.updateItems();
            }
        } else {
            mMediaOutputController.setRefreshing(false);
            mMediaOutputController.refreshDataSetIfNeeded();
            mMediaSwitchingController.setRefreshing(false);
            mMediaSwitchingController.refreshDataSetIfNeeded();
        }
    }

    private void updateButtonBackgroundColorFilter() {
        ColorFilter buttonColorFilter = new PorterDuffColorFilter(
                mMediaOutputController.getColorButtonBackground(),
        ColorFilter buttonColorFilter =
                new PorterDuffColorFilter(
                        mMediaSwitchingController.getColorButtonBackground(),
                        PorterDuff.Mode.SRC_IN);
        mDoneButton.getBackground().setColorFilter(buttonColorFilter);
        mStopButton.getBackground().setColorFilter(buttonColorFilter);
        mDoneButton.setTextColor(mMediaOutputController.getColorPositiveButtonText());
        mDoneButton.setTextColor(mMediaSwitchingController.getColorPositiveButtonText());
    }

    private void updateDialogBackgroundColor() {
        getDialogView().getBackground().setTint(mMediaOutputController.getColorDialogBackground());
        mDeviceListLayout.setBackgroundColor(mMediaOutputController.getColorDialogBackground());
        getDialogView()
                .getBackground()
                .setTint(mMediaSwitchingController.getColorDialogBackground());
        mDeviceListLayout.setBackgroundColor(mMediaSwitchingController.getColorDialogBackground());
    }

    private Drawable resizeDrawable(Drawable drawable, int size) {
@@ -499,7 +499,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    protected void startLeBroadcast() {
        mStopButton.setText(R.string.media_output_broadcast_starting);
        mStopButton.setEnabled(false);
        if (!mMediaOutputController.startBluetoothLeBroadcast()) {
        if (!mMediaSwitchingController.startBluetoothLeBroadcast()) {
            // If the system can't execute "broadcast start", then UI shows the error.
            handleLeBroadcastStartFailed();
        }
@@ -512,9 +512,10 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
                && sharedPref.getBoolean(PREF_IS_LE_BROADCAST_FIRST_LAUNCH, true)) {
            Log.d(TAG, "PREF_IS_LE_BROADCAST_FIRST_LAUNCH: true");

            mMediaOutputController.launchLeBroadcastNotifyDialog(mDialogView,
            mMediaSwitchingController.launchLeBroadcastNotifyDialog(
                    mDialogView,
                    mBroadcastSender,
                    MediaOutputController.BroadcastNotifyDialog.ACTION_FIRST_LAUNCH,
                    MediaSwitchingController.BroadcastNotifyDialog.ACTION_FIRST_LAUNCH,
                    (d, w) -> {
                        startLeBroadcast();
                    });
@@ -527,14 +528,13 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    }

    protected void startLeBroadcastDialog() {
        mMediaOutputController.launchMediaOutputBroadcastDialog(mDialogView,
                mBroadcastSender);
        mMediaSwitchingController.launchMediaOutputBroadcastDialog(mDialogView, mBroadcastSender);
        refresh();
    }

    protected void stopLeBroadcast() {
        mStopButton.setEnabled(false);
        if (!mMediaOutputController.stopBluetoothLeBroadcast()) {
        if (!mMediaSwitchingController.stopBluetoothLeBroadcast()) {
            // If the system can't execute "broadcast stop", then UI does refresh.
            mMainThreadHandler.post(() -> refresh());
        }
@@ -559,7 +559,7 @@ public abstract class MediaOutputBaseDialog extends SystemUIDialog implements
    }

    public void onStopButtonClick() {
        mMediaOutputController.releaseSession();
        mMediaSwitchingController.releaseSession();
        dismiss();
    }

+47 −41
Original line number Diff line number Diff line
@@ -235,14 +235,17 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
                }
            };

    MediaOutputBroadcastDialog(Context context, boolean aboveStatusbar,
            BroadcastSender broadcastSender, MediaOutputController mediaOutputController) {
    MediaOutputBroadcastDialog(
            Context context,
            boolean aboveStatusbar,
            BroadcastSender broadcastSender,
            MediaSwitchingController mediaSwitchingController) {
        super(
                context,
                broadcastSender,
                mediaOutputController, /* includePlaybackAndAppMetadata */
                mediaSwitchingController, /* includePlaybackAndAppMetadata */
                true);
        mAdapter = new MediaOutputAdapter(mMediaOutputController);
        mAdapter = new MediaOutputAdapter(mMediaSwitchingController);
        // TODO(b/226710953): Move the part to MediaOutputBaseDialog for every class
        //  that extends MediaOutputBaseDialog
        if (!aboveStatusbar) {
@@ -262,8 +265,8 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
        super.start();
        if (!mIsLeBroadcastAssistantCallbackRegistered) {
            mIsLeBroadcastAssistantCallbackRegistered = true;
            mMediaOutputController.registerLeBroadcastAssistantServiceCallback(mExecutor,
                    mBroadcastAssistantCallback);
            mMediaSwitchingController.registerLeBroadcastAssistantServiceCallback(
                    mExecutor, mBroadcastAssistantCallback);
        }
        /* Add local source broadcast to connected capable devices that may be possible receivers
         * of stream.
@@ -276,7 +279,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
        super.stop();
        if (mIsLeBroadcastAssistantCallbackRegistered) {
            mIsLeBroadcastAssistantCallbackRegistered = false;
            mMediaOutputController.unregisterLeBroadcastAssistantServiceCallback(
            mMediaSwitchingController.unregisterLeBroadcastAssistantServiceCallback(
                    mBroadcastAssistantCallback);
        }
    }
@@ -288,7 +291,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {

    @Override
    IconCompat getHeaderIcon() {
        return mMediaOutputController.getHeaderIcon();
        return mMediaSwitchingController.getHeaderIcon();
    }

    @Override
@@ -299,17 +302,17 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {

    @Override
    CharSequence getHeaderText() {
        return mMediaOutputController.getHeaderTitle();
        return mMediaSwitchingController.getHeaderTitle();
    }

    @Override
    CharSequence getHeaderSubtitle() {
        return mMediaOutputController.getHeaderSubTitle();
        return mMediaSwitchingController.getHeaderSubTitle();
    }

    @Override
    IconCompat getAppSourceIcon() {
        return mMediaOutputController.getNotificationSmallIcon();
        return mMediaSwitchingController.getNotificationSmallIcon();
    }

    @Override
@@ -319,16 +322,16 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {

    @Override
    public void onStopButtonClick() {
        mMediaOutputController.stopBluetoothLeBroadcast();
        mMediaSwitchingController.stopBluetoothLeBroadcast();
        dismiss();
    }

    private String getBroadcastMetadataInfo(int metadata) {
        switch (metadata) {
            case METADATA_BROADCAST_NAME:
                return mMediaOutputController.getBroadcastName();
                return mMediaSwitchingController.getBroadcastName();
            case METADATA_BROADCAST_CODE:
                return mMediaOutputController.getBroadcastCode();
                return mMediaSwitchingController.getBroadcastCode();
            default:
                return "";
        }
@@ -342,12 +345,14 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
        mBroadcastQrCodeView = getDialogView().requireViewById(R.id.qrcode_view);

        mBroadcastNotify = getDialogView().requireViewById(R.id.broadcast_info);
        mBroadcastNotify.setOnClickListener(v -> {
            mMediaOutputController.launchLeBroadcastNotifyDialog(
                    /* view= */ null,
        mBroadcastNotify.setOnClickListener(
                v -> {
                    mMediaSwitchingController.launchLeBroadcastNotifyDialog(
                            /* mediaOutputDialog= */ null,
                            /* broadcastSender= */ null,
                    MediaOutputController.BroadcastNotifyDialog.ACTION_BROADCAST_INFO_ICON,
                    /* onClickListener= */ null);
                            MediaSwitchingController.BroadcastNotifyDialog
                                    .ACTION_BROADCAST_INFO_ICON,
                            /* listener= */ null);
                });
        mBroadcastName = getDialogView().requireViewById(R.id.broadcast_name_summary);
        mBroadcastNameEdit = getDialogView().requireViewById(R.id.broadcast_name_edit);
@@ -409,16 +414,16 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
            return;
        }

        for (BluetoothDevice sink : mMediaOutputController.getConnectedBroadcastSinkDevices()) {
        for (BluetoothDevice sink : mMediaSwitchingController.getConnectedBroadcastSinkDevices()) {
            Log.d(TAG, "The broadcastMetadata broadcastId: " + broadcastMetadata.getBroadcastId()
                    + ", the device: " + sink.getAnonymizedAddress());

            if (mMediaOutputController.isThereAnyBroadcastSourceIntoSinkDevice(sink)) {
            if (mMediaSwitchingController.isThereAnyBroadcastSourceIntoSinkDevice(sink)) {
                Log.d(TAG, "The sink device has the broadcast source now.");
                return;
            }
            if (!mMediaOutputController.addSourceIntoSinkDeviceWithBluetoothLeAssistant(sink,
                    broadcastMetadata, /*isGroupOp=*/ false)) {
            if (!mMediaSwitchingController.addSourceIntoSinkDeviceWithBluetoothLeAssistant(
                    sink, broadcastMetadata, /* isGroupOp= */ false)) {
                Log.e(TAG, "Error: Source add failed");
            }
        }
@@ -457,11 +462,11 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
    }

    private String getLocalBroadcastMetadataQrCodeString() {
        return mMediaOutputController.getLocalBroadcastMetadataQrCodeString();
        return mMediaSwitchingController.getLocalBroadcastMetadataQrCodeString();
    }

    private BluetoothLeBroadcastMetadata getBroadcastMetadata() {
        return mMediaOutputController.getBroadcastMetadata();
        return mMediaSwitchingController.getBroadcastMetadata();
    }

    @VisibleForTesting
@@ -476,8 +481,8 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
             * stopped then used the new Broadcast code to start the Broadcast.
             */
            mIsStopbyUpdateBroadcastCode = true;
            mMediaOutputController.setBroadcastCode(updatedString);
            if (!mMediaOutputController.stopBluetoothLeBroadcast()) {
            mMediaSwitchingController.setBroadcastCode(updatedString);
            if (!mMediaSwitchingController.stopBluetoothLeBroadcast()) {
                handleLeBroadcastStopFailed();
                return;
            }
@@ -485,8 +490,8 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
            /* If the user wants to update the Broadcast Name, we don't need to stop the Broadcast
             * session. Only use the new Broadcast name to update the broadcast session.
             */
            mMediaOutputController.setBroadcastName(updatedString);
            if (!mMediaOutputController.updateBluetoothLeBroadcast()) {
            mMediaSwitchingController.setBroadcastName(updatedString);
            if (!mMediaSwitchingController.updateBluetoothLeBroadcast()) {
                handleLeBroadcastUpdateFailed();
            }
        }
@@ -496,12 +501,13 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
    public boolean isBroadcastSupported() {
        if (!legacyLeAudioSharing()) return false;
        boolean isBluetoothLeDevice = false;
        if (mMediaOutputController.getCurrentConnectedMediaDevice() != null) {
            isBluetoothLeDevice = mMediaOutputController.isBluetoothLeDevice(
                    mMediaOutputController.getCurrentConnectedMediaDevice());
        if (mMediaSwitchingController.getCurrentConnectedMediaDevice() != null) {
            isBluetoothLeDevice =
                    mMediaSwitchingController.isBluetoothLeDevice(
                            mMediaSwitchingController.getCurrentConnectedMediaDevice());
        }

        return mMediaOutputController.isBroadcastSupported() && isBluetoothLeDevice;
        return mMediaSwitchingController.isBroadcastSupported() && isBluetoothLeDevice;
    }

    @Override
@@ -515,7 +521,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {

    @Override
    public void handleLeBroadcastStartFailed() {
        mMediaOutputController.setBroadcastCode(mCurrentBroadcastCode);
        mMediaSwitchingController.setBroadcastCode(mCurrentBroadcastCode);
        mRetryCount++;

        handleUpdateFailedUi();
@@ -539,7 +545,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
    @Override
    public void handleLeBroadcastUpdateFailed() {
        // Change the value in shared preferences back to it original value
        mMediaOutputController.setBroadcastName(mCurrentBroadcastName);
        mMediaSwitchingController.setBroadcastName(mCurrentBroadcastName);
        mRetryCount++;

        handleUpdateFailedUi();
@@ -550,7 +556,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
        if (mIsStopbyUpdateBroadcastCode) {
            mIsStopbyUpdateBroadcastCode = false;
            mRetryCount = 0;
            if (!mMediaOutputController.startBluetoothLeBroadcast()) {
            if (!mMediaSwitchingController.startBluetoothLeBroadcast()) {
                handleLeBroadcastStartFailed();
                return;
            }
@@ -562,7 +568,7 @@ public class MediaOutputBroadcastDialog extends MediaOutputBaseDialog {
    @Override
    public void handleLeBroadcastStopFailed() {
        // Change the value in shared preferences back to it original value
        mMediaOutputController.setBroadcastCode(mCurrentBroadcastCode);
        mMediaSwitchingController.setBroadcastCode(mCurrentBroadcastCode);
        mRetryCount++;

        handleUpdateFailedUi();
Loading