diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/telephony/TelephonyRegistryManager.java | 27 | ||||
| -rw-r--r-- | core/java/com/android/internal/telephony/ITelephonyRegistry.aidl | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/telephony/TelephonyRegistryManager.java b/core/java/android/telephony/TelephonyRegistryManager.java index 859fd804dea5..e7f89204c1ec 100644 --- a/core/java/android/telephony/TelephonyRegistryManager.java +++ b/core/java/android/telephony/TelephonyRegistryManager.java @@ -285,6 +285,8 @@ public class TelephonyRegistryManager { * UI. There is no timeout associated with showing this UX, so a carrier app must be sure to * call with active set to false sometime after calling with it set to {@code true}. * <p> + * This will apply to all subscriptions the carrier app has carrier privileges on. + * <p> * Requires Permission: calling app has carrier privileges. * * @param active Whether the carrier network change is or shortly will be @@ -300,6 +302,31 @@ public class TelephonyRegistryManager { } /** + * Informs the system of an intentional upcoming carrier network change by a carrier app on the + * given {@code subscriptionId}. This call only used to allow the system to provide alternative + * UI while telephony is performing an action that may result in intentional, temporary network + * lack of connectivity. + * <p> + * Based on the active parameter passed in, this method will either show or hide the + * alternative UI. There is no timeout associated with showing this UX, so a carrier app must be + * sure to call with active set to false sometime after calling with it set to {@code true}. + * <p> + * Requires Permission: calling app has carrier privileges. + * + * @param subscriptionId the subscription of the carrier network. + * @param active whether the carrier network change is or shortly will be active. Set this value + * to true to begin showing alternative UI and false to stop. + * @see TelephonyManager#hasCarrierPrivileges + */ + public void notifyCarrierNetworkChange(int subscriptionId, boolean active) { + try { + sRegistry.notifyCarrierNetworkChangeWithSubId(subscriptionId, active); + } catch (RemoteException ex) { + // system server crash + } + } + + /** * Notify call state changed on certain subscription. * * @param slotIndex for which call state changed. Can be derived from subId except when subId is diff --git a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 6ba0279313b1..15d4246e302a 100644 --- a/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/core/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -77,6 +77,7 @@ interface ITelephonyRegistry { void notifySubscriptionInfoChanged(); void notifyOpportunisticSubscriptionInfoChanged(); void notifyCarrierNetworkChange(in boolean active); + void notifyCarrierNetworkChangeWithSubId(in int subId, in boolean active); void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state); void notifyDisplayInfoChanged(int slotIndex, int subId, in TelephonyDisplayInfo telephonyDisplayInfo); void notifyPhoneCapabilityChanged(in PhoneCapability capability); |
