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

Commit 8b3dc9e5 authored by Tyler Lacey's avatar Tyler Lacey Committed by Automerger Merge Worker
Browse files

Merge "Use Window Context for SurfaceControlViewHost." into tm-dev am:...

Merge "Use Window Context for SurfaceControlViewHost." into tm-dev am: c85e97a7 am: 31b90874 am: 92347363

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17619324



Change-Id: I6d753ba357ae8596fb4b3fcc5a187e50bff44c8b
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e31af8a8 92347363
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.hardware.display.DisplayManager;
import android.os.Binder;
@@ -28,6 +29,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.view.Display;
import android.view.SurfaceControlViewHost;
import android.view.WindowManager;

import com.android.internal.infra.AndroidFuture;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -117,13 +119,18 @@ public abstract class GameSessionService extends Service {
        }

        IBinder hostToken = new Binder();

        // Use a WindowContext so that views attached to the SurfaceControlViewHost will receive
        // configuration changes (rather than always perceiving the global configuration).
        final Context windowContext = createWindowContext(display,
                WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, /*options=*/ null);
        SurfaceControlViewHost surfaceControlViewHost =
                new SurfaceControlViewHost(this, display, hostToken);
                new SurfaceControlViewHost(windowContext, display, hostToken);

        gameSession.attach(
                gameSessionController,
                createGameSessionRequest.getTaskId(),
                this,
                windowContext,
                surfaceControlViewHost,
                gameSessionViewHostConfiguration.mWidthPx,
                gameSessionViewHostConfiguration.mHeightPx);