Loading core/java/android/view/SurfaceControlViewHost.java +8 −1 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; import android.util.Log; import android.view.accessibility.IAccessibilityEmbeddedConnection; import android.view.InsetsState; import android.view.WindowManagerGlobal; import android.view.accessibility.IAccessibilityEmbeddedConnection; import java.util.Objects; Loading Loading @@ -428,4 +428,11 @@ public class SurfaceControlViewHost { WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); mReleased = true; } /** * @hide */ public IBinder getFocusGrantToken() { return mWm.getFocusGrantToken(); } } libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java +13 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,19 @@ public class SystemWindows { return null; } /** * Gets a token associated with the view that can be used to grant the view focus. */ public IBinder getFocusGrantToken(View view) { SurfaceControlViewHost root = mViewRoots.get(view); if (root == null) { Slog.e(TAG, "Couldn't get focus grant token since view does not exist in " + "SystemWindow:" + view); return null; } return root.getFocusGrantToken(); } private class PerDisplay { final int mDisplayId; private final SparseArray<SysUiWindowManager> mWwms = new SparseArray<>(); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +2 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.Debug; import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.util.Size; Loading Loading @@ -126,7 +125,6 @@ public class PhonePipMenuController implements PipMenuController { private int mMenuState; private PipMenuView mPipMenuView; private IBinder mPipMenuInputToken; private ActionListener mMediaActionListener = new ActionListener() { @Override Loading Loading @@ -206,7 +204,6 @@ public class PhonePipMenuController implements PipMenuController { mApplier = null; mSystemWindows.removeView(mPipMenuView); mPipMenuView = null; mPipMenuInputToken = null; } /** Loading Loading @@ -392,7 +389,6 @@ public class PhonePipMenuController implements PipMenuController { if (mApplier == null) { mApplier = new SyncRtSurfaceTransactionApplier(mPipMenuView); mPipMenuInputToken = mPipMenuView.getViewRootImpl().getInputToken(); } return mApplier != null; Loading Loading @@ -539,7 +535,8 @@ public class PhonePipMenuController implements PipMenuController { try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, mPipMenuInputToken, menuState != MENU_STATE_NONE /* grantFocus */); mSystemWindows.getFocusGrantToken(mPipMenuView), menuState != MENU_STATE_NONE /* grantFocus */); } catch (RemoteException e) { Log.e(TAG, "Unable to update focus as menu appears/disappears", e); } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ public class TvPipMenuController implements PipMenuController, TvPipMenuView.Lis mSystemWindows.addView(mPipMenuView, getPipMenuLayoutParams(MENU_WINDOW_TITLE, 0 /* width */, 0 /* height */), 0, SHELL_ROOT_LAYER_PIP); mPipMenuView.setFocusGrantToken(mSystemWindows.getFocusGrantToken(mPipMenuView)); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java +7 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.app.PendingIntent; import android.app.RemoteAction; import android.content.Context; import android.os.Handler; import android.os.IBinder; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; Loading Loading @@ -69,6 +70,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { private final ImageView mArrowRight; private final ImageView mArrowDown; private final ImageView mArrowLeft; private IBinder mFocusGrantToken = null; public TvPipMenuView(@NonNull Context context) { this(context, null); Loading Loading @@ -108,6 +110,10 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { mListener = listener; } void setFocusGrantToken(IBinder token) { mFocusGrantToken = token; } void show(boolean inMoveMode, int gravity) { if (DEBUG) Log.d(TAG, "show(), inMoveMode: " + inMoveMode); grantWindowFocus(true); Loading Loading @@ -162,7 +168,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, getViewRootImpl().getInputToken(), grantFocus); mFocusGrantToken, grantFocus); } catch (Exception e) { Log.e(TAG, "Unable to update focus", e); } Loading Loading
core/java/android/view/SurfaceControlViewHost.java +8 −1 Original line number Diff line number Diff line Loading @@ -28,9 +28,9 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.RemoteException; import android.util.Log; import android.view.accessibility.IAccessibilityEmbeddedConnection; import android.view.InsetsState; import android.view.WindowManagerGlobal; import android.view.accessibility.IAccessibilityEmbeddedConnection; import java.util.Objects; Loading Loading @@ -428,4 +428,11 @@ public class SurfaceControlViewHost { WindowManagerGlobal.getInstance().removeWindowlessRoot(mViewRoot); mReleased = true; } /** * @hide */ public IBinder getFocusGrantToken() { return mWm.getFocusGrantToken(); } }
libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java +13 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,19 @@ public class SystemWindows { return null; } /** * Gets a token associated with the view that can be used to grant the view focus. */ public IBinder getFocusGrantToken(View view) { SurfaceControlViewHost root = mViewRoots.get(view); if (root == null) { Slog.e(TAG, "Couldn't get focus grant token since view does not exist in " + "SystemWindow:" + view); return null; } return root.getFocusGrantToken(); } private class PerDisplay { final int mDisplayId; private final SparseArray<SysUiWindowManager> mWwms = new SparseArray<>(); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java +2 −5 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import android.graphics.Rect; import android.graphics.RectF; import android.os.Debug; import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.util.Size; Loading Loading @@ -126,7 +125,6 @@ public class PhonePipMenuController implements PipMenuController { private int mMenuState; private PipMenuView mPipMenuView; private IBinder mPipMenuInputToken; private ActionListener mMediaActionListener = new ActionListener() { @Override Loading Loading @@ -206,7 +204,6 @@ public class PhonePipMenuController implements PipMenuController { mApplier = null; mSystemWindows.removeView(mPipMenuView); mPipMenuView = null; mPipMenuInputToken = null; } /** Loading Loading @@ -392,7 +389,6 @@ public class PhonePipMenuController implements PipMenuController { if (mApplier == null) { mApplier = new SyncRtSurfaceTransactionApplier(mPipMenuView); mPipMenuInputToken = mPipMenuView.getViewRootImpl().getInputToken(); } return mApplier != null; Loading Loading @@ -539,7 +535,8 @@ public class PhonePipMenuController implements PipMenuController { try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, mPipMenuInputToken, menuState != MENU_STATE_NONE /* grantFocus */); mSystemWindows.getFocusGrantToken(mPipMenuView), menuState != MENU_STATE_NONE /* grantFocus */); } catch (RemoteException e) { Log.e(TAG, "Unable to update focus as menu appears/disappears", e); } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuController.java +1 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,7 @@ public class TvPipMenuController implements PipMenuController, TvPipMenuView.Lis mSystemWindows.addView(mPipMenuView, getPipMenuLayoutParams(MENU_WINDOW_TITLE, 0 /* width */, 0 /* height */), 0, SHELL_ROOT_LAYER_PIP); mPipMenuView.setFocusGrantToken(mSystemWindows.getFocusGrantToken(mPipMenuView)); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipMenuView.java +7 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.app.PendingIntent; import android.app.RemoteAction; import android.content.Context; import android.os.Handler; import android.os.IBinder; import android.util.AttributeSet; import android.util.Log; import android.view.Gravity; Loading Loading @@ -69,6 +70,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { private final ImageView mArrowRight; private final ImageView mArrowDown; private final ImageView mArrowLeft; private IBinder mFocusGrantToken = null; public TvPipMenuView(@NonNull Context context) { this(context, null); Loading Loading @@ -108,6 +110,10 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { mListener = listener; } void setFocusGrantToken(IBinder token) { mFocusGrantToken = token; } void show(boolean inMoveMode, int gravity) { if (DEBUG) Log.d(TAG, "show(), inMoveMode: " + inMoveMode); grantWindowFocus(true); Loading Loading @@ -162,7 +168,7 @@ public class TvPipMenuView extends FrameLayout implements View.OnClickListener { try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, getViewRootImpl().getInputToken(), grantFocus); mFocusGrantToken, grantFocus); } catch (Exception e) { Log.e(TAG, "Unable to update focus", e); } Loading