Fix NPE when calling dispatchTouchEvent in FloatingToolbarRoot

Bug: 220328857
Test: manual
Change-Id: Ib41e6910e001ecb71c82f12db22b94ef7329a3fd
This commit is contained in:
Joanne Chung
2022-02-22 20:20:16 +08:00
parent dd111c15df
commit 04b037e07d

View File

@@ -40,7 +40,7 @@ public class FloatingToolbarRoot extends LinearLayout {
private final IBinder mTargetInputToken;
private final SelectionToolbarRenderService.TransferTouchListener mTransferTouchListener;
private Rect mContentRect;
private final Rect mContentRect = new Rect();
private int mLastDownX = -1;
private int mLastDownY = -1;
@@ -57,7 +57,7 @@ public class FloatingToolbarRoot extends LinearLayout {
* Sets the Rect that shows the selection toolbar content.
*/
public void setContentRect(Rect contentRect) {
mContentRect = contentRect;
mContentRect.set(contentRect);
}
@Override