diff options
Diffstat (limited to 'telecomm/java/android/telecom/TelecomManager.java')
-rw-r--r-- | telecomm/java/android/telecom/TelecomManager.java | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 368e1375a648..a0669e405851 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -124,6 +124,16 @@ public class TelecomManager { "android.telecom.action.CHANGE_DEFAULT_DIALER"; /** + * Broadcast intent action indicating that the current default dialer has changed. + * The string extra {@link #EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME} will contain the + * name of the package that the default dialer was changed to. + * + * @see #EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME + */ + public static final String ACTION_DEFAULT_DIALER_CHANGED = + "android.telecom.action.DEFAULT_DIALER_CHANGED"; + + /** * Extra value used to provide the package name for {@link #ACTION_CHANGE_DEFAULT_DIALER}. */ public static final String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = @@ -467,39 +477,6 @@ public class TelecomManager { } /** - * Sets the SIM call manager to the specified phone account. - * - * @param accountHandle The phone account handle of the account to set as the sim call manager. - * @hide - */ - public void setSimCallManager(PhoneAccountHandle accountHandle) { - try { - if (isServiceConnected()) { - getTelecomService().setSimCallManager(accountHandle); - } - } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelecomService#setSimCallManager"); - } - } - - /** - * Returns the list of registered SIM call managers. - * - * @return List of registered SIM call managers. - * @hide - */ - public List<PhoneAccountHandle> getSimCallManagers() { - try { - if (isServiceConnected()) { - return getTelecomService().getSimCallManagers(mContext.getOpPackageName()); - } - } catch (RemoteException e) { - Log.e(TAG, "Error calling ITelecomService#getSimCallManagers"); - } - return new ArrayList<>(); - } - - /** * Returns the current connection manager. Apps must be prepared for this method to return * {@code null}, indicating that there currently exists no user-chosen default * {@code PhoneAccount}. @@ -774,6 +751,31 @@ public class TelecomManager { } /** + * Used to set the default dialer package. + * + * @param packageName to set the default dialer to.. + * + * @result {@code true} if the default dialer was successfully changed, {@code false} if + * the specified package does not correspond to an installed dialer, or is already + * the default dialer. + * + * Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} + * Requires permission: {@link android.Manifest.permission#WRITE_SECURE_SETTINGS} + * + * @hide + */ + public boolean setDefaultDialer(String packageName) { + try { + if (isServiceConnected()) { + return getTelecomService().setDefaultDialer(packageName); + } + } catch (RemoteException e) { + Log.e(TAG, "RemoteException attempting to set the default dialer.", e); + } + return false; + } + + /** * Used to determine the dialer package that is preloaded on the system partition. * * @return package name for the system dialer package or null if no system dialer is preloaded. |