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

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

Merge "Put education changes under new flag" into main

parents 23028d23 0cbfca13
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -116,7 +116,12 @@ class AppToWebEducationController(
    }

    private inline fun runIfEducationFeatureEnabled(block: () -> Unit) {
        if (canEnterDesktopMode(context) && Flags.enableDesktopWindowingAppToWebEducation()) block()
        if (
            canEnterDesktopMode(context) &&
                Flags.enableDesktopWindowingAppToWebEducationIntegration()
        ) {
            block()
        }
    }

    private fun showEducation(captionState: CaptionState, colorScheme: EducationColorScheme) {
+2 −2
Original line number Diff line number Diff line
@@ -1435,7 +1435,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
                /* openInBrowserClickListener= */ (intent) -> {
                    mOpenInBrowserClickListener.accept(intent);
                    onCapturedLinkExpired();
                    if (Flags.enableDesktopWindowingAppToWebEducation()) {
                    if (Flags.enableDesktopWindowingAppToWebEducationIntegration()) {
                        mWindowDecorCaptionHandleRepository.onAppToWebUsage();
                    }
                    return Unit.INSTANCE;
@@ -1688,7 +1688,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
    /** Returns true if at least one education flag is enabled. */
    private boolean isEducationEnabled() {
        return Flags.enableDesktopWindowingAppHandleEducation()
                || Flags.enableDesktopWindowingAppToWebEducation();
                || Flags.enableDesktopWindowingAppToWebEducationIntegration();
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -1496,7 +1496,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {

    @Test
    @DisableFlags({Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_HANDLE_EDUCATION,
            Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_TO_WEB_EDUCATION})
            Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_TO_WEB_EDUCATION_INTEGRATION})
    public void notifyCaptionStateChanged_flagDisabled_doNoNotify() {
        when(DesktopModeStatus.canEnterDesktopMode(mContext)).thenReturn(true);
        final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);