From b8f03072d46b0d535415c07655b9fe5a8c41fb8f Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 23 Jun 2015 11:52:04 -0700 Subject: [PATCH] Catching launch errors when trying to go Home while Home is updating. Bug: 21442898 Change-Id: I7fc74422b220cb02acb195b5c9121ff72bc16dbe --- .../src/com/android/systemui/recents/RecentsActivity.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 3cd769eb43a9..da7247cf88d5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -36,6 +36,7 @@ import android.widget.Toast; import com.android.systemui.Prefs; import com.android.systemui.R; +import com.android.systemui.recents.misc.Console; import com.android.systemui.recents.misc.DebugTrigger; import com.android.systemui.recents.misc.ReferenceCountedTrigger; import com.android.systemui.recents.misc.SystemServicesProxy; @@ -108,10 +109,15 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView public void run() { // Finish Recents if (mLaunchIntent != null) { - if (mLaunchOpts != null) { - startActivityAsUser(mLaunchIntent, mLaunchOpts.toBundle(), UserHandle.CURRENT); - } else { - startActivityAsUser(mLaunchIntent, UserHandle.CURRENT); + try { + if (mLaunchOpts != null) { + startActivityAsUser(mLaunchIntent, mLaunchOpts.toBundle(), UserHandle.CURRENT); + } else { + startActivityAsUser(mLaunchIntent, UserHandle.CURRENT); + } + } catch (Exception e) { + Console.logError(RecentsActivity.this, + getString(R.string.recents_launch_error_message, "Home")); } } else { finish(); -- 2.11.0