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

Commit 66c017e7 authored by Matt Pietal's avatar Matt Pietal
Browse files

Capture all remote exceptions

A surface may no longer be available on callback, which results in a
Throwable exception. We've seen this mainly during tests. Capture and
log the exception to prevent a crash.

Fixes: 277481883
Test: manual
Change-Id: Ie121aec4f1ff58cff432b94120efae00bdb97268
parent b26be926
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2941,9 +2941,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        if (mSurfaceBehindRemoteAnimationFinishedCallback != null) {
            try {
                mSurfaceBehindRemoteAnimationFinishedCallback.onAnimationFinished();
            } catch (Throwable t) {
                // The surface may no longer be available. Just capture the exception
                Log.w(TAG, "Surface behind remote animation callback failed, and it's probably ok: "
                        + t.getMessage());
            } finally {
                mSurfaceBehindRemoteAnimationFinishedCallback = null;
            } catch (RemoteException e) {
                e.printStackTrace();
            }
        }
    }