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

Commit 4ff420a8 authored by Subhash Reddy Surkanti (xWF)'s avatar Subhash Reddy Surkanti (xWF) Committed by Android (Google) Code Review
Browse files

Revert "App-to-Web: Use userContext when getting DomainVerificationManager."

This reverts commit 595f03c2.

Reason for revert: Likely culprit for b/427176107  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Bug : 427176107

Change-Id: Icd0ed13aff12d05bc7274323ad8f187723be3cbd
parent 595f03c2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ import kotlinx.coroutines.withContext
 */
internal class OpenByDefaultDialog(
    private val context: Context,
    private val userContext: Context,
    private val taskInfo: RunningTaskInfo,
    private val taskSurface: SurfaceControl,
    private val displayController: DisplayController,
@@ -76,7 +75,7 @@ internal class OpenByDefaultDialog(
    private lateinit var openInBrowserButton: RadioButton

    private val domainVerificationManager =
        userContext.getSystemService(DomainVerificationManager::class.java)!!
        context.getSystemService(DomainVerificationManager::class.java)!!
    private val packageName = taskInfo.baseActivity?.packageName!!

    private var loadAppInfoJob: Job? = null
+2 −3
Original line number Diff line number Diff line
@@ -1232,8 +1232,7 @@ public abstract class WMShellModule {
            Optional<CompatUIHandler> compatUI,
            DesksOrganizer desksOrganizer,
            ShellDesktopState shelldesktopState,
            DesktopConfig desktopConfig,
            UserProfileContexts userProfileContexts
            DesktopConfig desktopConfig
    ) {
        if (!shelldesktopState.canEnterDesktopModeOrShowAppHandle()) {
            return Optional.empty();
@@ -1252,7 +1251,7 @@ public abstract class WMShellModule {
                desktopModeUiEventLogger, taskResourceLoader, recentsTransitionHandler,
                desktopModeCompatPolicy, desktopTilingDecorViewModel,
                multiDisplayDragMoveIndicatorController, compatUI.orElse(null),
                desksOrganizer, shelldesktopState, desktopConfig, userProfileContexts));
                desksOrganizer, shelldesktopState, desktopConfig));
    }

    @WMSingleton
+4 −10
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ import com.android.wm.shell.common.MultiDisplayDragMoveIndicatorController;
import com.android.wm.shell.common.MultiInstanceHelper;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.UserProfileContexts;
import com.android.wm.shell.compatui.CompatUIController;
import com.android.wm.shell.compatui.api.CompatUIHandler;
import com.android.wm.shell.compatui.impl.CompatUIRequests;
@@ -263,7 +262,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
    private final MultiDisplayDragMoveIndicatorController mMultiDisplayDragMoveIndicatorController;
    private final LatencyTracker mLatencyTracker;
    private final CompatUIHandler mCompatUI;
    private final UserProfileContexts mUserProfileContexts;

    public DesktopModeWindowDecorViewModel(
            Context context,
@@ -308,8 +306,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
            CompatUIHandler compatUI,
            DesksOrganizer desksOrganizer,
            ShellDesktopState shellDesktopState,
            DesktopConfig desktopConfig,
            UserProfileContexts userProfileContexts) {
            DesktopConfig desktopConfig) {
        this(
                context,
                shellExecutor,
@@ -360,8 +357,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                compatUI,
                desksOrganizer,
                shellDesktopState,
                desktopConfig,
                userProfileContexts);
                desktopConfig);
    }

    @VisibleForTesting
@@ -415,8 +411,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
            CompatUIHandler compatUI,
            DesksOrganizer desksOrganizer,
            ShellDesktopState shellDesktopState,
            DesktopConfig desktopConfig,
            UserProfileContexts userProfileContexts) {
            DesktopConfig desktopConfig) {
        mContext = context;
        mMainExecutor = shellExecutor;
        mMainHandler = mainHandler;
@@ -458,7 +453,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
        mAssistContentRequester = assistContentRequester;
        mWindowDecorViewHostSupplier = windowDecorViewHostSupplier;
        mCompatUI = compatUI;
        mUserProfileContexts = userProfileContexts;
        mOnDisplayChangingListener = (displayId, fromRotation, toRotation, displayAreaInfo, t) -> {
            DesktopModeWindowDecoration decoration;
            RunningTaskInfo taskInfo;
@@ -1920,7 +1914,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                        DesktopExperienceFlags.ENABLE_BUG_FIXES_FOR_SECONDARY_DISPLAY.isTrue()
                                ? mDisplayController.getDisplayContext(taskInfo.displayId)
                                : mContext,
                        mUserProfileContexts.getOrCreate(taskInfo.userId),
                        mContext.createContextAsUser(UserHandle.of(taskInfo.userId), 0 /* flags */),
                        mDisplayController,
                        mTaskResourceLoader,
                        mSplitScreenController,
+0 −1
Original line number Diff line number Diff line
@@ -1272,7 +1272,6 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
        if (isOpenByDefaultDialogActive()) return;
        mOpenByDefaultDialog = new OpenByDefaultDialog(
                mContext,
                mUserContext,
                mTaskInfo,
                mTaskSurface,
                mDisplayController,
+0 −5
Original line number Diff line number Diff line
@@ -56,7 +56,6 @@ import com.android.wm.shell.common.DisplayInsetsController
import com.android.wm.shell.common.DisplayLayout
import com.android.wm.shell.common.MultiDisplayDragMoveIndicatorController
import com.android.wm.shell.common.MultiInstanceHelper
import com.android.wm.shell.common.UserProfileContexts
import com.android.wm.shell.common.SyncTransactionQueue
import com.android.wm.shell.compatui.api.CompatUIHandler
import com.android.wm.shell.desktopmode.DesktopActivityOrientationChangeHandler
@@ -178,7 +177,6 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() {
    protected lateinit var desktopState: FakeDesktopState
    protected lateinit var shellDesktopState: FakeShellDesktopState
    protected lateinit var desktopConfig: FakeDesktopConfig
    private val mockUserProfileContexts = mock<UserProfileContexts>()

    private val transactionFactory = Supplier<SurfaceControl.Transaction> {
        SurfaceControl.Transaction()
@@ -217,8 +215,6 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() {
        whenever(display.type).thenReturn(Display.TYPE_INTERNAL)
        whenever(mockDesktopUserRepositories.getProfile(anyInt()))
            .thenReturn(mockDesktopRepository)
        whenever(mockUserProfileContexts[anyInt()]).thenReturn(spyContext)
        whenever(mockUserProfileContexts.getOrCreate(anyInt())).thenReturn(spyContext)
        desktopModeCompatPolicy = DesktopModeCompatPolicy(spyContext)
        appHandleAndHeaderVisibilityHelper = AppHandleAndHeaderVisibilityHelper(
            displayController = mockDisplayController,
@@ -277,7 +273,6 @@ open class DesktopModeWindowDecorViewModelTestsBase : ShellTestCase() {
            mockDesksOrganizer,
            shellDesktopState,
            desktopConfig,
            mockUserProfileContexts,
        )
        desktopModeWindowDecorViewModel.setSplitScreenController(mockSplitScreenController)
        whenever(mockDisplayController.getDisplayLayout(any())).thenReturn(mockDisplayLayout)