Merge "Request embedded focus if a SurfacePackage was added to SV" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6508dc31db
@@ -1854,6 +1854,10 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
||||
applyTransactionOnVriDraw(transaction);
|
||||
}
|
||||
mSurfacePackage = p;
|
||||
|
||||
if (isFocused()) {
|
||||
requestEmbeddedFocus(true);
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
@@ -1947,8 +1951,12 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
|
||||
|
||||
@Override
|
||||
protected void onFocusChanged(boolean gainFocus, @FocusDirection int direction,
|
||||
@Nullable Rect previouslyFocusedRect) {
|
||||
@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;
|
||||
|
||||
Reference in New Issue
Block a user