diff options
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/CarrierConfigManager.java | 34 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 40 |
2 files changed, 63 insertions, 11 deletions
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index 29e54a3..eda71e8 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -612,12 +612,15 @@ public class CarrierConfigManager { @Nullable public PersistableBundle getConfigForSubId(int subId) { try { - return getICarrierConfigLoader().getConfigForSubId(subId); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error getting config for subId " + subId + + " ICarrierConfigLoader is null"); + return null; + } + return loader.getConfigForSubId(subId); } catch (RemoteException ex) { - Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " - + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error getting config for subId " + Integer.toString(subId) + ": " + Rlog.e(TAG, "Error getting config for subId " + subId + ": " + ex.toString()); } return null; @@ -653,11 +656,15 @@ public class CarrierConfigManager { */ public void notifyConfigChangedForSubId(int subId) { try { - getICarrierConfigLoader().notifyConfigChangedForSubId(subId); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error reloading config for subId=" + subId + + " ICarrierConfigLoader is null"); + return; + } + loader.notifyConfigChangedForSubId(subId); } catch (RemoteException ex) { Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error reloading config for subId=" + subId + ": " + ex.toString()); } } @@ -673,11 +680,15 @@ public class CarrierConfigManager { @SystemApi public void updateConfigForPhoneId(int phoneId, String simState) { try { - getICarrierConfigLoader().updateConfigForPhoneId(phoneId, simState); + ICarrierConfigLoader loader = getICarrierConfigLoader(); + if (loader == null) { + Rlog.w(TAG, "Error updating config for phoneId=" + phoneId + + " ICarrierConfigLoader is null"); + return; + } + loader.updateConfigForPhoneId(phoneId, simState); } catch (RemoteException ex) { Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); - } catch (NullPointerException ex) { - Rlog.e(TAG, "Error updating config for phoneId=" + phoneId + ": " + ex.toString()); } } @@ -693,6 +704,7 @@ public class CarrierConfigManager { } /** @hide */ + @Nullable private ICarrierConfigLoader getICarrierConfigLoader() { return ICarrierConfigLoader.Stub .asInterface(ServiceManager.getService(Context.CARRIER_CONFIG_SERVICE)); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2e25ec7..7276980 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -602,6 +602,46 @@ public class TelephonyManager { public static final String EXTRA_DATA_FAILURE_CAUSE = PhoneConstants.DATA_FAILURE_CAUSE_KEY; /** + * Broadcast intent action for letting custom component know to show voicemail notification. + * @hide + */ + @SystemApi + public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = + "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"; + + /** + * The number of voice messages associated with the notification. + * @hide + */ + @SystemApi + public static final String EXTRA_NOTIFICATION_COUNT = + "android.telephony.extra.NOTIFICATION_COUNT"; + + /** + * The voicemail number. + * @hide + */ + @SystemApi + public static final String EXTRA_VOICEMAIL_NUMBER = + "android.telephony.extra.VOICEMAIL_NUMBER"; + + /** + * The intent to call voicemail. + * @hide + */ + @SystemApi + public static final String EXTRA_CALL_VOICEMAIL_INTENT = + "android.telephony.extra.CALL_VOICEMAIL_INTENT"; + + /** + * The intent to launch voicemail settings. + * @hide + */ + @SystemApi + public static final String EXTRA_LAUNCH_VOICEMAIL_SETTINGS_INTENT = + "android.telephony.extra.LAUNCH_VOICEMAIL_SETTINGS_INTENT"; + + /** * Response codes for sim activation. Activation completed successfully. * @hide */ |