From d37870af20dc4c1dd4b5a13889767d699a85e701 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 7 Oct 2010 12:22:56 -0400 Subject: [PATCH] Don't crash if there is no phone app and someone presses the phone button. The phone button probably doesn't exist on products without phone apps, but the monkeys still know how to find it. Change-Id: I36aca53506c8d7d7565df8674aff9d59745139e0 --- .../src/com/android/internal/policy/impl/PhoneWindow.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index c25df1d3b0d04..24c9443ea98e1 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -1504,7 +1504,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { sendCloseSystemWindows(); Intent intent = new Intent(Intent.ACTION_CALL_BUTTON); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - getContext().startActivity(intent); + try { + getContext().startActivity(intent); + } catch (ActivityNotFoundException e) { + Log.w(TAG, "No activity found for android.intent.action.CALL_BUTTON."); + } } @Override