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

Commit 5f19a77f authored by Patrick Williams's avatar Patrick Williams Committed by Automerger Merge Worker
Browse files

Merge "Clear calling identity in TransactionHangCallback" into udc-dev am: d5cc57fc

parents d970da4c d5cc57fc
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -961,12 +961,20 @@ public final class ViewRootImpl implements ViewParent,
                }
                }


                sAnrReported = true;
                sAnrReported = true;
                // If we're making an in-process call to ActivityManagerService
                // and the previous binder call on this thread was oneway, the
                // calling PID will be 0. Clearing the calling identity fixes
                // this and ensures ActivityManager gets the correct calling
                // pid.
                final long identityToken = Binder.clearCallingIdentity();
                try {
                try {
                    ActivityManager.getService().appNotResponding(reason);
                    ActivityManager.getService().appNotResponding(reason);
                } catch (RemoteException e) {
                } catch (RemoteException e) {
                    // We asked the system to crash us, but the system
                    // We asked the system to crash us, but the system
                    // already crashed. Unfortunately things may be
                    // already crashed. Unfortunately things may be
                    // out of control.
                    // out of control.
                } finally {
                    Binder.restoreCallingIdentity(identityToken);
                }
                }
            }
            }
        };
        };