Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd4ab038 authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

Fixes NPE crash when VRI#setView fail before input stage was create.

Also catch RuntimeException for addToDisplayAsUser in case the throwing
type was not RemoteException.

Bug: 253200800
Bug: 263078961
Test: Simulate to throw a runtime exception in WMS#addWindow, and verify
VRI#setView should catch that exception, and clear resources without
crash.

Change-Id: Ia113b836e4a18c656093f9db7f63e9c50c427e6c
Merged-In: Ia113b836e4a18c656093f9db7f63e9c50c427e6c
(cherry picked from commit f1a57407)
parent 61d3c91e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1274,7 +1274,7 @@ public final class ViewRootImpl implements ViewParent,
                    mTmpFrames.attachedFrame = attachedFrame;
                    mTmpFrames.compatScale = compatScale[0];
                    mInvCompatScale = 1f / compatScale[0];
                } catch (RemoteException e) {
                } catch (RemoteException | RuntimeException e) {
                    mAdded = false;
                    mView = null;
                    mAttachInfo.mRootView = null;