Loading packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +6 −3 Original line number Diff line number Diff line Loading @@ -548,16 +548,17 @@ public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganize /** * Setup the ViewHost and attach the provided menu view to the ViewHost. * @return The input token belonging to the PipMenuView. */ public void attachPipMenuViewHost(View menuView, WindowManager.LayoutParams lp) { public IBinder attachPipMenuViewHost(View menuView, WindowManager.LayoutParams lp) { if (mPipMenuSurface != null) { Log.e(TAG, "PIP Menu View already created and attached."); return; return null; } if (mLeash == null) { Log.e(TAG, "PiP Leash is not yet ready."); return; return null; } if (Looper.getMainLooper() != Looper.myLooper()) { Loading @@ -573,6 +574,8 @@ public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganize transaction.setRelativeLayer(mPipMenuSurface, mLeash, 1); transaction.apply(); mPipViewHost.setView(menuView, lp); return mPipViewHost.getSurfacePackage().getInputToken(); } Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +18 −1 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ import android.content.pm.ParceledListSlice; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.Debug; import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.view.MotionEvent; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.systemui.pip.PipTaskOrganizer; import com.android.systemui.pip.phone.PipMediaController.ActionListener; Loading Loading @@ -92,6 +94,7 @@ public class PipMenuActivityController { private int mMenuState; private PipMenuView mPipMenuView; private IBinder mPipMenuInputToken; private ActionListener mMediaActionListener = new ActionListener() { @Override Loading Loading @@ -120,6 +123,7 @@ public class PipMenuActivityController { hideMenu(); mPipTaskOrganizer.detachPipMenuViewHost(); mPipMenuView = null; mPipMenuInputToken = null; } public void onPinnedStackAnimationEnded() { Loading @@ -133,7 +137,13 @@ public class PipMenuActivityController { mPipMenuView = new PipMenuView(mContext, this); } mPipTaskOrganizer.attachPipMenuViewHost(mPipMenuView, getPipMenuLayoutParams(0, 0)); // If we haven't gotten the input toekn, that means we haven't had a success attempt // yet at attaching the PipMenuView if (mPipMenuInputToken == null) { mPipMenuInputToken = mPipTaskOrganizer.attachPipMenuViewHost(mPipMenuView, getPipMenuLayoutParams(0, 0)); } } /** Loading Loading @@ -352,6 +362,13 @@ public class PipMenuActivityController { // the menu actions to be updated again. mMediaController.removeListener(mMediaActionListener); } try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, mPipMenuInputToken, menuState != MENU_STATE_NONE /* grantFocus */); } catch (RemoteException e) { Log.e(TAG, "Unable to update focus as menu appears/disappears", e); } } mMenuState = menuState; } Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java +0 −4 Original line number Diff line number Diff line Loading @@ -154,10 +154,6 @@ public class PipMenuView extends FrameLayout { expandPip(); } }); // TODO (b/161710689): Remove this once focusability for Windowless window is working findViewById(R.id.expand_button).setFocusable(false); mDismissButton.setFocusable(false); mSettingsButton.setFocusable(false); mResizeHandle = findViewById(R.id.resize_handle); mResizeHandle.setAlpha(0); Loading Loading
packages/SystemUI/src/com/android/systemui/pip/PipTaskOrganizer.java +6 −3 Original line number Diff line number Diff line Loading @@ -548,16 +548,17 @@ public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganize /** * Setup the ViewHost and attach the provided menu view to the ViewHost. * @return The input token belonging to the PipMenuView. */ public void attachPipMenuViewHost(View menuView, WindowManager.LayoutParams lp) { public IBinder attachPipMenuViewHost(View menuView, WindowManager.LayoutParams lp) { if (mPipMenuSurface != null) { Log.e(TAG, "PIP Menu View already created and attached."); return; return null; } if (mLeash == null) { Log.e(TAG, "PiP Leash is not yet ready."); return; return null; } if (Looper.getMainLooper() != Looper.myLooper()) { Loading @@ -573,6 +574,8 @@ public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganize transaction.setRelativeLayer(mPipMenuSurface, mLeash, 1); transaction.apply(); mPipViewHost.setView(menuView, lp); return mPipViewHost.getSurfacePackage().getInputToken(); } Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +18 −1 Original line number Diff line number Diff line Loading @@ -27,10 +27,12 @@ import android.content.pm.ParceledListSlice; import android.graphics.PixelFormat; import android.graphics.Rect; import android.os.Debug; import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import android.view.MotionEvent; import android.view.WindowManager; import android.view.WindowManagerGlobal; import com.android.systemui.pip.PipTaskOrganizer; import com.android.systemui.pip.phone.PipMediaController.ActionListener; Loading Loading @@ -92,6 +94,7 @@ public class PipMenuActivityController { private int mMenuState; private PipMenuView mPipMenuView; private IBinder mPipMenuInputToken; private ActionListener mMediaActionListener = new ActionListener() { @Override Loading Loading @@ -120,6 +123,7 @@ public class PipMenuActivityController { hideMenu(); mPipTaskOrganizer.detachPipMenuViewHost(); mPipMenuView = null; mPipMenuInputToken = null; } public void onPinnedStackAnimationEnded() { Loading @@ -133,7 +137,13 @@ public class PipMenuActivityController { mPipMenuView = new PipMenuView(mContext, this); } mPipTaskOrganizer.attachPipMenuViewHost(mPipMenuView, getPipMenuLayoutParams(0, 0)); // If we haven't gotten the input toekn, that means we haven't had a success attempt // yet at attaching the PipMenuView if (mPipMenuInputToken == null) { mPipMenuInputToken = mPipTaskOrganizer.attachPipMenuViewHost(mPipMenuView, getPipMenuLayoutParams(0, 0)); } } /** Loading Loading @@ -352,6 +362,13 @@ public class PipMenuActivityController { // the menu actions to be updated again. mMediaController.removeListener(mMediaActionListener); } try { WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */, mPipMenuInputToken, menuState != MENU_STATE_NONE /* grantFocus */); } catch (RemoteException e) { Log.e(TAG, "Unable to update focus as menu appears/disappears", e); } } mMenuState = menuState; } Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuView.java +0 −4 Original line number Diff line number Diff line Loading @@ -154,10 +154,6 @@ public class PipMenuView extends FrameLayout { expandPip(); } }); // TODO (b/161710689): Remove this once focusability for Windowless window is working findViewById(R.id.expand_button).setFocusable(false); mDismissButton.setFocusable(false); mSettingsButton.setFocusable(false); mResizeHandle = findViewById(R.id.resize_handle); mResizeHandle.setAlpha(0); Loading