Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 896a1e65 authored by Andrew Lee's avatar Andrew Lee
Browse files

Protect against null ITelephony to fix crash.

Bug: 20066803
Change-Id: I4336e979dab3a4b1b3d53078af572ff3f822377a
parent 92c9692e
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -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);
        }