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

Commit d12f56e7 authored by wilsonshih's avatar wilsonshih
Browse files

Make the icon of SplashScreenView non-focusable

To make the embedded window of SplashScreenView non-focusable, needs
to add the window flag separately from SurfaceControlViewHost#setView

Bug: 319369153
Test: verify the embedded window of splash screen won't grant focus
Change-Id: Ic9b48dcc4de25e681405b3dd78468597a8a7c627
parent 583bc717
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;

@@ -337,7 +338,14 @@ public final class SplashScreenView extends FrameLayout {
                        "SplashScreenView");
                ImageView imageView = new ImageView(viewContext);
                imageView.setBackground(mIconDrawable);
                viewHost.setView(imageView, mIconSize, mIconSize);
                final int windowFlag = WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                        | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                        | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
                final WindowManager.LayoutParams lp =
                        new WindowManager.LayoutParams(mIconSize, mIconSize,
                                WindowManager.LayoutParams.TYPE_APPLICATION, windowFlag,
                                PixelFormat.TRANSPARENT);
                viewHost.setView(imageView, lp);
                SurfaceControlViewHost.SurfacePackage surfacePackage = viewHost.getSurfacePackage();
                surfaceView.setChildSurfacePackage(surfacePackage);
                view.mSurfacePackage = surfacePackage;