diff options
| author | Andrew Lee <anwlee@google.com> | 2015-04-03 21:24:06 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-03 21:24:07 +0000 |
| commit | 73576b22bc56e047b2b6afecc74213589b33bc07 (patch) | |
| tree | 670136cc258d312918465a4bd5c30dfaf683bce9 | |
| parent | 8bd4f7b3d1c43aa54bac3fb205d6efdc776e2dbd (diff) | |
| parent | 896a1e650cf69f8dea1ef588c0089aaaf3d12e08 (diff) | |
| download | frameworks_base-73576b22bc56e047b2b6afecc74213589b33bc07.zip frameworks_base-73576b22bc56e047b2b6afecc74213589b33bc07.tar.gz frameworks_base-73576b22bc56e047b2b6afecc74213589b33bc07.tar.bz2 | |
Merge "Protect against null ITelephony to fix crash."
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 6bc6de63..d8bb0d7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3982,7 +3982,10 @@ public class TelephonyManager { */ public boolean canChangeDtmfToneLength() { try { - return getITelephony().canChangeDtmfToneLength(); + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.canChangeDtmfToneLength(); + } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#canChangeDtmfToneLength", e); } @@ -3996,7 +3999,10 @@ public class TelephonyManager { */ public boolean isWorldPhone() { try { - return getITelephony().isWorldPhone(); + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isWorldPhone(); + } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isWorldPhone", e); } @@ -4010,7 +4016,10 @@ public class TelephonyManager { */ public boolean isTtyModeSupported() { try { - return getITelephony().isTtyModeSupported(); + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isTtyModeSupported(); + } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isTtyModeSupported", e); } @@ -4025,7 +4034,10 @@ public class TelephonyManager { */ public boolean isHearingAidCompatibilitySupported() { try { - return getITelephony().isHearingAidCompatibilitySupported(); + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isHearingAidCompatibilitySupported(); + } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isHearingAidCompatibilitySupported", e); } |
