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

Commit 63508d35 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Request embedded focus if a SurfacePackage was added to SV" into udc-dev am: 6508dc31

parents 44de46fc 6508dc31
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1854,6 +1854,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
            applyTransactionOnVriDraw(transaction);
        }
        mSurfacePackage = p;

        if (isFocused()) {
            requestEmbeddedFocus(true);
        }
        invalidate();
    }

@@ -1949,6 +1953,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
    protected void onFocusChanged(boolean gainFocus, @FocusDirection int direction,
            @Nullable Rect previouslyFocusedRect) {
        super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
        requestEmbeddedFocus(gainFocus);
    }

    private void requestEmbeddedFocus(boolean gainFocus) {
        final ViewRootImpl viewRoot = getViewRootImpl();
        if (mSurfacePackage == null || viewRoot == null) {
            return;