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

Commit 61b95774 authored by Jiaming Cheng's avatar Jiaming Cheng Committed by Android (Google) Code Review
Browse files

Merge "[QSDetailedView] Make the current InternetDialogDelegate legacy" into main

parents e4ddaa6c c3778284
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ filegroup {
        "tests/src/**/systemui/media/controls/domain/pipeline/LegacyMediaDataManagerImplTest.kt",
        "tests/src/**/systemui/temporarydisplay/chipbar/SwipeChipbarAwayGestureHandlerTest.kt",
        "tests/src/**/systemui/qs/tiles/HotspotTileTest.java",
        "tests/src/**/systemui/qs/tiles/dialog/InternetDialogDelegateTest.java",
        "tests/src/**/systemui/qs/tiles/dialog/InternetDialogDelegateLegacyTest.java",
        "tests/src/**/systemui/navigationbar/NavigationBarControllerImplTest.java",
        "tests/src/**/systemui/wmshell/BubblesTest.java",
        "tests/src/**/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java",
+8 −0
Original line number Diff line number Diff line
@@ -79,6 +79,14 @@ object QsDetailedView {
    @JvmStatic
    inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is enabled. This will throw an exception if
     * the flag is not enabled to ensure that the refactor author catches issues in testing.
     * Caution!! Using this check incorrectly will cause crashes in nextfood builds!
     */
    @JvmStatic
    inline fun assertInNewMode() = RefactorFlagUtils.assertInNewMode(isEnabled, FLAG_NAME)

    /** Returns a developer-readable string that describes the current requirement list. */
    @JvmStatic
    fun requirementDescription(): String {
+5 −3
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ import java.util.concurrent.Executor;
/**
 * Dialog for showing mobile network, connected Wi-Fi network and Wi-Fi networks.
 */
public class InternetDialogDelegate implements
public class InternetDialogDelegateLegacy implements
        SystemUIDialog.Delegate,
        InternetDetailsContentController.InternetDialogCallback {
    private static final String TAG = "InternetDialog";
@@ -184,7 +184,7 @@ public class InternetDialogDelegate implements

    @AssistedFactory
    public interface Factory {
        InternetDialogDelegate create(
        InternetDialogDelegateLegacy create(
                @Assisted(ABOVE_STATUS_BAR) boolean aboveStatusBar,
                @Assisted(CAN_CONFIG_MOBILE_DATA) boolean canConfigMobileData,
                @Assisted(CAN_CONFIG_WIFI) boolean canConfigWifi,
@@ -192,7 +192,7 @@ public class InternetDialogDelegate implements
    }

    @AssistedInject
    public InternetDialogDelegate(
    public InternetDialogDelegateLegacy(
            @ShadeDisplayAware Context context,
            InternetDialogManager internetDialogManager,
            InternetDetailsContentController internetDetailsContentController,
@@ -207,6 +207,8 @@ public class InternetDialogDelegate implements
            KeyguardStateController keyguardStateController,
            SystemUIDialog.Factory systemUIDialogFactory,
            ShadeDialogContextInteractor shadeDialogContextInteractor) {
        // TODO: b/377388104 QsDetailedView.assertInLegacyMode();

        mAboveStatusBar = aboveStatusBar;
        mSystemUIDialogFactory = systemUIDialogFactory;
        mShadeDialogContextInteractor = shadeDialogContextInteractor;
+5 −4
Original line number Diff line number Diff line
@@ -32,13 +32,13 @@ import kotlinx.coroutines.cancel
private const val TAG = "InternetDialogFactory"
private val DEBUG = Log.isLoggable(TAG, Log.DEBUG)

/** Factory to create [InternetDialogDelegate] objects. */
/** Factory to create [InternetDialogDelegateLegacy] objects. */
@SysUISingleton
class InternetDialogManager
@Inject
constructor(
    private val dialogTransitionAnimator: DialogTransitionAnimator,
    private val dialogFactory: InternetDialogDelegate.Factory,
    private val dialogFactory: InternetDialogDelegateLegacy.Factory,
    @Background private val bgDispatcher: CoroutineDispatcher,
) {
    private lateinit var coroutineScope: CoroutineScope
@@ -48,8 +48,8 @@ constructor(
    }

    /**
     * Creates a [InternetDialogDelegate]. The dialog will be animated from [expandable] if it is
     * not null.
     * Creates a [InternetDialogDelegateLegacy]. The dialog will be animated from [expandable] if
     * it is not null.
     */
    fun create(
        aboveStatusBar: Boolean,
@@ -64,6 +64,7 @@ constructor(
            return
        } else {
            coroutineScope = CoroutineScope(bgDispatcher + newTracingContext("InternetDialogScope"))
            // TODO: b/377388104 check the QsDetailedView flag to use the correct dialogFactory
            dialog =
                dialogFactory
                    .create(aboveStatusBar, canConfigMobileData, canConfigWifi, coroutineScope)
+159 −155

File changed and moved.

Preview size limit exceeded, changes collapsed.