diff options
Diffstat (limited to 'telecomm/java/android/telecom/TelecomManager.java')
-rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index cda3387b8fac..4016943d9c2c 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -18,6 +18,7 @@ import static android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE; import android.Manifest; import android.annotation.IntDef; +import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SuppressAutoDoc; @@ -1954,6 +1955,29 @@ public class TelecomManager { return result; } + + /** + * Creates the {@link Intent} which can be used with {@link Context#startActivity(Intent)} to + * launch the activity for emergency dialer. + * + * @param number Optional number to call in emergency dialer + * @hide + */ + @SystemApi + @NonNull + public Intent createLaunchEmergencyDialerIntent(@Nullable String number) { + ITelecomService service = getTelecomService(); + Intent result = null; + if (service != null) { + try { + result = service.createLaunchEmergencyDialerIntent(number); + } catch (RemoteException e) { + Log.e(TAG, "Error createLaunchEmergencyDialerIntent", e); + } + } + return result; + } + /** * Determines whether Telecom would permit an incoming call to be added via the * {@link #addNewIncomingCall(PhoneAccountHandle, Bundle)} API for the specified |