From 939f5bd3e827a4e1c6dbda03d19c174a7957b433 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 14 Apr 2020 15:05:11 -0700 Subject: [PATCH] Ignore failure when un/registering listener for invalid display - In the wm tests, the virtual display can be removed by the time we go to update the back gesture handler, which can result in an exception that (unnecessarily) crashes SysUI. Bug: 154041177 Test: Manual, not actually able to repro Change-Id: Iec2a0aaeed43254693a6d2ef01205641189a5648 --- .../systemui/statusbar/phone/EdgeBackGestureHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java index f103bd01fc3f9..7d422e3c15a2c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java @@ -312,7 +312,7 @@ public class EdgeBackGestureHandler implements DisplayListener, WindowManagerGlobal.getWindowManagerService() .unregisterSystemGestureExclusionListener( mGestureExclusionListener, mDisplayId); - } catch (RemoteException e) { + } catch (RemoteException | IllegalArgumentException e) { Log.e(TAG, "Failed to unregister window manager callbacks", e); } @@ -326,7 +326,7 @@ public class EdgeBackGestureHandler implements DisplayListener, WindowManagerGlobal.getWindowManagerService() .registerSystemGestureExclusionListener( mGestureExclusionListener, mDisplayId); - } catch (RemoteException e) { + } catch (RemoteException | IllegalArgumentException e) { Log.e(TAG, "Failed to register window manager callbacks", e); }