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

Commit 1400c20f authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Change TestActivity to not be immersive

Focus tests will fail if the immersive window is shown on top.
Dismissing the immersive window doesn't to seem to work in all cases,
likely due to a race.

Instead, no longer make the activity immersive.

Test: requestFocusWithMultipleWindows
Bug: 313674425
Change-Id: Idc9d3031a75f59fc1ce8591a168d56217f9c5b48
parent 1b679fb5
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -16,17 +16,11 @@

package com.android.server.wm.utils;

import static android.view.WindowInsets.Type.displayCutout;
import static android.view.WindowInsets.Type.systemBars;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;

import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;

import android.app.Activity;
import android.app.KeyguardManager;
import android.os.Bundle;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;
@@ -35,7 +29,6 @@ import androidx.annotation.Nullable;
 * TestActivity that will ensure it dismisses keyguard and shows as a fullscreen activity.
 */
public class TestActivity extends Activity {
    private static final int sTypeMask = systemBars() | displayCutout();
    private FrameLayout mParentLayout;

    @Override
@@ -48,13 +41,6 @@ public class TestActivity extends Activity {
                FrameLayout.LayoutParams.MATCH_PARENT);
        setContentView(mParentLayout, layoutParams);

        WindowInsetsController windowInsetsController = getWindow().getInsetsController();
        windowInsetsController.hide(sTypeMask);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
        getWindow().setAttributes(params);
        getWindow().setDecorFitsSystemWindows(false);

        final KeyguardManager keyguardManager = getInstrumentation().getContext().getSystemService(
                KeyguardManager.class);
        if (keyguardManager != null && keyguardManager.isKeyguardLocked()) {