From 107821369b7af3b739a0b5617fb34ff19f7ca9b5 Mon Sep 17 00:00:00 2001 From: John Wang Date: Tue, 30 Jun 2009 12:01:35 -0700 Subject: Fix bug 1930055 of NullPointerException. The NullPointerException in getCallState is caused by the restarting of phone process. getITelephony() was not ready to be used at that moment. modified: java/android/telephony/TelephonyManager.java --- telephony/java/android/telephony/TelephonyManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'telephony') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index bf5df88..c9dcd8b 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -667,7 +667,10 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return CALL_STATE_IDLE; - } + } catch (NullPointerException ex) { + // the phone process is restarting. + return CALL_STATE_IDLE; + } } /** Data connection activity: No traffic. */ @@ -701,7 +704,10 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return DATA_ACTIVITY_NONE; - } + } catch (NullPointerException ex) { + // the phone process is restarting. + return DATA_ACTIVITY_NONE; + } } /** Data connection state: Disconnected. IP traffic not available. */ -- cgit v1.1