From e0cf6e44274174db0a35cd35d111b49b6f8ac0d0 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Thu, 5 Nov 2020 11:33:50 -0800 Subject: [PATCH] PiP: Early return on MenusAlgorithm if there are no views. If there are any missing views, there's nothing to do. Bug: 161760276 Test: None Change-Id: If63a1e855b1924dab981dd55b7bc663ed9ee26e5 --- .../com/android/wm/shell/pip/phone/PipMenuIconsAlgorithm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuIconsAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuIconsAlgorithm.java index 985cd0f1fa197..6d12752d9218f 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuIconsAlgorithm.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuIconsAlgorithm.java @@ -60,6 +60,7 @@ public class PipMenuIconsAlgorithm { if (mViewRoot == null || mTopEndContainer == null || mDragHandle == null || mSettingsButton == null || mDismissButton == null) { Log.e(TAG, "One if the required views is null."); + return; } //We only need to calculate the layout once since it does not change.