From 5a03ade7945a51f731a1d602d2cc6c918e9b1507 Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 15 Jun 2021 19:34:24 -0700 Subject: [PATCH] Improving diagnostics when Launcher dies while in ContentProvider call Test: presubmit Bug: 191059619 Change-Id: Ib87a41663a63729024b41603973b782cf4763551 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 426af19084..bffd3509ea 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -39,6 +39,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.net.Uri; import android.os.Bundle; +import android.os.DeadObjectException; import android.os.Parcelable; import android.os.RemoteException; import android.os.SystemClock; @@ -269,6 +270,9 @@ public final class LauncherInstrumentation { try (ContentProviderClient client = getContext().getContentResolver() .acquireContentProviderClient(mTestProviderUri)) { return client.call(request, null, null); + } catch (DeadObjectException e) { + fail("Launcher crashed"); + return null; } catch (RemoteException e) { throw new RuntimeException(e); }