Loading telephony/java/android/telephony/TelephonyManager.java +76 −21 Original line number Diff line number Diff line Loading @@ -159,7 +159,8 @@ public class TelephonyManager { /** * Returns the software version number for the device, for example, * the IMEI/SV for GSM phones. * the IMEI/SV for GSM phones. Return null if the software version is * not available. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -168,13 +169,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getDeviceSvn(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA * phones. * Returns the unique device ID, for example, the IMEI for GSM and the MEID * for CDMA phones. Return null if device ID is not available. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -183,12 +186,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getDeviceId(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Returns the current location of the device. * Return null if current location is not available. * * <p>Requires Permission: * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or Loading @@ -199,9 +205,11 @@ public class TelephonyManager { Bundle bundle = getITelephony().getCellLocation(); return CellLocation.newFromBundle(bundle); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Enables location update notifications. {@link PhoneStateListener#onCellLocationChanged Loading @@ -216,6 +224,7 @@ public class TelephonyManager { try { getITelephony().enableLocationUpdates(); } catch (RemoteException ex) { } catch (NullPointerException ex) { } } Loading @@ -232,6 +241,7 @@ public class TelephonyManager { try { getITelephony().disableLocationUpdates(); } catch (RemoteException ex) { } catch (NullPointerException ex) { } } Loading @@ -247,9 +257,10 @@ public class TelephonyManager { try { return getITelephony().getNeighboringCellInfo(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** Loading Loading @@ -293,6 +304,10 @@ public class TelephonyManager { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(); } catch (NullPointerException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(); } } Loading Loading @@ -421,6 +436,9 @@ public class TelephonyManager { } catch(RemoteException ex) { // This shouldn't happen in the normal case return NETWORK_TYPE_UNKNOWN; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return NETWORK_TYPE_UNKNOWN; } } Loading Loading @@ -489,6 +507,9 @@ public class TelephonyManager { } catch (RemoteException ex) { // Assume no ICC card if remote exception which shouldn't happen return false; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return false; } } Loading Loading @@ -556,7 +577,8 @@ public class TelephonyManager { } /** * Returns the serial number of the SIM, if applicable. * Returns the serial number of the SIM, if applicable. Return null if it is * unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -565,8 +587,11 @@ public class TelephonyManager { try { return getSubscriberInfo().getIccSerialNumber(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } // Loading @@ -577,6 +602,7 @@ public class TelephonyManager { /** * Returns the unique subscriber ID, for example, the IMSI for a GSM phone. * Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -585,13 +611,16 @@ public class TelephonyManager { try { return getSubscriberInfo().getSubscriberId(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the phone number string for line 1, for example, the MSISDN * for a GSM phone. * for a GSM phone. Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -600,12 +629,16 @@ public class TelephonyManager { try { return getSubscriberInfo().getLine1Number(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the alphabetic identifier associated with the line 1 number. * Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -616,12 +649,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getLine1AlphaTag(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the voice mail number. * Returns the voice mail number. Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -630,12 +666,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getVoiceMailNumber(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the voice mail count. * Returns the voice mail count. Return 0 if unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -645,8 +684,11 @@ public class TelephonyManager { try { return getITelephony().getVoiceMessageCount(); } catch (RemoteException ex) { } return 0; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return 0; } } /** Loading @@ -660,8 +702,11 @@ public class TelephonyManager { try { return getSubscriberInfo().getVoiceMailAlphaTag(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } private IPhoneSubInfo getSubscriberInfo() { Loading Loading @@ -759,6 +804,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return DATA_DISCONNECTED; } catch (NullPointerException ex) { return DATA_DISCONNECTED; } } Loading Loading @@ -802,6 +849,8 @@ public class TelephonyManager { mRegistry.listen(pkgForDebug, listener.callback, events, notifyNow); } catch (RemoteException ex) { // system process dead } catch (NullPointerException ex) { // system process dead } } Loading @@ -816,6 +865,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return -1; } catch (NullPointerException ex) { return -1; } } Loading @@ -832,6 +883,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return -1; } catch (NullPointerException ex) { return -1; } } Loading @@ -846,6 +899,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return null; } catch (NullPointerException ex) { return null; } } } Loading
telephony/java/android/telephony/TelephonyManager.java +76 −21 Original line number Diff line number Diff line Loading @@ -159,7 +159,8 @@ public class TelephonyManager { /** * Returns the software version number for the device, for example, * the IMEI/SV for GSM phones. * the IMEI/SV for GSM phones. Return null if the software version is * not available. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -168,13 +169,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getDeviceSvn(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Returns the unique device ID, for example, the IMEI for GSM and the MEID for CDMA * phones. * Returns the unique device ID, for example, the IMEI for GSM and the MEID * for CDMA phones. Return null if device ID is not available. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -183,12 +186,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getDeviceId(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Returns the current location of the device. * Return null if current location is not available. * * <p>Requires Permission: * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or Loading @@ -199,9 +205,11 @@ public class TelephonyManager { Bundle bundle = getITelephony().getCellLocation(); return CellLocation.newFromBundle(bundle); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** * Enables location update notifications. {@link PhoneStateListener#onCellLocationChanged Loading @@ -216,6 +224,7 @@ public class TelephonyManager { try { getITelephony().enableLocationUpdates(); } catch (RemoteException ex) { } catch (NullPointerException ex) { } } Loading @@ -232,6 +241,7 @@ public class TelephonyManager { try { getITelephony().disableLocationUpdates(); } catch (RemoteException ex) { } catch (NullPointerException ex) { } } Loading @@ -247,9 +257,10 @@ public class TelephonyManager { try { return getITelephony().getNeighboringCellInfo(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { return null; } } /** Loading Loading @@ -293,6 +304,10 @@ public class TelephonyManager { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(); } catch (NullPointerException ex) { // This shouldn't happen in the normal case, as a backup we // read from the system property. return getPhoneTypeFromProperty(); } } Loading Loading @@ -421,6 +436,9 @@ public class TelephonyManager { } catch(RemoteException ex) { // This shouldn't happen in the normal case return NETWORK_TYPE_UNKNOWN; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return NETWORK_TYPE_UNKNOWN; } } Loading Loading @@ -489,6 +507,9 @@ public class TelephonyManager { } catch (RemoteException ex) { // Assume no ICC card if remote exception which shouldn't happen return false; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return false; } } Loading Loading @@ -556,7 +577,8 @@ public class TelephonyManager { } /** * Returns the serial number of the SIM, if applicable. * Returns the serial number of the SIM, if applicable. Return null if it is * unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -565,8 +587,11 @@ public class TelephonyManager { try { return getSubscriberInfo().getIccSerialNumber(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } // Loading @@ -577,6 +602,7 @@ public class TelephonyManager { /** * Returns the unique subscriber ID, for example, the IMSI for a GSM phone. * Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -585,13 +611,16 @@ public class TelephonyManager { try { return getSubscriberInfo().getSubscriberId(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the phone number string for line 1, for example, the MSISDN * for a GSM phone. * for a GSM phone. Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -600,12 +629,16 @@ public class TelephonyManager { try { return getSubscriberInfo().getLine1Number(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the alphabetic identifier associated with the line 1 number. * Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -616,12 +649,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getLine1AlphaTag(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the voice mail number. * Returns the voice mail number. Return null if it is unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -630,12 +666,15 @@ public class TelephonyManager { try { return getSubscriberInfo().getVoiceMailNumber(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } /** * Returns the voice mail count. * Returns the voice mail count. Return 0 if unavailable. * <p> * Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} Loading @@ -645,8 +684,11 @@ public class TelephonyManager { try { return getITelephony().getVoiceMessageCount(); } catch (RemoteException ex) { } return 0; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return 0; } } /** Loading @@ -660,8 +702,11 @@ public class TelephonyManager { try { return getSubscriberInfo().getVoiceMailAlphaTag(); } catch (RemoteException ex) { } return null; } catch (NullPointerException ex) { // This could happen before phone restarts due to crashing return null; } } private IPhoneSubInfo getSubscriberInfo() { Loading Loading @@ -759,6 +804,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return DATA_DISCONNECTED; } catch (NullPointerException ex) { return DATA_DISCONNECTED; } } Loading Loading @@ -802,6 +849,8 @@ public class TelephonyManager { mRegistry.listen(pkgForDebug, listener.callback, events, notifyNow); } catch (RemoteException ex) { // system process dead } catch (NullPointerException ex) { // system process dead } } Loading @@ -816,6 +865,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return -1; } catch (NullPointerException ex) { return -1; } } Loading @@ -832,6 +883,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return -1; } catch (NullPointerException ex) { return -1; } } Loading @@ -846,6 +899,8 @@ public class TelephonyManager { } catch (RemoteException ex) { // the phone process is restarting. return null; } catch (NullPointerException ex) { return null; } } }