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

Commit 1c4ea0e8 authored by Sandeep Gutta's avatar Sandeep Gutta Committed by Natiq Ahmed
Browse files

Telephony: Catch NullPointerException in getDataEnabled

Some times when phone app crashed observing crash in System server.
The reason is, when phone crashed, GPS location trying to access
TelephonyManager API which resulting in  NullPointerException,
to resolve this catching NullPointerException.

Change-Id: I16b6044fa0033ac13a178ffab086c40bb06090dc
parent b6d7e057
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3783,12 +3783,12 @@ public class TelephonyManager {
    /** @hide */
    @SystemApi
    public boolean getDataEnabled(int subId) {
        boolean retVal;
        boolean retVal = false;
        try {
            retVal = getITelephony().getDataEnabled(subId);
        } catch (RemoteException e) {
            Log.e(TAG, "Error calling ITelephony#getDataEnabled", e);
            retVal = false;
        } catch (NullPointerException e) {
        }
        Log.d(TAG, "getDataEnabled: retVal=" + retVal);
        return retVal;